summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-23 22:02:49 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 00:06:27 -0700
commit52f4fb43063c182f3ef7e257ab336a8be8066bb0 (patch)
treef7e551168995e5210a0706fb273f6c54ba6bffef
parent0c0a400d1debb172c596b24ab82efab4975990a9 (diff)
downloadblackbird-op-linux-52f4fb43063c182f3ef7e257ab336a8be8066bb0.tar.gz
blackbird-op-linux-52f4fb43063c182f3ef7e257ab336a8be8066bb0.zip
[PATCH] nfsd4: find_delegation_file()
Factor out a bit of common code that will be useful elsewhere. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-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 75e8b137580c..bb95275e7bae 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1526,6 +1526,18 @@ out:
return status;
}
+static struct nfs4_delegation *
+find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
+{
+ struct nfs4_delegation *dp;
+
+ list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) {
+ if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid)
+ return dp;
+ }
+ return NULL;
+}
+
static int
nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp)
{
@@ -2419,24 +2431,15 @@ find_stateid(stateid_t *stid, int flags)
static struct nfs4_delegation *
find_delegation_stateid(struct inode *ino, stateid_t *stid)
{
- struct nfs4_delegation *dp = NULL;
struct nfs4_file *fp = NULL;
- u32 st_id;
dprintk("NFSD:find_delegation_stateid stateid=(%08x/%08x/%08x/%08x)\n",
stid->si_boot, stid->si_stateownerid,
stid->si_fileid, stid->si_generation);
- st_id = stid->si_stateownerid;
fp = find_file(ino);
- if (fp) {
- list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) {
- if(dp->dl_stateid.si_stateownerid == st_id) {
- dprintk("NFSD: find_delegation dp %p\n",dp);
- return dp;
- }
- }
- }
+ if (fp)
+ return find_delegation_file(fp, stid);
return NULL;
}
OpenPOWER on IntegriCloud