Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158589
b: refs/heads/master
c: 811652b
h: refs/heads/master
i:
  158587: 189680e
v: v3
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Aug 14, 2009
1 parent 8cb2f01 commit 907caa3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 345585132a204859fbb7d8b662e9b6e5b563c6dc
refs/heads/master: 811652bd6edd66dd35bf9caacdfe96d19f75a47e
42 changes: 14 additions & 28 deletions trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,8 @@ static void encode_compound_hdr(struct xdr_stream *xdr,

dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag);
BUG_ON(hdr->taglen > NFS4_MAXTAGLEN);
p = reserve_space(xdr, 12 + hdr->taglen);
*p++ = cpu_to_be32(hdr->taglen);
p = xdr_encode_opaque_fixed(p, hdr->tag, hdr->taglen);
p = reserve_space(xdr, 4 + hdr->taglen + 8);
p = xdr_encode_opaque(p, hdr->tag, hdr->taglen);
*p++ = cpu_to_be32(hdr->minorversion);
hdr->nops_p = p;
*p = cpu_to_be32(hdr->nops);
Expand Down Expand Up @@ -832,13 +831,11 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
}
if (iap->ia_valid & ATTR_UID) {
bmval1 |= FATTR4_WORD1_OWNER;
*p++ = cpu_to_be32(owner_namelen);
p = xdr_encode_opaque_fixed(p, owner_name, owner_namelen);
p = xdr_encode_opaque(p, owner_name, owner_namelen);
}
if (iap->ia_valid & ATTR_GID) {
bmval1 |= FATTR4_WORD1_OWNER_GROUP;
*p++ = cpu_to_be32(owner_grouplen);
p = xdr_encode_opaque_fixed(p, owner_group, owner_grouplen);
p = xdr_encode_opaque(p, owner_group, owner_grouplen);
}
if (iap->ia_valid & ATTR_ATIME_SET) {
bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET;
Expand Down Expand Up @@ -939,9 +936,7 @@ static void encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *
break;
}

p = reserve_space(xdr, 4 + create->name->len);
*p++ = cpu_to_be32(create->name->len);
xdr_encode_opaque_fixed(p, create->name->name, create->name->len);
encode_string(xdr, create->name->len, create->name->name);
hdr->nops++;
hdr->replen += decode_create_maxsz;

Expand Down Expand Up @@ -1007,8 +1002,7 @@ static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct

p = reserve_space(xdr, 8 + name->len);
*p++ = cpu_to_be32(OP_LINK);
*p++ = cpu_to_be32(name->len);
xdr_encode_opaque_fixed(p, name->name, name->len);
xdr_encode_opaque(p, name->name, name->len);
hdr->nops++;
hdr->replen += decode_link_maxsz;
}
Expand Down Expand Up @@ -1100,8 +1094,7 @@ static void encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struc

p = reserve_space(xdr, 8 + len);
*p++ = cpu_to_be32(OP_LOOKUP);
*p++ = cpu_to_be32(len);
xdr_encode_opaque_fixed(p, name->name, len);
xdr_encode_opaque(p, name->name, len);
hdr->nops++;
hdr->replen += decode_lookup_maxsz;
}
Expand Down Expand Up @@ -1279,8 +1272,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hd

p = reserve_space(xdr, 8 + len);
*p++ = cpu_to_be32(OP_PUTFH);
*p++ = cpu_to_be32(len);
xdr_encode_opaque_fixed(p, fh->data, len);
xdr_encode_opaque(p, fh->data, len);
hdr->nops++;
hdr->replen += decode_putfh_maxsz;
}
Expand Down Expand Up @@ -1373,8 +1365,7 @@ static void encode_remove(struct xdr_stream *xdr, const struct qstr *name, struc

p = reserve_space(xdr, 8 + name->len);
*p++ = cpu_to_be32(OP_REMOVE);
*p++ = cpu_to_be32(name->len);
xdr_encode_opaque_fixed(p, name->name, name->len);
xdr_encode_opaque(p, name->name, name->len);
hdr->nops++;
hdr->replen += decode_remove_maxsz;
}
Expand All @@ -1383,14 +1374,10 @@ static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, co
{
__be32 *p;

p = reserve_space(xdr, 8 + oldname->len);
*p++ = cpu_to_be32(OP_RENAME);
*p++ = cpu_to_be32(oldname->len);
xdr_encode_opaque_fixed(p, oldname->name, oldname->len);

p = reserve_space(xdr, 4 + newname->len);
*p++ = cpu_to_be32(newname->len);
xdr_encode_opaque_fixed(p, newname->name, newname->len);
p = reserve_space(xdr, 4);
*p = cpu_to_be32(OP_RENAME);
encode_string(xdr, oldname->len, oldname->name);
encode_string(xdr, newname->len, newname->name);
hdr->nops++;
hdr->replen += decode_rename_maxsz;
}
Expand Down Expand Up @@ -1587,8 +1574,7 @@ static void encode_create_session(struct xdr_stream *xdr,

/* authsys_parms rfc1831 */
*p++ = cpu_to_be32((u32)clp->cl_boot_time.tv_nsec); /* stamp */
*p++ = cpu_to_be32(len);
p = xdr_encode_opaque_fixed(p, machine_name, len);
p = xdr_encode_opaque(p, machine_name, len);
*p++ = cpu_to_be32(0); /* UID */
*p++ = cpu_to_be32(0); /* GID */
*p = cpu_to_be32(0); /* No more gids */
Expand Down

0 comments on commit 907caa3

Please sign in to comment.