summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust2014-07-23 22:17:38 +0200
committerJ. Bruce Fields2014-07-23 22:35:23 +0200
commite2cf80d73f283fa573069217bdb899bc554d9edc (patch)
tree8e24156ffaf41ca0c38d5ec1097a33ce0cb3b97c /fs/nfsd/nfs4state.c
parentnfsd4: convert comma to semicolon (diff)
downloadkernel-qcow2-linux-e2cf80d73f283fa573069217bdb899bc554d9edc.tar.gz
kernel-qcow2-linux-e2cf80d73f283fa573069217bdb899bc554d9edc.tar.xz
kernel-qcow2-linux-e2cf80d73f283fa573069217bdb899bc554d9edc.zip
nfsd: Store the filehandle with the struct nfs4_file
For use when we may not have a struct inode. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 66a3b843a82b..859891f30958 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2833,7 +2833,8 @@ static struct nfs4_file *nfsd4_alloc_file(void)
}
/* OPEN Share state helper functions */
-static void nfsd4_init_file(struct nfs4_file *fp, struct inode *ino)
+static void nfsd4_init_file(struct nfs4_file *fp, struct inode *ino,
+ struct knfsd_fh *fh)
{
unsigned int hashval = file_hashval(ino);
@@ -2845,6 +2846,7 @@ static void nfsd4_init_file(struct nfs4_file *fp, struct inode *ino)
INIT_LIST_HEAD(&fp->fi_delegations);
ihold(ino);
fp->fi_inode = ino;
+ fh_copy_shallow(&fp->fi_fhandle, fh);
fp->fi_had_conflict = false;
fp->fi_lease = NULL;
fp->fi_share_deny = 0;
@@ -3049,14 +3051,14 @@ find_file(struct inode *ino)
}
static struct nfs4_file *
-find_or_add_file(struct inode *ino, struct nfs4_file *new)
+find_or_add_file(struct inode *ino, struct nfs4_file *new, struct knfsd_fh *fh)
{
struct nfs4_file *fp;
spin_lock(&state_lock);
fp = find_file_locked(ino);
if (fp == NULL) {
- nfsd4_init_file(new, ino);
+ nfsd4_init_file(new, ino, fh);
fp = new;
}
spin_unlock(&state_lock);
@@ -3711,7 +3713,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
* and check for delegations in the process of being recalled.
* If not found, create the nfs4_file struct
*/
- fp = find_or_add_file(ino, open->op_file);
+ fp = find_or_add_file(ino, open->op_file, &current_fh->fh_handle);
if (fp != open->op_file) {
status = nfs4_check_deleg(cl, open, &dp);
if (status)