aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-03-12 02:58:10 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-24 15:49:48 -0400
commitef31153786bc1e4304e6b9422cc8b9efef455611 (patch)
tree32739af2c6b0f2ab0fdf05e84b674d94721ffa6d
parentde4b15c7e9fe9fdd1eb6333be0a08c822db1ca0e (diff)
NFSv4.1 convert layoutcommit sync to boolean
Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--fs/nfs/pnfs.c2
-rw-r--r--fs/nfs/pnfs.h4
-rw-r--r--fs/nfs/write.c8
6 files changed, 12 insertions, 10 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 85cb95de5df5..3ac5bd695e5e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -328,7 +328,7 @@ nfs_file_fsync(struct file *file, int datasync)
328 ret = status; 328 ret = status;
329 if (!ret && !datasync) 329 if (!ret && !datasync)
330 /* application has asked for meta-data sync */ 330 /* application has asked for meta-data sync */
331 ret = pnfs_layoutcommit_inode(inode, 1); 331 ret = pnfs_layoutcommit_inode(inode, true);
332 return ret; 332 return ret;
333} 333}
334 334
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 1e612d159b71..4414fd7e7d5e 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -263,7 +263,7 @@ extern int nfs4_init_session(struct nfs_server *server);
263extern int nfs4_proc_get_lease_time(struct nfs_client *clp, 263extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
264 struct nfs_fsinfo *fsinfo); 264 struct nfs_fsinfo *fsinfo);
265extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, 265extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
266 int sync); 266 bool sync);
267 267
268static inline bool 268static inline bool
269is_ds_only_client(struct nfs_client *clp) 269is_ds_only_client(struct nfs_client *clp)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6f2f40239d10..43045fa44710 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5671,7 +5671,7 @@ static const struct rpc_call_ops nfs4_layoutcommit_ops = {
5671}; 5671};
5672 5672
5673int 5673int
5674nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int sync) 5674nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, bool sync)
5675{ 5675{
5676 struct rpc_message msg = { 5676 struct rpc_message msg = {
5677 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTCOMMIT], 5677 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTCOMMIT],
@@ -5699,7 +5699,7 @@ nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int sync)
5699 task = rpc_run_task(&task_setup_data); 5699 task = rpc_run_task(&task_setup_data);
5700 if (IS_ERR(task)) 5700 if (IS_ERR(task))
5701 return PTR_ERR(task); 5701 return PTR_ERR(task);
5702 if (!sync) 5702 if (sync == false)
5703 goto out; 5703 goto out;
5704 status = nfs4_wait_for_completion_rpc_task(task); 5704 status = nfs4_wait_for_completion_rpc_task(task);
5705 if (status != 0) 5705 if (status != 0)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index ac7112574790..22c2ddbef420 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -991,7 +991,7 @@ EXPORT_SYMBOL_GPL(pnfs_set_layoutcommit);
991 * if WRITEs to a data server return NFS_DATA_SYNC. 991 * if WRITEs to a data server return NFS_DATA_SYNC.
992 */ 992 */
993int 993int
994pnfs_layoutcommit_inode(struct inode *inode, int sync) 994pnfs_layoutcommit_inode(struct inode *inode, bool sync)
995{ 995{
996 struct nfs4_layoutcommit_data *data; 996 struct nfs4_layoutcommit_data *data;
997 struct nfs_inode *nfsi = NFS_I(inode); 997 struct nfs_inode *nfsi = NFS_I(inode);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 0806c77862b6..33b9ae90c6f7 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -155,7 +155,7 @@ void pnfs_roc_release(struct inode *ino);
155void pnfs_roc_set_barrier(struct inode *ino, u32 barrier); 155void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
156bool pnfs_roc_drain(struct inode *ino, u32 *barrier); 156bool pnfs_roc_drain(struct inode *ino, u32 *barrier);
157void pnfs_set_layoutcommit(struct nfs_write_data *wdata); 157void pnfs_set_layoutcommit(struct nfs_write_data *wdata);
158int pnfs_layoutcommit_inode(struct inode *inode, int sync); 158int pnfs_layoutcommit_inode(struct inode *inode, bool sync);
159 159
160static inline int lo_fail_bit(u32 iomode) 160static inline int lo_fail_bit(u32 iomode)
161{ 161{
@@ -328,7 +328,7 @@ static inline void pnfs_clear_request_commit(struct nfs_page *req)
328{ 328{
329} 329}
330 330
331static inline int pnfs_layoutcommit_inode(struct inode *inode, int sync) 331static inline int pnfs_layoutcommit_inode(struct inode *inode, bool sync)
332{ 332{
333 return 0; 333 return 0;
334} 334}
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index a03c11f9081e..85d75254328e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1566,10 +1566,12 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
1566 1566
1567 ret = nfs_commit_unstable_pages(inode, wbc); 1567 ret = nfs_commit_unstable_pages(inode, wbc);
1568 if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) { 1568 if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) {
1569 int status, sync = wbc->sync_mode; 1569 int status;
1570 bool sync = true;
1570 1571
1571 if (wbc->nonblocking || wbc->for_background) 1572 if (wbc->sync_mode == WB_SYNC_NONE || wbc->nonblocking ||
1572 sync = 0; 1573 wbc->for_background)
1574 sync = false;
1573 1575
1574 status = pnfs_layoutcommit_inode(inode, sync); 1576 status = pnfs_layoutcommit_inode(inode, sync);
1575 if (status < 0) 1577 if (status < 0)