Skip to content

Commit

Permalink
NFS: Clean up nfs_sync_mapping
Browse files Browse the repository at this point in the history
Remove the redundant call to filemap_write_and_wait().

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 5, 2010
1 parent 7f2f12d commit 5cf9521
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5cf9521

Please sign in to comment.