Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Rename fscache read and write pages functions

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 <dwysocha@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Dave Wysochanski and committed by
Trond Myklebust
fc1c5abf 45f3a70b

+15 -22
+3 -3
fs/nfs/fscache.c
··· 317 317 /* 318 318 * Retrieve a page from fscache 319 319 */ 320 - int __nfs_readpage_from_fscache(struct inode *inode, struct page *page) 320 + int __nfs_fscache_read_page(struct inode *inode, struct page *page) 321 321 { 322 322 int ret; 323 323 ··· 351 351 * Store a newly fetched page in fscache. We can be certain there's no page 352 352 * stored in the cache as yet otherwise we would've read it from there. 353 353 */ 354 - void __nfs_readpage_to_fscache(struct inode *inode, struct page *page) 354 + void __nfs_fscache_write_page(struct inode *inode, struct page *page) 355 355 { 356 356 int ret; 357 357 ··· 362 362 ret = fscache_fallback_write_page(inode, page, true); 363 363 364 364 dfprintk(FSCACHE, 365 - "NFS: readpage_to_fscache: p:%p(i:%lu f:%lx) ret %d\n", 365 + "NFS: nfs_fscache_write_page: p:%p(i:%lu f:%lx) ret %d\n", 366 366 page, page->index, page->flags, ret); 367 367 368 368 if (ret != 0) {
+10 -17
fs/nfs/fscache.h
··· 45 45 extern void nfs_fscache_open_file(struct inode *, struct file *); 46 46 extern void nfs_fscache_release_file(struct inode *, struct file *); 47 47 48 - extern int __nfs_readpage_from_fscache(struct inode *, struct page *); 49 - extern void __nfs_read_completion_to_fscache(struct nfs_pgio_header *hdr, 50 - unsigned long bytes); 51 - extern void __nfs_readpage_to_fscache(struct inode *, struct page *); 48 + extern int __nfs_fscache_read_page(struct inode *, struct page *); 49 + extern void __nfs_fscache_write_page(struct inode *, struct page *); 52 50 53 51 static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) 54 52 { ··· 64 66 /* 65 67 * Retrieve a page from an inode data storage object. 66 68 */ 67 - static inline int nfs_readpage_from_fscache(struct inode *inode, 68 - struct page *page) 69 + static inline int nfs_fscache_read_page(struct inode *inode, struct page *page) 69 70 { 70 - if (NFS_I(inode)->fscache) 71 - return __nfs_readpage_from_fscache(inode, page); 71 + if (nfs_i_fscache(inode)) 72 + return __nfs_fscache_read_page(inode, page); 72 73 return -ENOBUFS; 73 74 } 74 75 ··· 75 78 * Store a page newly fetched from the server in an inode data storage object 76 79 * in the cache. 77 80 */ 78 - static inline void nfs_readpage_to_fscache(struct inode *inode, 81 + static inline void nfs_fscache_write_page(struct inode *inode, 79 82 struct page *page) 80 83 { 81 - if (NFS_I(inode)->fscache) 82 - __nfs_readpage_to_fscache(inode, page); 84 + if (nfs_i_fscache(inode)) 85 + __nfs_fscache_write_page(inode, page); 83 86 } 84 87 85 88 static inline void nfs_fscache_update_auxdata(struct nfs_fscache_inode_auxdata *auxdata, ··· 133 136 { 134 137 return 1; /* True: may release page */ 135 138 } 136 - static inline int nfs_readpage_from_fscache(struct inode *inode, 137 - struct page *page) 139 + static inline int nfs_fscache_read_page(struct inode *inode, struct page *page) 138 140 { 139 141 return -ENOBUFS; 140 142 } 141 - static inline void nfs_readpage_to_fscache(struct inode *inode, 142 - struct page *page) {} 143 - 144 - 143 + static inline void nfs_fscache_write_page(struct inode *inode, struct page *page) {} 145 144 static inline void nfs_fscache_invalidate(struct inode *inode, int flags) {} 146 145 147 146 static inline const char *nfs_server_fscache_state(struct nfs_server *server)
+2 -2
fs/nfs/read.c
··· 123 123 struct address_space *mapping = page_file_mapping(page); 124 124 125 125 if (PageUptodate(page)) 126 - nfs_readpage_to_fscache(inode, page); 126 + nfs_fscache_write_page(inode, page); 127 127 else if (!PageError(page) && !PagePrivate(page)) 128 128 generic_error_remove_page(mapping, page); 129 129 unlock_page(page); ··· 305 305 aligned_len = min_t(unsigned int, ALIGN(len, rsize), PAGE_SIZE); 306 306 307 307 if (!IS_SYNC(page->mapping->host)) { 308 - error = nfs_readpage_from_fscache(page->mapping->host, page); 308 + error = nfs_fscache_read_page(page->mapping->host, page); 309 309 if (error == 0) 310 310 goto out_unlock; 311 311 }