patch-2.3.51 linux/fs/nfsd/lockd.c
Next file: linux/fs/nfsd/nfs3proc.c
Previous file: linux/fs/nfsd/export.c
Back to the patch index
Back to the overall index
- Lines: 37
- Date:
Thu Mar 9 23:31:43 2000
- Orig file:
v2.3.50/linux/fs/nfsd/lockd.c
- Orig date:
Sun Feb 20 21:12:39 2000
diff -u --recursive --new-file v2.3.50/linux/fs/nfsd/lockd.c linux/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 @@
* 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
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)