From: Dave Wysochanski <dwysocha@redhat.com>
To: Trond Myklebust <trondmy@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com, linux-nfs@vger.kernel.org
Subject: [PATCH v2 4/7] NFS: Rename fscache read and write pages functions
Date: Thu, 7 Oct 2021 18:30:20 -0400 [thread overview]
Message-ID: <1633645823-31235-5-git-send-email-dwysocha@redhat.com> (raw)
In-Reply-To: <1633645823-31235-1-git-send-email-dwysocha@redhat.com>
Rename NFS fscache functions to read from and write to the cache
to better reflect the new fscache fallback API naming.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
fs/nfs/fscache.c | 4 ++--
fs/nfs/fscache.h | 17 ++++++++---------
fs/nfs/read.c | 4 ++--
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 5f9be4a1b5f8..50d68cb946c8 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -331,7 +331,7 @@ void nfs_fscache_open_file(struct inode *inode, struct file *filp)
/*
* 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;
@@ -364,7 +364,7 @@ int __nfs_readpage_from_fscache(struct inode *inode, struct page *page)
/*
* Store a newly fetched page in fscache
*/
-void __nfs_readpage_to_fscache(struct inode *inode, struct page *page)
+void __nfs_fscache_write_page(struct inode *inode, struct page *page)
{
int ret;
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h
index f4deea2908e9..a2c669ce8217 100644
--- a/fs/nfs/fscache.h
+++ b/fs/nfs/fscache.h
@@ -94,19 +94,18 @@ struct nfs_fscache_inode_auxdata {
extern void nfs_fscache_clear_inode(struct inode *);
extern void nfs_fscache_open_file(struct inode *, struct file *);
-extern int __nfs_readpage_from_fscache(struct inode *, struct page *);
+extern int __nfs_fscache_read_page(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 void __nfs_fscache_write_page(struct inode *, struct page *);
/*
* 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_fscache(inode))
- return __nfs_readpage_from_fscache(inode, page);
+ return __nfs_fscache_read_page(inode, page);
return -ENOBUFS;
}
@@ -114,11 +113,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_fscache(inode))
- __nfs_readpage_to_fscache(inode, page);
+ __nfs_fscache_write_page(inode, page);
}
/*
@@ -161,12 +160,12 @@ static inline void nfs_fscache_clear_inode(struct inode *inode) {}
static inline void nfs_fscache_open_file(struct inode *inode,
struct file *filp) {}
-static inline int nfs_readpage_from_fscache(struct inode *inode,
+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,
+static inline void nfs_fscache_write_page(struct inode *inode,
struct page *page) {}
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 06ed827a67e8..c65663f217a4 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 @@ static void nfs_readpage_result(struct rpc_task *task,
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;
}
--
1.8.3.1
next prev parent reply other threads:[~2021-10-07 22:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 22:30 [PATCH v2 0/7] Various NFS fscache cleanups Dave Wysochanski
2021-10-07 22:30 ` [PATCH v2 1/7] NFS: Use nfs_i_fscache() consistently within NFS fscache code Dave Wysochanski
2021-10-07 22:30 ` [PATCH v2 2/7] NFS: Cleanup usage of nfs_inode in fscache interface and handle i_size properly Dave Wysochanski
2021-10-07 22:30 ` [PATCH v2 3/7] NFS: Convert NFS fscache enable/disable dfprintks to tracepoints Dave Wysochanski
2021-10-07 22:30 ` Dave Wysochanski [this message]
2021-10-07 22:30 ` [PATCH v2 5/7] NFS: Replace dfprintks with tracepoints in read and write page functions Dave Wysochanski
2021-10-07 22:30 ` [PATCH v2 6/7] NFS: Remove remaining dfprintks related to fscache cookies Dave Wysochanski
2021-10-07 22:30 ` [PATCH v2 7/7] NFS: Remove remaining usages of NFSDBG_FSCACHE Dave Wysochanski
2021-10-13 15:41 ` [PATCH v2 0/7] Various NFS fscache cleanups David Wysochanski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1633645823-31235-5-git-send-email-dwysocha@redhat.com \
--to=dwysocha@redhat.com \
--cc=anna.schumaker@netapp.com \
--cc=dhowells@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox