]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
NFSv4.1 convert layoutcommit sync to boolean
authorAndy Adamson <andros@netapp.com>
Sat, 12 Mar 2011 07:58:10 +0000 (02:58 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 24 Mar 2011 19:49:48 +0000 (15:49 -0400)
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/file.c
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h
fs/nfs/write.c

index 85cb95de5df5a0623350abaee80d305cfcd426a1..3ac5bd695e5e9554ceb2c5ceda9411dbe13d7c7b 100644 (file)
@@ -328,7 +328,7 @@ nfs_file_fsync(struct file *file, int datasync)
                ret = status;
        if (!ret && !datasync)
                /* application has asked for meta-data sync */
-               ret = pnfs_layoutcommit_inode(inode, 1);
+               ret = pnfs_layoutcommit_inode(inode, true);
        return ret;
 }
 
index 1e612d159b714c89d7280c1673ad9bbd2027b429..4414fd7e7d5e52fe417cd4f6cf57f23aa93ee0eb 100644 (file)
@@ -263,7 +263,7 @@ extern int nfs4_init_session(struct nfs_server *server);
 extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
                struct nfs_fsinfo *fsinfo);
 extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
-                                 int sync);
+                                 bool sync);
 
 static inline bool
 is_ds_only_client(struct nfs_client *clp)
index 6f2f40239d10aa63b731ffd32c7118c112036366..43045fa447100a33944f90c42f4f28e435c17c3f 100644 (file)
@@ -5671,7 +5671,7 @@ static const struct rpc_call_ops nfs4_layoutcommit_ops = {
 };
 
 int
-nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int sync)
+nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, bool sync)
 {
        struct rpc_message msg = {
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTCOMMIT],
@@ -5699,7 +5699,7 @@ nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int sync)
        task = rpc_run_task(&task_setup_data);
        if (IS_ERR(task))
                return PTR_ERR(task);
-       if (!sync)
+       if (sync == false)
                goto out;
        status = nfs4_wait_for_completion_rpc_task(task);
        if (status != 0)
index ac711257479028a2d5193a58c78e38838601c9ad..22c2ddbef420289c3ea2a60fb8cf45c1ee015573 100644 (file)
@@ -991,7 +991,7 @@ EXPORT_SYMBOL_GPL(pnfs_set_layoutcommit);
  * if WRITEs to a data server return NFS_DATA_SYNC.
  */
 int
-pnfs_layoutcommit_inode(struct inode *inode, int sync)
+pnfs_layoutcommit_inode(struct inode *inode, bool sync)
 {
        struct nfs4_layoutcommit_data *data;
        struct nfs_inode *nfsi = NFS_I(inode);
index 0806c77862b63e6836703b01c14cdb6d8cf41627..33b9ae90c6f731cd073736032691cf77271e5b1c 100644 (file)
@@ -155,7 +155,7 @@ void pnfs_roc_release(struct inode *ino);
 void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
 bool pnfs_roc_drain(struct inode *ino, u32 *barrier);
 void pnfs_set_layoutcommit(struct nfs_write_data *wdata);
-int pnfs_layoutcommit_inode(struct inode *inode, int sync);
+int pnfs_layoutcommit_inode(struct inode *inode, bool sync);
 
 static inline int lo_fail_bit(u32 iomode)
 {
@@ -328,7 +328,7 @@ static inline void pnfs_clear_request_commit(struct nfs_page *req)
 {
 }
 
-static inline int pnfs_layoutcommit_inode(struct inode *inode, int sync)
+static inline int pnfs_layoutcommit_inode(struct inode *inode, bool sync)
 {
        return 0;
 }
index a03c11f9081edf6b5e38ad6fbdeebd715a8bebc4..85d75254328ebd1c822187e51a3f5b5e9fc320b7 100644 (file)
@@ -1566,10 +1566,12 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 
        ret = nfs_commit_unstable_pages(inode, wbc);
        if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) {
-               int status, sync = wbc->sync_mode;
+               int status;
+               bool sync = true;
 
-               if (wbc->nonblocking || wbc->for_background)
-                               sync = 0;
+               if (wbc->sync_mode == WB_SYNC_NONE || wbc->nonblocking ||
+                   wbc->for_background)
+                       sync = false;
 
                status = pnfs_layoutcommit_inode(inode, sync);
                if (status < 0)