diff options
Diffstat (limited to 'fs/nfs/nfs4super.c')
| -rw-r--r-- | fs/nfs/nfs4super.c | 28 | 
1 files changed, 10 insertions, 18 deletions
diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index e26acdd1a64..6f340f02f2b 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -77,17 +77,9 @@ static int nfs4_write_inode(struct inode *inode, struct writeback_control *wbc)  {  	int ret = nfs_write_inode(inode, wbc); -	if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) { -		int status; -		bool sync = true; - -		if (wbc->sync_mode == WB_SYNC_NONE) -			sync = false; - -		status = pnfs_layoutcommit_inode(inode, sync); -		if (status < 0) -			return status; -	} +	if (ret == 0) +		ret = pnfs_layoutcommit_inode(inode, +				wbc->sync_mode == WB_SYNC_ALL);  	return ret;  } @@ -98,7 +90,7 @@ static int nfs4_write_inode(struct inode *inode, struct writeback_control *wbc)   */  static void nfs4_evict_inode(struct inode *inode)  { -	truncate_inode_pages(&inode->i_data, 0); +	truncate_inode_pages_final(&inode->i_data);  	clear_inode(inode);  	pnfs_return_layout(inode);  	pnfs_destroy_layout(NFS_I(inode)); @@ -261,9 +253,9 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,  	res = nfs_follow_remote_path(root_mnt, export_path); -	dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n", -			IS_ERR(res) ? PTR_ERR(res) : 0, -			IS_ERR(res) ? " [error]" : ""); +	dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", +		 PTR_ERR_OR_ZERO(res), +		 IS_ERR(res) ? " [error]" : "");  	return res;  } @@ -319,9 +311,9 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,  	data->mnt_path = export_path;  	res = nfs_follow_remote_path(root_mnt, export_path); -	dprintk("<-- nfs4_referral_mount() = %ld%s\n", -			IS_ERR(res) ? PTR_ERR(res) : 0, -			IS_ERR(res) ? " [error]" : ""); +	dprintk("<-- nfs4_referral_mount() = %d%s\n", +		PTR_ERR_OR_ZERO(res), +		IS_ERR(res) ? " [error]" : "");  	return res;  }  | 
