Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1154933ybg; Wed, 29 Jul 2020 07:13:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcwoEEaEde2Og3AYYdQjPe2VOUcPlP0SR4g6FDaU6VzegdSSqJFNogruVs4xSMC5eIOnIz X-Received: by 2002:a05:6402:a4c:: with SMTP id bt12mr6792731edb.360.1596032008404; Wed, 29 Jul 2020 07:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596032008; cv=none; d=google.com; s=arc-20160816; b=zT2MazOQuXLkHvmDFbjQ7bxeQWa4ObIcpVZR2kKYz/qGY+kGalo/8eP6vSBeohA3QO uifOhb1GZ++G6bt5a7PevW/9inoC6t6axa+6aF6beFiRTFOZDY3h3uXYyN86QAO5C4sz 2S7LcG3+v4lu8X87iTSrsVlbMBbHwwLrLhXjmzIs5SNJyFEYwOZVSWe6uZiF/6aitWUs 0JdJX8BFDZVvVRIcjHBl252dqDN5oiHuS0uN/rdP3bzmLhneEy3gToxrhkH5Pc2I+xow 4Uj2EGK5Rffb2WV1ISVraJQx845Lrj2wRoirIHYUvI6eJXDwO36i66zwpWbQwo6McPPF mzNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+Om3M0BIxbSuF3ZOTs6rshwBCB7b8mi5Pxx0b5la7A4=; b=qjOuqMNmv49xCPMbAW8uplmk5S70jYZISOi+GjG0NOQITkcMsVRKCz15ed4LkIIWKa jwUDAqKJBCYPuGSS5a89HpI6mSTW93UqsCN24SIpvm47H3B4vtQFpBRVESzs3Yjyi4UA vt9VEL4tnL5zi5nSc2XN4Hb59OZk9khQYDQLhg0Ky8lO1DF3eezQ5L5omI0rAy4tHCBU 2Esd6wBasS9LemQlxw8TQUQYvfnEIYpoNqSqABwP+iVXDQamOCi5qNdTPbUw9keBtY9c Q6bx2jdjhN+j0iasc7tVwCwkZb4/KdiY6rWJk/hy+37/uzkKzRuvKn4pJDdLBxk5CP/T o68w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J2HdggRt; 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 u20si1340861edq.501.2020.07.29.07.12.57; Wed, 29 Jul 2020 07:13:28 -0700 (PDT) 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=J2HdggRt; 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 S1726606AbgG2OMt (ORCPT + 99 others); Wed, 29 Jul 2020 10:12:49 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43940 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726533AbgG2OMs (ORCPT ); Wed, 29 Jul 2020 10:12:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596031967; 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=+Om3M0BIxbSuF3ZOTs6rshwBCB7b8mi5Pxx0b5la7A4=; b=J2HdggRtEqdtRRm4lqkI+cOutZULeOL+N9o4MqmRLM85FkA3gPAxCx+JN7ZH5utaZLpDem C6j6+WlqH8GrQsEpFG77qUcq6UaGquZxJWXvYhx5ww7tGf/GWwYnZBODt6FzXOvGwlERK8 ygKv+xCS9kz65uVs6SQ22psxSVWhTSY= 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-192-ZvISsE_jPi6AkbykzJCLbg-1; Wed, 29 Jul 2020 10:12:46 -0400 X-MC-Unique: ZvISsE_jPi6AkbykzJCLbg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBA96106B242; Wed, 29 Jul 2020 14:12:43 +0000 (UTC) Received: from dwysocha.rdu.csb (ovpn-113-23.rdu2.redhat.com [10.10.113.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44AA771906; Wed, 29 Jul 2020 14:12:43 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-cachefs@redhat.com Subject: [RFC PATCH v2 04/14] NFS: Call readpage_async_filler() from nfs_readpage_async() Date: Wed, 29 Jul 2020 10:12:19 -0400 Message-Id: <1596031949-26793-5-git-send-email-dwysocha@redhat.com> In-Reply-To: <1596031949-26793-1-git-send-email-dwysocha@redhat.com> References: <1596031949-26793-1-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-nfs-owner@vger.kernel.org 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 5fda30742a32..1401f1c734c0 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 = (struct nfs_readdesc *)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