NFSv4.1: Add a helper pnfs_commit_and_return_layout

In order to be able to safely return the layout in nfs4_proc_setattr,
we need to block new uses of the layout, wait for all outstanding
users of the layout to complete, commit the layout and then return it.

This patch adds a helper in order to do all this safely.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
This commit is contained in:
Trond Myklebust
2013-03-20 13:23:33 -04:00
parent 2495680434
commit 240286725d
3 changed files with 34 additions and 1 deletions

View File

@@ -2632,7 +2632,7 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
int status;
if (pnfs_ld_layoutret_on_setattr(inode))
pnfs_return_layout(inode);
pnfs_commit_and_return_layout(inode);
nfs_fattr_init(fattr);