diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
commit | 1471f525455788c20b130690e0f104df451aeb43 (patch) | |
tree | 3778beba56558beb9a9548ea5b467e9c44ea966f /fs/nfsd/lockd.c | |
parent | e80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff) |
Merge with Linux 2.3.51.
Diffstat (limited to 'fs/nfsd/lockd.c')
-rw-r--r-- | fs/nfsd/lockd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c index 4062410c6..c45d494ba 100644 --- a/fs/nfsd/lockd.c +++ b/fs/nfsd/lockd.c @@ -20,14 +20,14 @@ * Note: we hold the dentry use count while the file is open. */ static u32 -nlm_fopen(struct svc_rqst *rqstp, struct knfs_fh *f, struct file *filp) +nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file *filp) { u32 nfserr; struct svc_fh fh; - /* must initialize before using! */ - fh_init(&fh); - fh.fh_handle = *f; + /* must initialize before using! but maxsize doesn't matter */ + fh_init(&fh,0); + memcpy((char*)&fh.fh_handle.fh_base, (char*)f, NFS_FHSIZE); fh.fh_export = NULL; nfserr = nfsd_open(rqstp, &fh, S_IFREG, MAY_LOCK, filp); @@ -39,11 +39,14 @@ nlm_fopen(struct svc_rqst *rqstp, struct knfs_fh *f, struct file *filp) * 1 = stale file handle * 2 = other error */ - if (nfserr == 0) + switch (nfserr) { + case nfs_ok: return 0; - else if (nfserr == nfserr_stale) + case nfserr_stale: return 1; - else return 2; + default: + return 2; + } } static void |