Release 4.10 fs/nfsd/nfs3xdr.c
/*
* XDR support for nfsd/protocol version 3.
*
* Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
*
* 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()!
*/
#include <linux/namei.h>
#include <linux/sunrpc/svc_xprt.h>
#include "xdr3.h"
#include "auth.h"
#include "netns.h"
#include "vfs.h"
#define NFSDDBG_FACILITY NFSDDBG_XDR
/*
* Mapping of S_IF* types to NFS file types
*/
static u32 nfs3_ftypes[] = {
NF3NON, NF3FIFO, NF3CHR, NF3BAD,
NF3DIR, NF3BAD, NF3BLK, NF3BAD,
NF3REG, NF3BAD, NF3LNK, NF3BAD,
NF3SOCK, NF3BAD, NF3LNK, NF3BAD,
};
/*
* XDR functions for basic NFS types
*/
static __be32 *
encode_time3(__be32 *p, struct timespec *time)
{
*p++ = htonl((u32) time->tv_sec); *p++ = htonl(time->tv_nsec);
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 29 | 65.91% | 1 | 25.00% |
andi kleen | andi kleen | 12 | 27.27% | 1 | 25.00% |
al viro | al viro | 2 | 4.55% | 1 | 25.00% |
jamie lokier | jamie lokier | 1 | 2.27% | 1 | 25.00% |
| Total | 44 | 100.00% | 4 | 100.00% |
static __be32 *
decode_time3(__be32 *p, struct timespec *time)
{
time->tv_sec = ntohl(*p++);
time->tv_nsec = ntohl(*p++);
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 23 | 56.10% | 1 | 33.33% |
andi kleen | andi kleen | 16 | 39.02% | 1 | 33.33% |
al viro | al viro | 2 | 4.88% | 1 | 33.33% |
| Total | 41 | 100.00% | 3 | 100.00% |
static __be32 *
decode_fh(__be32 *p, struct svc_fh *fhp)
{
unsigned int size;
fh_init(fhp, NFS3_FHSIZE);
size = ntohl(*p++);
if (size > NFS3_FHSIZE)
return NULL;
memcpy(&fhp->fh_handle.fh_base, p, size);
fhp->fh_handle.fh_size = size;
return p + XDR_QUADLEN(size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 72 | 96.00% | 3 | 60.00% |
al viro | al viro | 2 | 2.67% | 1 | 20.00% |
neil brown | neil brown | 1 | 1.33% | 1 | 20.00% |
| Total | 75 | 100.00% | 5 | 100.00% |
/* Helper function for NFSv3 ACL code */
__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp)
{
return decode_fh(p, fhp);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andreas gruenbacher | andreas gruenbacher | 21 | 91.30% | 1 | 50.00% |
al viro | al viro | 2 | 8.70% | 1 | 50.00% |
| Total | 23 | 100.00% | 2 | 100.00% |
static __be32 *
encode_fh(__be32 *p, struct svc_fh *fhp)
{
unsigned int size = fhp->fh_handle.fh_size;
*p++ = htonl(size);
if (size) p[XDR_QUADLEN(size)-1]=0;
memcpy(p, &fhp->fh_handle.fh_base, size);
return p + XDR_QUADLEN(size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 70 | 95.89% | 3 | 60.00% |
al viro | al viro | 2 | 2.74% | 1 | 20.00% |
neil brown | neil brown | 1 | 1.37% | 1 | 20.00% |
| Total | 73 | 100.00% | 5 | 100.00% |
/*
* Decode a file name and make sure that the path contains
* no slashes or null bytes.
*/
static __be32 *
decode_filename(__be32 *p, char **namp, unsigned int *lenp)
{
char *name;
unsigned int i;
if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS3_MAXNAMLEN)) != NULL) {
for (i = 0, name = *namp; i < *lenp; i++, name++) {
if (*name == '\0' || *name == '/')
return NULL;
}
}
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 87 | 94.57% | 1 | 25.00% |
al viro | al viro | 2 | 2.17% | 1 | 25.00% |
chuck lever | chuck lever | 2 | 2.17% | 1 | 25.00% |
linus torvalds | linus torvalds | 1 | 1.09% | 1 | 25.00% |
| Total | 92 | 100.00% | 4 | 100.00% |
static __be32 *
decode_sattr3(__be32 *p, struct iattr *iap)
{
u32 tmp;
iap->ia_valid = 0;
if (*p++) {
iap->ia_valid |= ATTR_MODE;
iap->ia_mode = ntohl(*p++);
}
if (*p++) {
iap->ia_uid = make_kuid(&init_user_ns, ntohl(*p++));
if (uid_valid(iap->ia_uid))
iap->ia_valid |= ATTR_UID;
}
if (*p++) {
iap->ia_gid = make_kgid(&init_user_ns, ntohl(*p++));
if (gid_valid(iap->ia_gid))
iap->ia_valid |= ATTR_GID;
}
if (*p++) {
u64 newsize;
iap->ia_valid |= ATTR_SIZE;
p = xdr_decode_hyper(p, &newsize);
iap->ia_size = min_t(u64, newsize, NFS_OFFSET_MAX);
}
if ((tmp = ntohl(*p++)) == 1) { /* set to server time */
iap->ia_valid |= ATTR_ATIME;
} else if (tmp == 2) { /* set to client time */
iap->ia_valid |= ATTR_ATIME | ATTR_ATIME_SET;
iap->ia_atime.tv_sec = ntohl(*p++);
iap->ia_atime.tv_nsec = ntohl(*p++);
}
if ((tmp = ntohl(*p++)) == 1) { /* set to server time */
iap->ia_valid |= ATTR_MTIME;
} else if (tmp == 2) { /* set to client time */
iap->ia_valid |= ATTR_MTIME | ATTR_MTIME_SET;
iap->ia_mtime.tv_sec = ntohl(*p++);
iap->ia_mtime.tv_nsec = ntohl(*p++);
}
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 233 | 75.40% | 4 | 50.00% |
eric w. biederman | eric w. biederman | 42 | 13.59% | 1 | 12.50% |
andi kleen | andi kleen | 26 | 8.41% | 1 | 12.50% |
kinglong mee | kinglong mee | 6 | 1.94% | 1 | 12.50% |
al viro | al viro | 2 | 0.65% | 1 | 12.50% |
| Total | 309 | 100.00% | 8 | 100.00% |
static __be32 *encode_fsid(__be32 *p, struct svc_fh *fhp)
{
u64 f;
switch(fsid_source(fhp)) {
default:
case FSIDSOURCE_DEV:
p = xdr_encode_hyper(p, (u64)huge_encode_dev
(fhp->fh_dentry->d_sb->s_dev));
break;
case FSIDSOURCE_FSID:
p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid);
break;
case FSIDSOURCE_UUID:
f = ((u64*)fhp->fh_export->ex_uuid)[0];
f ^= ((u64*)fhp->fh_export->ex_uuid)[1];
p = xdr_encode_hyper(p, f);
break;
}
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
neil brown | neil brown | 123 | 99.19% | 1 | 50.00% |
al viro | al viro | 1 | 0.81% | 1 | 50.00% |
| Total | 124 | 100.00% | 2 | 100.00% |
static __be32 *
encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
struct kstat *stat)
{
*p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
*p++ = htonl((u32) (stat->mode & S_IALLUGO));
*p++ = htonl((u32) stat->nlink);
*p++ = htonl((u32) from_kuid(&init_user_ns, stat->uid));
*p++ = htonl((u32) from_kgid(&init_user_ns, stat->gid));
if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) {
p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN);
} else {
p = xdr_encode_hyper(p, (u64) stat->size);
}
p = xdr_encode_hyper(p, ((u64)stat->blocks) << 9);
*p++ = htonl((u32) MAJOR(stat->rdev));
*p++ = htonl((u32) MINOR(stat->rdev));
p = encode_fsid(p, fhp);
p = xdr_encode_hyper(p, stat->ino);
p = encode_time3(p, &stat->atime);
p = encode_time3(p, &stat->mtime);
p = encode_time3(p, &stat->ctime);
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 184 | 66.91% | 4 | 28.57% |
al viro | al viro | 33 | 12.00% | 3 | 21.43% |
david shaw | david shaw | 19 | 6.91% | 1 | 7.14% |
eric w. biederman | eric w. biederman | 12 | 4.36% | 1 | 7.14% |
andi kleen | andi kleen | 9 | 3.27% | 1 | 7.14% |
neil brown | neil brown | 9 | 3.27% | 2 | 14.29% |
albert fluegel | albert fluegel | 6 | 2.18% | 1 | 7.14% |
peter staubach | peter staubach | 3 | 1.09% | 1 | 7.14% |
| Total | 275 | 100.00% | 14 | 100.00% |
static __be32 *
encode_saved_post_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
{
/* Attributes to follow */
*p++ = xdr_one;
return encode_fattr3(rqstp, p, fhp, &fhp->fh_post_attr);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 34 | 79.07% | 2 | 33.33% |
peter staubach | peter staubach | 3 | 6.98% | 1 | 16.67% |
al viro | al viro | 2 | 4.65% | 1 | 16.67% |
andi kleen | andi kleen | 2 | 4.65% | 1 | 16.67% |
neil brown | neil brown | 2 | 4.65% | 1 | 16.67% |
| Total | 43 | 100.00% | 6 | 100.00% |
/*
* Encode post-operation attributes.
* The inode may be NULL if the call failed because of a stale file
* handle. In this case, no attributes are returned.
*/
static __be32 *
encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
{
struct dentry *dentry = fhp->fh_dentry;
if (dentry && d_really_is_positive(dentry)) {
__be32 err;
struct kstat stat;
err = fh_getattr(fhp, &stat);
if (!err) {
*p++ = xdr_one; /* attributes follow */
lease_get_mtime(d_inode(dentry), &stat.mtime);
return encode_fattr3(rqstp, p, fhp, &stat);
}
}
*p++ = xdr_zero;
return p;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 50 | 46.73% | 2 | 25.00% |
david shaw | david shaw | 25 | 23.36% | 1 | 12.50% |
neil brown | neil brown | 12 | 11.21% | 1 | 12.50% |
peter staubach | peter staubach | 10 | 9.35% | 1 | 12.50% |
david howells | david howells | 6 | 5.61% | 1 | 12.50% |
al viro | al viro | 4 | 3.74% | 2 | 25.00% |
| Total | 107 | 100.00% | 8 | 100.00% |
/* Helper for NFSv3 ACLs */
__be32 *
nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
{
return encode_post_op_attr(rqstp, p, fhp);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andreas gruenbacher | andreas gruenbacher | 28 | 93.33% | 1 | 50.00% |
al viro | al viro | 2 | 6.67% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
/*
* Enocde weak cache consistency data
*/
static __be32 *
encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
{
struct dentry *dentry = fhp->fh_dentry;
if (dentry && d_really_is_positive(dentry) && fhp->fh_post_saved) {
if (fhp->fh_pre_saved) {
*p++ = xdr_one;
p = xdr_encode_hyper(p, (u64) fhp->fh_pre_size);
p = encode_time3(p, &fhp->fh_pre_mtime);
p = encode_time3(p, &fhp->fh_pre_ctime);
} else {
*p++ = xdr_zero;
}
return encode_saved_post_attr(rqstp, p, fhp);
}
/* no pre- or post-attrs */
*p++ = xdr_zero;
return encode_post_op_attr(rqstp, p, fhp);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 120 | 90.23% | 3 | 37.50% |
neil brown | neil brown | 6 | 4.51% | 2 | 25.00% |
david howells | david howells | 3 | 2.26% | 1 | 12.50% |
andi kleen | andi kleen | 2 | 1.50% | 1 | 12.50% |
al viro | al viro | 2 | 1.50% | 1 | 12.50% |
| Total | 133 | 100.00% | 8 | 100.00% |
/*
* Fill in the post_op attr for the wcc data
*/
void fill_post_wcc(struct svc_fh *fhp)
{
__be32 err;
if (fhp->fh_post_saved)
printk("nfsd: inode locked twice during operation.\n");
err = fh_getattr(fhp, &fhp->fh_post_attr);
fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version;
if (err) {
fhp->fh_post_saved = false;
/* Grab the ctime anyway - set_change_info might use it */
fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime;
} else
fhp->fh_post_saved = true;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
peter staubach | peter staubach | 49 | 58.33% | 1 | 16.67% |
neil brown | neil brown | 15 | 17.86% | 1 | 16.67% |
j. bruce fields | j. bruce fields | 10 | 11.90% | 1 | 16.67% |
david howells | david howells | 6 | 7.14% | 1 | 16.67% |
jeff layton | jeff layton | 2 | 2.38% | 1 | 16.67% |
al viro | al viro | 2 | 2.38% | 1 | 16.67% |
| Total | 84 | 100.00% | 6 | 100.00% |
/*
* XDR decode functions
*/
int
nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 35 | 74.47% | 1 | 25.00% |
neil brown | neil brown | 6 | 12.77% | 1 | 25.00% |
benoit taine | benoit taine | 5 | 10.64% | 1 | 25.00% |
al viro | al viro | 1 | 2.13% | 1 | 25.00% |
| Total | 47 | 100.00% | 4 | 100.00% |
int
nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_sattrargs *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = decode_sattr3(p, &args->attrs);
if ((args->check_guard = ntohl(*p++)) != 0) {
struct timespec time;
p = decode_time3(p, &time);
args->guardtime = time.tv_sec;
}
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 76 | 76.00% | 2 | 33.33% |
andi kleen | andi kleen | 13 | 13.00% | 1 | 16.67% |
benoit taine | benoit taine | 5 | 5.00% | 1 | 16.67% |
neil brown | neil brown | 5 | 5.00% | 1 | 16.67% |
al viro | al viro | 1 | 1.00% | 1 | 16.67% |
| Total | 100 | 100.00% | 6 | 100.00% |
int
nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_diropargs *args)
{
if (!(p = decode_fh(p, &args->fh))
|| !(p = decode_filename(p, &args->name, &args->len)))
return 0;
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 66 | 98.51% | 1 | 50.00% |
al viro | al viro | 1 | 1.49% | 1 | 50.00% |
| Total | 67 | 100.00% | 2 | 100.00% |
int
nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_accessargs *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
args->access = ntohl(*p++);
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 52 | 89.66% | 1 | 33.33% |
benoit taine | benoit taine | 5 | 8.62% | 1 | 33.33% |
al viro | al viro | 1 | 1.72% | 1 | 33.33% |
| Total | 58 | 100.00% | 3 | 100.00% |
int
nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_readargs *args)
{
unsigned int len;
int v;
u32 max_blocksize = svc_max_payload(rqstp);
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = xdr_decode_hyper(p, &args->offset);
args->count = ntohl(*p++);
len = min(args->count, max_blocksize);
/* set up the kvec */
v=0;
while (len > 0) {
struct page *p = *(rqstp->rq_next_page++);
rqstp->rq_vec[v].iov_base = page_address(p);
rqstp->rq_vec[v].iov_len = min_t(unsigned int, len, PAGE_SIZE);
len -= rqstp->rq_vec[v].iov_len;
v++;
}
args->vlen = v;
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
neil brown | neil brown | 73 | 41.95% | 6 | 40.00% |
pre-git | pre-git | 59 | 33.91% | 3 | 20.00% |
kinglong mee | kinglong mee | 15 | 8.62% | 1 | 6.67% |
j. bruce fields | j. bruce fields | 11 | 6.32% | 1 | 6.67% |
greg banks | greg banks | 9 | 5.17% | 1 | 6.67% |
benoit taine | benoit taine | 5 | 2.87% | 1 | 6.67% |
al viro | al viro | 2 | 1.15% | 2 | 13.33% |
| Total | 174 | 100.00% | 15 | 100.00% |
int
nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_writeargs *args)
{
unsigned int len, v, hdr, dlen;
u32 max_blocksize = svc_max_payload(rqstp);
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = xdr_decode_hyper(p, &args->offset);
args->count = ntohl(*p++);
args->stable = ntohl(*p++);
len = args->len = ntohl(*p++);
/*
* The count must equal the amount of data passed.
*/
if (args->count != args->len)
return 0;
/*
* Check to make sure that we got the right number of
* bytes.
*/
hdr = (void*)p - rqstp->rq_arg.head[0].iov_base;
dlen = rqstp->rq_arg.head[0].iov_len + rqstp->rq_arg.page_len
+ rqstp->rq_arg.tail[0].iov_len - hdr;
/*
* Round the length of the data which was specified up to
* the next multiple of XDR units and then compare that
* against the length which was actually received.
* Note that when RPCSEC/GSS (for example) is used, the
* data buffer can be padded so dlen might be larger
* than required. It must never be smaller.
*/
if (dlen < XDR_QUADLEN(len)*4)
return 0;
if (args->count > max_blocksize) {
args->count = max_blocksize;
len = args->len = max_blocksize;
}
rqstp->rq_vec[0].iov_base = (void*)p;
rqstp->rq_vec[0].iov_len = rqstp->rq_arg.head[0].iov_len - hdr;
v = 0;
while (len > rqstp->rq_vec[v].iov_len) {
len -= rqstp->rq_vec[v].iov_len;
v++;
rqstp->rq_vec[v].iov_base = page_address(rqstp->rq_pages[v]);
rqstp->rq_vec[v].iov_len = PAGE_SIZE;
}
rqstp->rq_vec[v].iov_len = len;
args->vlen = v + 1;
return 1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
neil brown | neil brown | 164 | 49.55% | 7 | 46.67% |
pre-git | pre-git | 87 | 26.28% | 3 | 20.00% |
peter staubach | peter staubach | 55 | 16.62% | 1 | 6.67% |
chuck lever | chuck lever | 11 | 3.32% | 1 | 6.67% |
greg banks | greg banks | 8 | 2.42% | 1 | 6.67% |
benoit taine | benoit taine | 5 | 1.51% | 1 | 6.67% |
al viro | al viro | 1 | 0.30% | 1 | 6.67% |
| Total | 331 | 100.00% | 15 | 100.00% |
int
nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_createargs *args)
{
if (!(p = decode_fh(p, &args->fh))
|| !(p = decode_filename(p, &args->name, &args->len)))
return 0;
switch (args->createmode = ntohl(*p++)) {
case NFS3_CREATE_UNCHECKED:
case NFS3_CREATE_GUARDED:
p = decode_sattr3(p, &args->attrs);
break;
case NFS3_CREATE_EXCLUSIVE:
args->verf = p;
p += 2;
break;
default:
return 0;
}
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 117 | 98.32% | 2 | 50.00% |
neil brown | neil brown | 1 | 0.84% | 1 | 25.00% |
al viro | al viro | 1 | 0.84% | 1 | 25.00% |
| Total | 119 | 100.00% | 4 | 100.00% |
int
nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_createargs *args)
{
if (!(p = decode_fh(p, &args->fh)) ||
!(p = decode_filename(p, &args->name, &args->len)))
return 0;
p = decode_sattr3(p, &args->attrs);
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 73 | 92.41% | 1 | 33.33% |
neil brown | neil brown | 5 | 6.33% | 1 | 33.33% |
al viro | al viro | 1 | 1.27% | 1 | 33.33% |
| Total | 79 | 100.00% | 3 | 100.00% |
int
nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_symlinkargs *args)
{
unsigned int len, avail;
char *old, *new;
struct kvec *vec;
if (!(p = decode_fh(p, &args->ffh)) ||
!(p = decode_filename(p, &args->fname, &args->flen))
)
return 0;
p = decode_sattr3(p, &args->attrs);
/* now decode the pathname, which might be larger than the first page.
* As we have to check for nul's anyway, we copy it into a new page
* This page appears in the rq_res.pages list, but as pages_len is always
* 0, it won't get in the way
*/
len = ntohl(*p++);
if (len == 0 || len > NFS3_MAXPATHLEN || len >= PAGE_SIZE)
return 0;
args->tname = new = page_address(*(rqstp->rq_next_page++));
args->tlen = len;
/* first copy and check from the first page */
old = (char*)p;
vec = &rqstp->rq_arg.head[0];
avail = vec->iov_len - (old - (char*)vec->iov_base);
while (len && avail && *old) {
*new++ = *old++;
len--;
avail--;
}
/* now copy next page if there is one */
if (len && !avail && rqstp->rq_arg.page_len) {
avail = min_t(unsigned int, rqstp->rq_arg.page_len, PAGE_SIZE);
old = page_address(rqstp->rq_arg.pages[0]);
}
while (len && avail && *old) {
*new++ = *old++;
len--;
avail--;
}
*new = '\0';
if (len)
return 0;
return 1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
neil brown | neil brown | 188 | 66.20% | 5 | 45.45% |
pre-git | pre-git | 81 | 28.52% | 1 | 9.09% |
kinglong mee | kinglong mee | 8 | 2.82% | 1 | 9.09% |
j. bruce fields | j. bruce fields | 4 | 1.41% | 1 | 9.09% |
al viro | al viro | 2 | 0.70% | 2 | 18.18% |
chuck lever | chuck lever | 1 | 0.35% | 1 | 9.09% |
| Total | 284 | 100.00% | 11 | 100.00% |
int
nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_mknodargs *args)
{
if (!(p = decode_fh(p, &args->fh))
|| !(p = decode_filename(p, &args->name, &args->len)))
return 0;
args->ftype = ntohl(*p++);
if (args->ftype == NF3BLK || args->ftype == NF3CHR
|| args->ftype == NF3SOCK || args->ftype == NF3FIFO)
p = decode_sattr3(p, &args->attrs);
if (args->ftype == NF3BLK || args->ftype == NF3CHR) {
args->major = ntohl(*p++);
args->minor = ntohl(*p++);
}
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 152 | 98.70% | 1 | 33.33% |
neil brown | neil brown | 1 | 0.65% | 1 | 33.33% |
al viro | al viro | 1 | 0.65% | 1 | 33.33% |
| Total | 154 | 100.00% | 3 | 100.00% |
int
nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_renameargs *args)
{
if (!(p = decode_fh(p, &args->ffh))
|| !(p = decode_filename(p, &args->fname, &args->flen))
|| !(p = decode_fh(p, &args->tfh))
|| !(p = decode_filename(p, &args->tname, &args->tlen)))
return 0;
return xdr_argsize_check(rqstp, p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 101 | 99.02% | 1 | 50.00% |
al viro | al viro | 1 | 0.98% | 1 | 50.00% |
| Total | 102 | 100.00% | 2 | 100.00% |
int
nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_readlinkargs *args)
{
p