From: "Kendrick M. Smith" <kmsmith@umich.edu>
To: linux-kernel@vger.kernel.org, <nfs@lists.sourceforge.net>
Subject: REPOST patch 32/38: SERVER: new argument to nfsd_access()
Date: Wed, 14 Aug 2002 16:52:05 -0400 (EDT) [thread overview]
Message-ID: <Pine.SOL.4.44.0208141651420.1834-100000@vanguard.gpcc.itd.umich.edu> (raw)
NFSv4 defines a new field in the ACCESS response: a bitmap to indicate
which access bits requested by the client are "supported", i.e. meaningful
for the object in question.
This patch adds a new parameter @supported to nfsd_access(), so that
nfsd_access() can set the value of this bitmap.
--- old/fs/nfsd/nfs3proc.c Sun Aug 11 23:08:56 2002
+++ new/fs/nfsd/nfs3proc.c Sun Aug 11 23:09:44 2002
@@ -134,7 +134,7 @@ nfsd3_proc_access(struct svc_rqst *rqstp
fh_copy(&resp->fh, &argp->fh);
resp->access = argp->access;
- nfserr = nfsd_access(rqstp, &resp->fh, &resp->access);
+ nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
RETURN_STATUS(nfserr);
}
--- old/fs/nfsd/vfs.c Sun Aug 11 23:08:56 2002
+++ new/fs/nfsd/vfs.c Sun Aug 11 23:09:44 2002
@@ -348,12 +348,12 @@ static struct accessmap nfs3_anyaccess[]
};
int
-nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access)
+nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *supported)
{
struct accessmap *map;
struct svc_export *export;
struct dentry *dentry;
- u32 query, result = 0;
+ u32 query, result = 0, sresult = 0;
unsigned int error;
error = fh_verify(rqstp, fhp, 0, MAY_NOP);
@@ -375,6 +375,9 @@ nfsd_access(struct svc_rqst *rqstp, stru
for (; map->access; map++) {
if (map->access & query) {
unsigned int err2;
+
+ sresult |= map->access;
+
err2 = nfsd_permission(export, dentry, map->how);
switch (err2) {
case nfs_ok:
@@ -395,6 +398,8 @@ nfsd_access(struct svc_rqst *rqstp, stru
}
}
*access = result;
+ if (supported)
+ *supported = sresult;
out:
return error;
--- old/include/linux/nfsd/nfsd.h Sun Aug 11 23:08:56 2002
+++ new/include/linux/nfsd/nfsd.h Sun Aug 11 23:09:44 2002
@@ -86,7 +86,7 @@ int nfsd_create(struct svc_rqst *, stru
char *name, int len, struct iattr *attrs,
int type, dev_t rdev, struct svc_fh *res);
#ifdef CONFIG_NFSD_V3
-int nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *);
+int nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
int nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
char *name, int len, struct iattr *attrs,
struct svc_fh *res, int createmode,
reply other threads:[~2002-08-14 20:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.SOL.4.44.0208141651420.1834-100000@vanguard.gpcc.itd.umich.edu \
--to=kmsmith@umich.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).