Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp37040pxb; Wed, 27 Jan 2021 01:08:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTq+17uEjPIpBUXMtxdqV82dFQoboZyFGrkfARgXE3S5DgGoMQhdXWFnbOE4qAEcHER6lg X-Received: by 2002:a17:906:b082:: with SMTP id x2mr5738867ejy.100.1611738525552; Wed, 27 Jan 2021 01:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611738525; cv=none; d=google.com; s=arc-20160816; b=xJI4Qr6dkZm9gXCbAo/pxnw0Hy3j9YVH4zd88XiM7QrgkowNA8XOM6lrYzyEAf7lTA 1tL6vnf0Ms6HLFCxavxoQ/Tw8SJZhUQ+6EGlCqnttIGLDJSSkK8R0oonMXRen2U2qT8d 8Vm6sVJhODeBOr8ImLTqzryfJhGLpJ1yCgiu9S8cr5gAQxTszqlGBS9s2fXhRZ08iKib tXvXfz0CUGLXaUXgHvcomAJS4YfKnIqiasqDbC/faKsGDhmc98iYXaFASu+I0JQU/a+u wchzvSqNapAbWdJ/wYyz5IcuC1alUIQQGZ5UVRuYBRUcJv5k6/E8Tx5o93v4Wk8cVauv nIpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=0bjdnswoGpW7h5fO2+La1vj2ABJF/GMGpdlerYTu6Pk=; b=FYR4f7HzBh4QfSqY6Atqo5Rm00oOdY+C5iAhthRJMn/Sdzh4ueEn9dQuZg7zIU5PWL 9Zt+VQmeLnZz6o0UDhXd5uCf/tIDVajWclbQQ3ntYUZ7dNjb3d7Vw9f04+5SFp94gm/W Xfqmp2PtobCDcDeUMFFryuiH34rJptaEx4GvzVwa0tAS444DIcTmXo1vyHE4ND7yW1lW jsVqrKcQDorp0RAEWjz3Qs/GbmBpXr0jXfXl6No9z5u2mpgFDfazU50iIKgJ2IJlIH56 v3MHYXqkwHrhANZG64eoJBTKCLg5+BO5qjnROc1e+PotBbyZwcIKD1GBj5/UZep66BZf T6Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XMT0SfaD; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si613944ejo.415.2021.01.27.01.08.21; Wed, 27 Jan 2021 01:08:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XMT0SfaD; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234469AbhA0IJG (ORCPT + 99 others); Wed, 27 Jan 2021 03:09:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30434 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234617AbhA0IE7 (ORCPT ); Wed, 27 Jan 2021 03:04:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611734613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=0bjdnswoGpW7h5fO2+La1vj2ABJF/GMGpdlerYTu6Pk=; b=XMT0SfaD6su8/VZ5fXeGSttv+mjBeGiKpKu448jSlwsTZoR+xc5HDzkBfNmQUZzkobn/p3 tq0F7c6HU2fWF3b+ssYWpRa0bLHoZAufKZwYjS2LPu7ifEIhSo75sonWzAgbhd+55FZzX3 j/cYHk8eW1dJSytqrYGzp3mKxLyJTcM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-ta6FO6xiNtiW3tv44e0HEA-1; Wed, 27 Jan 2021 03:03:31 -0500 X-MC-Unique: ta6FO6xiNtiW3tv44e0HEA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A6A4B180A094; Wed, 27 Jan 2021 08:03:30 +0000 (UTC) Received: from dwysocha.rdu.csb (ovpn-112-111.rdu2.redhat.com [10.10.112.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 375391F0; Wed, 27 Jan 2021 08:03:30 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 4/8] NFS: Call readpage_async_filler() from nfs_readpage_async() Date: Wed, 27 Jan 2021 03:03:13 -0500 Message-Id: <1611734597-14754-5-git-send-email-dwysocha@redhat.com> In-Reply-To: <1611734597-14754-2-git-send-email-dwysocha@redhat.com> References: <1611734597-14754-2-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Refactor slightly so nfs_readpage_async() calls into readpage_async_filler(). Signed-off-by: Dave Wysochanski --- fs/nfs/read.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 8c05e56dab65..0ed79e6bc486 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -119,31 +119,22 @@ struct nfs_readdesc { struct nfs_open_context *ctx; }; +static int readpage_async_filler(void *data, struct page *page); + int nfs_readpage_async(void *data, struct inode *inode, struct page *page) { struct nfs_readdesc *desc = data; - struct nfs_page *new; - unsigned int len; struct nfs_pgio_mirror *pgm; - - len = nfs_page_length(page); - if (len == 0) - return nfs_return_empty_page(page); - new = nfs_create_request(desc->ctx, page, 0, len); - if (IS_ERR(new)) { - unlock_page(page); - return PTR_ERR(new); - } - if (len < PAGE_SIZE) - zero_user_segment(page, len, PAGE_SIZE); + int error; nfs_pageio_init_read(&desc->pgio, inode, false, &nfs_async_read_completion_ops); - if (!nfs_pageio_add_request(&desc->pgio, new)) { - nfs_list_remove_request(new); - nfs_readpage_release(new, desc->pgio.pg_error); - } + + error = readpage_async_filler(desc, page); + if (error) + goto out; + nfs_pageio_complete(&desc->pgio); /* It doesn't make sense to do mirrored reads! */ @@ -153,6 +144,9 @@ int nfs_readpage_async(void *data, struct inode *inode, NFS_I(inode)->read_io += pgm->pg_bytes_written; return desc->pgio.pg_error < 0 ? desc->pgio.pg_error : 0; + +out: + return error; } static void nfs_page_group_set_uptodate(struct nfs_page *req) -- 1.8.3.1