aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-10-09 16:18:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:35 -0500
commit1c75950b9a2254ef08f986e00ad20266ae9ba7f1 (patch)
treecc1a242601b27b8128c8c385f1b858a7b863f155 /include/linux/nfs_fs.h
parent3f442547b76bf9fb70d7aecc41cf1980459253c9 (diff)
NFS: cleanup of nfs_sync_inode_wait()
Allow callers to directly pass it a struct writeback_control. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r--include/linux/nfs_fs.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index f8190ae9e3fb..f2ec9be1e22f 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -432,7 +432,10 @@ extern void nfs_writedata_release(void *);
432 * Try to write back everything synchronously (but check the 432 * Try to write back everything synchronously (but check the
433 * return value!) 433 * return value!)
434 */ 434 */
435extern long nfs_sync_inode_wait(struct inode *, unsigned long, unsigned int, int); 435extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
436extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
437extern int nfs_wb_all(struct inode *inode);
438extern int nfs_wb_page(struct inode *inode, struct page* page);
436#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 439#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
437extern int nfs_commit_inode(struct inode *, int); 440extern int nfs_commit_inode(struct inode *, int);
438extern struct nfs_write_data *nfs_commit_alloc(void); 441extern struct nfs_write_data *nfs_commit_alloc(void);
@@ -452,28 +455,6 @@ nfs_have_writebacks(struct inode *inode)
452 return NFS_I(inode)->npages != 0; 455 return NFS_I(inode)->npages != 0;
453} 456}
454 457
455static inline int
456nfs_wb_all(struct inode *inode)
457{
458 int error = nfs_sync_inode_wait(inode, 0, 0, 0);
459 return (error < 0) ? error : 0;
460}
461
462/*
463 * Write back all requests on one page - we do this before reading it.
464 */
465static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how)
466{
467 int error = nfs_sync_inode_wait(inode, page->index, 1,
468 how | FLUSH_STABLE);
469 return (error < 0) ? error : 0;
470}
471
472static inline int nfs_wb_page(struct inode *inode, struct page* page)
473{
474 return nfs_wb_page_priority(inode, page, 0);
475}
476
477/* 458/*
478 * Allocate nfs_write_data structures 459 * Allocate nfs_write_data structures
479 */ 460 */