summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2004-03-13 11:36:38 -0500
committerTrond Myklebust <trond.myklebust@fys.uio.no>2004-03-13 11:36:38 -0500
commit680c0ee6fc5a7a9178f4a2d0df808a4a65fdccfa (patch)
treeb7739de16d08cf4aee092dd2705b45e4c2f39fce /include/linux
parenta1108921b71156eee7ac5b7c62438e2804ad97a2 (diff)
NFSv2/v3/v4: Ensure that fsync() flushes all writebacks to disk rather than just the
ones labelled as belonging to our file. This fixes a bug in which msync(MS_SYNC) will fail to flush the pages to disk.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h23
-rw-r--r--include/linux/nfs_page.h2
2 files changed, 7 insertions, 18 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 591b399c7af5..5e3dba36c02b 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -343,16 +343,15 @@ extern void nfs_commit_done(struct rpc_task *);
* Try to write back everything synchronously (but check the
* return value!)
*/
-extern int nfs_sync_file(struct inode *, struct file *, unsigned long, unsigned int, int);
-extern int nfs_flush_file(struct inode *, struct file *, unsigned long, unsigned int, int);
+extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int);
+extern int nfs_flush_inode(struct inode *, unsigned long, unsigned int, int);
extern int nfs_flush_list(struct list_head *, int, int);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
-extern int nfs_commit_file(struct inode *, struct file *, unsigned long, unsigned int, int);
+extern int nfs_commit_inode(struct inode *, unsigned long, unsigned int, int);
extern int nfs_commit_list(struct list_head *, int);
#else
static inline int
-nfs_commit_file(struct inode *inode, struct file *file, unsigned long offset,
- unsigned int len, int flags)
+nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how)
{
return 0;
}
@@ -367,7 +366,7 @@ nfs_have_writebacks(struct inode *inode)
static inline int
nfs_wb_all(struct inode *inode)
{
- int error = nfs_sync_file(inode, 0, 0, 0, FLUSH_WAIT);
+ int error = nfs_sync_inode(inode, 0, 0, FLUSH_WAIT);
return (error < 0) ? error : 0;
}
@@ -377,21 +376,11 @@ nfs_wb_all(struct inode *inode)
static inline int
nfs_wb_page(struct inode *inode, struct page* page)
{
- int error = nfs_sync_file(inode, 0, page->index, 1,
+ int error = nfs_sync_inode(inode, page->index, 1,
FLUSH_WAIT | FLUSH_STABLE);
return (error < 0) ? error : 0;
}
-/*
- * Write back all pending writes for one user..
- */
-static inline int
-nfs_wb_file(struct inode *inode, struct file *file)
-{
- int error = nfs_sync_file(inode, file, 0, 0, FLUSH_WAIT);
- return (error < 0) ? error : 0;
-}
-
/* Hack for future NFS swap support */
#ifndef IS_SWAPFILE
# define IS_SWAPFILE(inode) (0)
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index c41a4e75555e..c648312afc0c 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -53,7 +53,7 @@ extern void nfs_release_request(struct nfs_page *req);
extern void nfs_list_add_request(struct nfs_page *, struct list_head *);
extern int nfs_scan_list(struct list_head *, struct list_head *,
- struct file *, unsigned long, unsigned int);
+ unsigned long, unsigned int);
extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
unsigned int);
extern int nfs_wait_on_request(struct nfs_page *);