#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/xdr.h>
#include <linux/mm.h>
+#include <linux/vserver/xid.h>
#define NFSDDBG_FACILITY NFSDDBG_XDR
decode_sattr(u32 *p, struct iattr *iap)
{
u32 tmp, tmp1;
+ uid_t uid = 0;
+ gid_t gid = 0;
iap->ia_valid = 0;
}
if ((tmp = ntohl(*p++)) != (u32)-1) {
iap->ia_valid |= ATTR_UID;
- iap->ia_uid = tmp;
+ uid = tmp;
}
if ((tmp = ntohl(*p++)) != (u32)-1) {
iap->ia_valid |= ATTR_GID;
- iap->ia_gid = tmp;
+ gid = tmp;
}
+ iap->ia_uid = INOXID_UID(XID_TAG_NFSD, uid, gid);
+ iap->ia_gid = INOXID_GID(XID_TAG_NFSD, uid, gid);
+ iap->ia_xid = INOXID_XID(XID_TAG_NFSD, uid, gid, 0);
if ((tmp = ntohl(*p++)) != (u32)-1) {
iap->ia_valid |= ATTR_SIZE;
iap->ia_size = tmp;
*p++ = htonl(nfs_ftypes[type >> 12]);
*p++ = htonl((u32) stat.mode);
*p++ = htonl((u32) stat.nlink);
- *p++ = htonl((u32) nfsd_ruid(rqstp, stat.uid));
- *p++ = htonl((u32) nfsd_rgid(rqstp, stat.gid));
+ *p++ = htonl((u32) nfsd_ruid(rqstp,
+ XIDINO_UID(XID_TAG(dentry->d_inode), stat.uid, stat.xid)));
+ *p++ = htonl((u32) nfsd_rgid(rqstp,
+ XIDINO_GID(XID_TAG(dentry->d_inode), stat.gid, stat.xid)));
if (S_ISLNK(type) && stat.size > NFS_MAXPATHLEN) {
*p++ = htonl(NFS_MAXPATHLEN);
nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
struct nfsd_readargs *args)
{
- int len;
+ unsigned int len;
int v,pn;
if (!(p = decode_fh(p, &args->fh)))
return 0;
svc_take_page(rqstp);
args->vec[v].iov_base = page_address(rqstp->rq_respages[pn]);
args->vec[v].iov_len = len < PAGE_SIZE?len:PAGE_SIZE;
+ len -= args->vec[v].iov_len;
v++;
- len -= PAGE_SIZE;
}
args->vlen = v;
return xdr_argsize_check(rqstp, p);
nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
struct nfsd_writeargs *args)
{
- int len;
+ unsigned int len;
int v;
if (!(p = decode_fh(p, &args->fh)))
return 0;