NFS: Clean up nfs_sync_mapping
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 20 Feb 2010 01:03:29 +0000 (17:03 -0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 5 Mar 2010 20:44:56 +0000 (15:44 -0500)
Remove the redundant call to filemap_write_and_wait().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/inode.c

index 443772df9b17532e4019a7a9bbe8d96aea5c8a00..e8b41170d2954725f8373fc7784e9fa7526b1316 100644 (file)
@@ -114,16 +114,12 @@ void nfs_clear_inode(struct inode *inode)
  */
 int nfs_sync_mapping(struct address_space *mapping)
 {
-       int ret;
+       int ret = 0;
 
-       if (mapping->nrpages == 0)
-               return 0;
-       unmap_mapping_range(mapping, 0, 0, 0);
-       ret = filemap_write_and_wait(mapping);
-       if (ret != 0)
-               goto out;
-       ret = nfs_wb_all(mapping->host);
-out:
+       if (mapping->nrpages != 0) {
+               unmap_mapping_range(mapping, 0, 0, 0);
+               ret = nfs_wb_all(mapping->host);
+       }
        return ret;
 }