Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp380877rwe; Wed, 24 Aug 2022 02:37:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uzFBCyUbbN1rxdSn07iGR6gqn/96z0V7MQv0VDqF9g7dzpI70DnWA/is2QMHN8QkN1sHI X-Received: by 2002:a17:906:5387:b0:73d:af6c:6830 with SMTP id g7-20020a170906538700b0073daf6c6830mr2405292ejo.400.1661333838379; Wed, 24 Aug 2022 02:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661333838; cv=none; d=google.com; s=arc-20160816; b=gvAQAIAMmFJcs5jbQekVlCNAqbtuPD1jB1P81ax8PLop14DEk6YdbQsnwqBG1/xZXH TmeJbO1bW2bYj/Xc/rJrZ/00IE0wpJfa9Wwcq74M7zM8fyy/mt1I4JAWnku9/ZeiRrHt 82kecqak3/7+NHlrUf6OSaWv3uTjN6D/PzaLLVGKUUOzYVht8ELWwCMBLjK+dvwkCuM0 m5PFwGTyPOFGCZbcmsfeyGmnbL5WAVA6FRn278CWEkvRf3Zh3QuJp7POl88n9TqsMMHj M1f2lOsG35DGmvbsm3r9Z3ToXp1P4FRBdAoJyM/mvDynZQraVYXTkE4zFoY3WUtnYm49 OCgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IQ9LpZzin/PjO2lZO197syt+5oE3ywkKnUdwXnxmbGY=; b=kGa04pSld688fmtIPVV+SfRsJdUkaFZhL1G+k48SRSF+xnQMXHRLhRnv19naX7eT5+ jdpZuDKXquIvbI7Fanm4NPrLirY4IVsozQUmPS6hNYdlIaPQaXWx+S2kSrSElarq9lC/ Ij39WTyT+kHrg+XX6iucDrHtJDojqVm99kHKdd9D5c9T/Ezo497l126BngrQY3I9n0uc KqKwzVr/dJSq1vl6cGIvF4cL5dm7IQT/2QO7pn9/TRG2WzI5J6gZflCrX+8aVfGvQQOZ b8/lxoCtoTgZ3CnUThFjQop0BnOi5BKJJeZ76dmfukAAkTulybeRrhRQ0mYfqry7Vvjo Rd6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OR1iGlf7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs32-20020a1709072d2000b00730a3b5af1fsi2197806ejc.338.2022.08.24.02.36.52; Wed, 24 Aug 2022 02:37:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OR1iGlf7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235807AbiHXJfI (ORCPT + 99 others); Wed, 24 Aug 2022 05:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235184AbiHXJfH (ORCPT ); Wed, 24 Aug 2022 05:35:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5ADCD for ; Wed, 24 Aug 2022 02:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661333705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IQ9LpZzin/PjO2lZO197syt+5oE3ywkKnUdwXnxmbGY=; b=OR1iGlf7be/efsUA1lPrYY/edEB0YTNQuMiq4+yZB9tDczAkVWv30CLoVWWOM8sUm/yHsr cjPyzusFj4On1512rTHRY5z4QJ5d9K+ni6t4NW4+s7Y1ZIHLzoIBMMdPUBuvJHiMA6z4Et H7WENw57LRwiIk9IJkzeiCinvvnrbuo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-80-m2CfxYY5ObiAIkxDpqAAJw-1; Wed, 24 Aug 2022 05:35:04 -0400 X-MC-Unique: m2CfxYY5ObiAIkxDpqAAJw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA6A980231E; Wed, 24 Aug 2022 09:35:03 +0000 (UTC) Received: from dwysocha.rdu.csb (unknown [10.22.8.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAF0714152E0; Wed, 24 Aug 2022 09:35:03 +0000 (UTC) From: Dave Wysochanski To: Anna Schumaker , Trond Myklebust , David Howells Cc: linux-nfs@vger.kernel.org, linux-cachefs@redhat.com, Benjamin Maynard , Daire Byrne Subject: [RFC PATCH 1/3] NFS: Rename readpage_async_filler to nfs_pageio_add_page Date: Wed, 24 Aug 2022 05:34:59 -0400 Message-Id: <20220824093501.384755-2-dwysocha@redhat.com> In-Reply-To: <20220824093501.384755-1-dwysocha@redhat.com> References: <20220824093501.384755-1-dwysocha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Rename readpage_async_filler to nfs_pageio_add_page to better reflect what this function does (add a page to the nfs_pageio_descriptor), and simplify arguments to this function by removing struct nfs_readdesc. Signed-off-by: Dave Wysochanski --- fs/nfs/read.c | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 8ae2c8d1219d..525e82ea9a9e 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -127,11 +127,6 @@ static void nfs_readpage_release(struct nfs_page *req, int error) nfs_release_request(req); } -struct nfs_readdesc { - struct nfs_pageio_descriptor pgio; - struct nfs_open_context *ctx; -}; - static void nfs_page_group_set_uptodate(struct nfs_page *req) { if (nfs_page_group_sync_on_bit(req, PG_UPTODATE)) @@ -153,7 +148,8 @@ static void nfs_read_completion(struct nfs_pgio_header *hdr) if (test_bit(NFS_IOHDR_EOF, &hdr->flags)) { /* note: regions of the page not covered by a - * request are zeroed in readpage_async_filler */ + * request are zeroed in nfs_pageio_add_page + */ if (bytes > hdr->good_bytes) { /* nothing in this request was good, so zero * the full extent of the request */ @@ -281,8 +277,10 @@ static void nfs_readpage_result(struct rpc_task *task, nfs_readpage_retry(task, hdr); } -static int -readpage_async_filler(struct nfs_readdesc *desc, struct page *page) +int +nfs_pageio_add_page(struct nfs_pageio_descriptor *pgio, + struct nfs_open_context *ctx, + struct page *page) { struct inode *inode = page_file_mapping(page)->host; unsigned int rsize = NFS_SERVER(inode)->rsize; @@ -302,15 +300,15 @@ readpage_async_filler(struct nfs_readdesc *desc, struct page *page) goto out_unlock; } - new = nfs_create_request(desc->ctx, page, 0, aligned_len); + new = nfs_create_request(ctx, page, 0, aligned_len); if (IS_ERR(new)) goto out_error; if (len < PAGE_SIZE) zero_user_segment(page, len, PAGE_SIZE); - if (!nfs_pageio_add_request(&desc->pgio, new)) { + if (!nfs_pageio_add_request(pgio, new)) { nfs_list_remove_request(new); - error = desc->pgio.pg_error; + error = pgio->pg_error; nfs_readpage_release(new, error); goto out; } @@ -332,7 +330,8 @@ readpage_async_filler(struct nfs_readdesc *desc, struct page *page) int nfs_read_folio(struct file *file, struct folio *folio) { struct page *page = &folio->page; - struct nfs_readdesc desc; + struct nfs_pageio_descriptor pgio; + struct nfs_open_context *ctx; struct inode *inode = page_file_mapping(page)->host; int ret; @@ -358,29 +357,29 @@ int nfs_read_folio(struct file *file, struct folio *folio) if (file == NULL) { ret = -EBADF; - desc.ctx = nfs_find_open_context(inode, NULL, FMODE_READ); - if (desc.ctx == NULL) + ctx = nfs_find_open_context(inode, NULL, FMODE_READ); + if (ctx == NULL) goto out_unlock; } else - desc.ctx = get_nfs_open_context(nfs_file_open_context(file)); + ctx = get_nfs_open_context(nfs_file_open_context(file)); - xchg(&desc.ctx->error, 0); - nfs_pageio_init_read(&desc.pgio, inode, false, + xchg(&ctx->error, 0); + nfs_pageio_init_read(&pgio, inode, false, &nfs_async_read_completion_ops); - ret = readpage_async_filler(&desc, page); + ret = nfs_pageio_add_page(&pgio, ctx, page); if (ret) goto out; - nfs_pageio_complete_read(&desc.pgio); - ret = desc.pgio.pg_error < 0 ? desc.pgio.pg_error : 0; + nfs_pageio_complete_read(&pgio); + ret = pgio.pg_error < 0 ? pgio.pg_error : 0; if (!ret) { ret = wait_on_page_locked_killable(page); if (!PageUptodate(page) && !ret) - ret = xchg(&desc.ctx->error, 0); + ret = xchg(&ctx->error, 0); } out: - put_nfs_open_context(desc.ctx); + put_nfs_open_context(ctx); trace_nfs_aop_readpage_done(inode, page, ret); return ret; out_unlock: @@ -391,9 +390,10 @@ int nfs_read_folio(struct file *file, struct folio *folio) void nfs_readahead(struct readahead_control *ractl) { + struct nfs_pageio_descriptor pgio; + struct nfs_open_context *ctx; unsigned int nr_pages = readahead_count(ractl); struct file *file = ractl->file; - struct nfs_readdesc desc; struct inode *inode = ractl->mapping->host; struct page *page; int ret; @@ -407,25 +407,25 @@ void nfs_readahead(struct readahead_control *ractl) if (file == NULL) { ret = -EBADF; - desc.ctx = nfs_find_open_context(inode, NULL, FMODE_READ); - if (desc.ctx == NULL) + ctx = nfs_find_open_context(inode, NULL, FMODE_READ); + if (ctx == NULL) goto out; } else - desc.ctx = get_nfs_open_context(nfs_file_open_context(file)); + ctx = get_nfs_open_context(nfs_file_open_context(file)); - nfs_pageio_init_read(&desc.pgio, inode, false, + nfs_pageio_init_read(&pgio, inode, false, &nfs_async_read_completion_ops); while ((page = readahead_page(ractl)) != NULL) { - ret = readpage_async_filler(&desc, page); + ret = nfs_pageio_add_page(&pgio, ctx, page); put_page(page); if (ret) break; } - nfs_pageio_complete_read(&desc.pgio); + nfs_pageio_complete_read(&pgio); - put_nfs_open_context(desc.ctx); + put_nfs_open_context(ctx); out: trace_nfs_aop_readahead_done(inode, nr_pages, ret); } -- 2.31.1