aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4state.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 75e8b137580..bb95275e7ba 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1526,6 +1526,18 @@ out:
1526 return status; 1526 return status;
1527} 1527}
1528 1528
1529static struct nfs4_delegation *
1530find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
1531{
1532 struct nfs4_delegation *dp;
1533
1534 list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) {
1535 if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid)
1536 return dp;
1537 }
1538 return NULL;
1539}
1540
1529static int 1541static int
1530nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp) 1542nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp)
1531{ 1543{
@@ -2419,24 +2431,15 @@ find_stateid(stateid_t *stid, int flags)
2419static struct nfs4_delegation * 2431static struct nfs4_delegation *
2420find_delegation_stateid(struct inode *ino, stateid_t *stid) 2432find_delegation_stateid(struct inode *ino, stateid_t *stid)
2421{ 2433{
2422 struct nfs4_delegation *dp = NULL;
2423 struct nfs4_file *fp = NULL; 2434 struct nfs4_file *fp = NULL;
2424 u32 st_id;
2425 2435
2426 dprintk("NFSD:find_delegation_stateid stateid=(%08x/%08x/%08x/%08x)\n", 2436 dprintk("NFSD:find_delegation_stateid stateid=(%08x/%08x/%08x/%08x)\n",
2427 stid->si_boot, stid->si_stateownerid, 2437 stid->si_boot, stid->si_stateownerid,
2428 stid->si_fileid, stid->si_generation); 2438 stid->si_fileid, stid->si_generation);
2429 2439
2430 st_id = stid->si_stateownerid;
2431 fp = find_file(ino); 2440 fp = find_file(ino);
2432 if (fp) { 2441 if (fp)
2433 list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) { 2442 return find_delegation_file(fp, stid);
2434 if(dp->dl_stateid.si_stateownerid == st_id) {
2435 dprintk("NFSD: find_delegation dp %p\n",dp);
2436 return dp;
2437 }
2438 }
2439 }
2440 return NULL; 2443 return NULL;
2441} 2444}
2442 2445