X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fnfsd%2Flockd.c;h=6b6225ac4926f8364762ed5c74bda3a5681235b7;hb=9063974cdbc5463528cb6aa60c91bc0267af7bbb;hp=7b889ff15ae63a96ef47be64172c7d360ef2d61a;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=~andy%2Flinux diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c index 7b889ff15ae..6b6225ac492 100644 --- a/fs/nfsd/lockd.c +++ b/fs/nfsd/lockd.c @@ -22,10 +22,10 @@ /* * Note: we hold the dentry use count while the file is open. */ -static u32 +static __be32 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp) { - u32 nfserr; + __be32 nfserr; struct svc_fh fh; /* must initialize before using! but maxsize doesn't matter */ @@ -35,22 +35,24 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp) fh.fh_export = NULL; exp_readlock(); - nfserr = nfsd_open(rqstp, &fh, S_IFREG, MAY_LOCK, filp); + nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp); fh_put(&fh); rqstp->rq_client = NULL; exp_readunlock(); - /* nlm and nfsd don't share error codes. - * we invent: 0 = no error - * 1 = stale file handle - * 2 = other error + /* We return nlm error codes as nlm doesn't know + * about nfsd, but nfsd does know about nlm.. */ switch (nfserr) { case nfs_ok: return 0; + case nfserr_dropit: + return nlm_drop_reply; +#ifdef CONFIG_LOCKD_V4 case nfserr_stale: - return 1; + return nlm4_stale_fh; +#endif default: - return 2; + return nlm_lck_denied; } } @@ -63,6 +65,7 @@ nlm_fclose(struct file *filp) static struct nlmsvc_binding nfsd_nlm_ops = { .fopen = nlm_fopen, /* open file for locking */ .fclose = nlm_fclose, /* close file */ + .get_grace_period = get_nfs4_grace_period, }; void