aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index c6f07c1c71e6..d3be923d4e43 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -421,3 +421,22 @@ void nfs_delegation_reap_unclaimed(struct nfs4_client *clp)
421 nfs_free_delegation(delegation); 421 nfs_free_delegation(delegation);
422 } 422 }
423} 423}
424
425int nfs4_copy_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
426{
427 struct nfs4_client *clp = NFS_SERVER(inode)->nfs4_state;
428 struct nfs_inode *nfsi = NFS_I(inode);
429 struct nfs_delegation *delegation;
430 int res = 0;
431
432 if (nfsi->delegation_state == 0)
433 return 0;
434 spin_lock(&clp->cl_lock);
435 delegation = nfsi->delegation;
436 if (delegation != NULL) {
437 memcpy(dst->data, delegation->stateid.data, sizeof(dst->data));
438 res = 1;
439 }
440 spin_unlock(&clp->cl_lock);
441 return res;
442}