Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp4155592pxm; Tue, 1 Mar 2022 12:28:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHGeSrHHj0YbcbQxKWS84GJMaR8p0Hibou3WrVmboWVVTP5vb6pyDpploNIyC4UUG3718a X-Received: by 2002:a17:906:2991:b0:6cf:6b24:e92f with SMTP id x17-20020a170906299100b006cf6b24e92fmr19978066eje.748.1646166487535; Tue, 01 Mar 2022 12:28:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646166487; cv=none; d=google.com; s=arc-20160816; b=GYa4XiBG4zijLmhPEn/MFjDWV8oLzXlQvDWiaHx3dXxTW6ysu8zaHweZ2jbZWDXXN/ u6h2vDarT88/HPNmiTBeMij2ieYmdgtkizrcf8eIkD8ZZ2GfaNLKSMTIo64+2HKDgTpv h4QcXuhrV3Zvjf3ydBHYaBWYIjyS/UfXsGTpHsdFIx6VaqN3ZiQYUqMEFthv1lQwx6AX 1IWKAA7AH6d1YnMV5odrkBQ2WTZYczzl7DcHNM8mLEE4X+3CXHwyBMw6u5gx7uNsBCB1 v2y+9M8WOAGT1lFf0wC7kBmuKcghmQy/hIbMjpSjXck3krA0S2414fGxUaDDHIYueywm 3eig== 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=L9lB9EWWYFT1wEN+KAIdnZdcfS9M43ml3k+kfsW2gq8=; b=tZeOIqeDO6kHJi5jK3w0DRPhb+aiE8J4GC3GHVEqxD5MCSoTaON31GMkOM1icYHfKb oJNo2rp2ciRxeTkoXz2/k2xDoE51DZ0et9m6SO0HUNftVWe3lSmqf5OXeY5QRrdUA4te gKmjL43Jp5rvFqmPq+SGdz2LQWvMxwkfYtlg3KX17YrQ4IuDTmDZqoNok+hOjGV9Y+Jd 6SgmTICS6X1vQF1ZtuGmOlTnOQDzHTxJBbeDebNqT7k7E9iihJOWdju21P/VlUYJ3LR7 XODsPrT1y+M38ip61vouoG2XZo1QMnljMZ1NnbHNQsnlAY3e0YecAd3J2Nq2N+Il2SIn i45Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C47Pl978; 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 w11-20020a056402268b00b004136c2ec2aesi10919552edd.363.2022.03.01.12.27.43; Tue, 01 Mar 2022 12:28:07 -0800 (PST) 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=C47Pl978; 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 S236369AbiCATjT (ORCPT + 99 others); Tue, 1 Mar 2022 14:39:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237000AbiCATjT (ORCPT ); Tue, 1 Mar 2022 14:39:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5E5965788 for ; Tue, 1 Mar 2022 11:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646163517; 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=L9lB9EWWYFT1wEN+KAIdnZdcfS9M43ml3k+kfsW2gq8=; b=C47Pl978d0iEmz/Ert45qyGwlA4McF8SwwGlZr2Oa4oM+0DgbOBuaQLTkh/ViICpbgtBZ5 rWgp94TDM2KnWmuZ+YolnZXhIxNRLssU6RKdPu5FJv8Bq5zYz6EpYwawvHhMYFFDF8mMKC NQ9R9lht4KQ7XPDSst8C8UD/F8fkFJ8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-IEWoewYzPFer3aoA6vrlPw-1; Tue, 01 Mar 2022 14:38:34 -0500 X-MC-Unique: IEWoewYzPFer3aoA6vrlPw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D94EF1006AA5; Tue, 1 Mar 2022 19:38:32 +0000 (UTC) Received: from dwysocha.rdu.csb (unknown [10.22.9.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D446F5DF37; Tue, 1 Mar 2022 19:38:31 +0000 (UTC) From: Dave Wysochanski To: Anna Schumaker , Trond Myklebust Cc: linux-nfs@vger.kernel.org, linux-cachefs@redhat.com, David Howells Subject: [PATCH 2/4] NFS: Rename fscache read and write pages functions Date: Tue, 1 Mar 2022 14:37:25 -0500 Message-Id: <20220301193727.18847-3-dwysocha@redhat.com> In-Reply-To: <20220301193727.18847-1-dwysocha@redhat.com> References: <20220301193727.18847-1-dwysocha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 NFS fscache functions in a more consistent fashion to better reflect when we read from and write to fscache. Signed-off-by: Dave Wysochanski --- fs/nfs/fscache.c | 6 +++--- fs/nfs/fscache.h | 27 ++++++++++----------------- fs/nfs/read.c | 4 ++-- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index 81bd2770e640..62fbce28fe85 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c @@ -317,7 +317,7 @@ static int fscache_fallback_write_page(struct inode *inode, struct page *page, /* * Retrieve a page from fscache */ -int __nfs_readpage_from_fscache(struct inode *inode, struct page *page) +int __nfs_fscache_read_page(struct inode *inode, struct page *page) { int ret; @@ -351,7 +351,7 @@ int __nfs_readpage_from_fscache(struct inode *inode, struct page *page) * Store a newly fetched page in fscache. We can be certain there's no page * stored in the cache as yet otherwise we would've read it from there. */ -void __nfs_readpage_to_fscache(struct inode *inode, struct page *page) +void __nfs_fscache_write_page(struct inode *inode, struct page *page) { int ret; @@ -362,7 +362,7 @@ void __nfs_readpage_to_fscache(struct inode *inode, struct page *page) ret = fscache_fallback_write_page(inode, page, true); dfprintk(FSCACHE, - "NFS: readpage_to_fscache: p:%p(i:%lu f:%lx) ret %d\n", + "NFS: nfs_fscache_write_page: p:%p(i:%lu f:%lx) ret %d\n", page, page->index, page->flags, ret); if (ret != 0) { diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index 4c7afaabbf9f..4e980cc04779 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -45,10 +45,8 @@ extern void nfs_fscache_clear_inode(struct inode *); extern void nfs_fscache_open_file(struct inode *, struct file *); extern void nfs_fscache_release_file(struct inode *, struct file *); -extern int __nfs_readpage_from_fscache(struct inode *, struct page *); -extern void __nfs_read_completion_to_fscache(struct nfs_pgio_header *hdr, - unsigned long bytes); -extern void __nfs_readpage_to_fscache(struct inode *, struct page *); +extern int __nfs_fscache_read_page(struct inode *, struct page *); +extern void __nfs_fscache_write_page(struct inode *, struct page *); static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) { @@ -66,11 +64,10 @@ static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) /* * Retrieve a page from an inode data storage object. */ -static inline int nfs_readpage_from_fscache(struct inode *inode, - struct page *page) +static inline int nfs_fscache_read_page(struct inode *inode, struct page *page) { - if (NFS_I(inode)->fscache) - return __nfs_readpage_from_fscache(inode, page); + if (nfs_i_fscache(inode)) + return __nfs_fscache_read_page(inode, page); return -ENOBUFS; } @@ -78,11 +75,11 @@ static inline int nfs_readpage_from_fscache(struct inode *inode, * Store a page newly fetched from the server in an inode data storage object * in the cache. */ -static inline void nfs_readpage_to_fscache(struct inode *inode, +static inline void nfs_fscache_write_page(struct inode *inode, struct page *page) { - if (NFS_I(inode)->fscache) - __nfs_readpage_to_fscache(inode, page); + if (nfs_i_fscache(inode)) + __nfs_fscache_write_page(inode, page); } static inline void nfs_fscache_update_auxdata(struct nfs_fscache_inode_auxdata *auxdata, @@ -136,15 +133,11 @@ static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) { return 1; /* True: may release page */ } -static inline int nfs_readpage_from_fscache(struct inode *inode, - struct page *page) +static inline int nfs_fscache_read_page(struct inode *inode, struct page *page) { return -ENOBUFS; } -static inline void nfs_readpage_to_fscache(struct inode *inode, - struct page *page) {} - - +static inline void nfs_fscache_write_page(struct inode *inode, struct page *page) {} static inline void nfs_fscache_invalidate(struct inode *inode, int flags) {} static inline const char *nfs_server_fscache_state(struct nfs_server *server) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index eb00229c1a50..f84b6b73c45b 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -123,7 +123,7 @@ static void nfs_readpage_release(struct nfs_page *req, int error) struct address_space *mapping = page_file_mapping(page); if (PageUptodate(page)) - nfs_readpage_to_fscache(inode, page); + nfs_fscache_write_page(inode, page); else if (!PageError(page) && !PagePrivate(page)) generic_error_remove_page(mapping, page); unlock_page(page); @@ -306,7 +306,7 @@ readpage_async_filler(void *data, struct page *page) aligned_len = min_t(unsigned int, ALIGN(len, rsize), PAGE_SIZE); if (!IS_SYNC(page->mapping->host)) { - error = nfs_readpage_from_fscache(page->mapping->host, page); + error = nfs_fscache_read_page(page->mapping->host, page); if (error == 0) goto out_unlock; } -- 2.27.1