summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-03-09 16:49:09 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-09 16:49:09 -0800
commit666d0944a00f7d8143bccedefaa1fb2e0bbe0bd9 (patch)
treee257995ec85a640550f573ffd62de8b4e2991b4c
parent9a2ac33926db19c18ab6d0c9230198053b726e41 (diff)
[PATCH] nfsd4: fix nfs4_check_delegmode()
Inline nfs4_check_delegmode, replace & by &&, remove incorrect check. (Note that it's fine to read using the stateid for a write delegation.) While we're at it, the status return logic seems like overkill for one simple check. 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.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index f5ef9692a20a..63980afc2366 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1969,18 +1969,13 @@ out:
return status;
}
-static int
+static inline int
nfs4_check_delegmode(struct nfs4_delegation *dp, int flags)
{
- int status = nfserr_openmode;
-
- if ((flags & WR_STATE) & (dp->dl_type == NFS4_OPEN_DELEGATE_READ))
- goto out;
- if ((flags & RD_STATE) & (dp->dl_type == NFS4_OPEN_DELEGATE_WRITE))
- goto out;
- status = nfs_ok;
-out:
- return status;
+ if ((flags & WR_STATE) && (dp->dl_type == NFS4_OPEN_DELEGATE_READ))
+ return nfserr_openmode;
+ else
+ return nfs_ok;
}
static inline int