aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@davequigley.com>2013-05-22 12:50:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-08 16:20:14 -0400
commita09df2ca2313fd49f0f3e1f2caa546bcacf7b6df (patch)
treea928093ccb8d0def9ced381de12fbc276af57f53 /fs/nfs/nfs4xdr.c
parente058f70b8070608fedfd3e39c2ead935beecb552 (diff)
NFSv4: Extend fattr bitmaps to support all 3 words
The fattr handling bitmap code only uses the first two fattr words sofar. This patch adds the 3rd word to being sent but doesn't populate it yet. Signed-off-by: Miguel Rodel Felipe <Rodel_FM@dsi.a-star.edu.sg> Signed-off-by: Phua Eu Gene <PHUA_Eu_Gene@dsi.a-star.edu.sg> Signed-off-by: Khin Mi Mi Aung <Mi_Mi_AUNG@dsi.a-star.edu.sg> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 4be8d135ed61..727cfe080eae 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -979,15 +979,16 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
979 int len; 979 int len;
980 uint32_t bmval0 = 0; 980 uint32_t bmval0 = 0;
981 uint32_t bmval1 = 0; 981 uint32_t bmval1 = 0;
982 uint32_t bmval2 = 0;
982 983
983 /* 984 /*
984 * We reserve enough space to write the entire attribute buffer at once. 985 * We reserve enough space to write the entire attribute buffer at once.
985 * In the worst-case, this would be 986 * In the worst-case, this would be
986 * 12(bitmap) + 4(attrlen) + 8(size) + 4(mode) + 4(atime) + 4(mtime) 987 * 16(bitmap) + 4(attrlen) + 8(size) + 4(mode) + 4(atime) + 4(mtime)
987 * = 36 bytes, plus any contribution from variable-length fields 988 * = 40 bytes, plus any contribution from variable-length fields
988 * such as owner/group. 989 * such as owner/group.
989 */ 990 */
990 len = 16; 991 len = 20;
991 992
992 /* Sigh */ 993 /* Sigh */
993 if (iap->ia_valid & ATTR_SIZE) 994 if (iap->ia_valid & ATTR_SIZE)
@@ -1031,9 +1032,9 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
1031 * We write the bitmap length now, but leave the bitmap and the attribute 1032 * We write the bitmap length now, but leave the bitmap and the attribute
1032 * buffer length to be backfilled at the end of this routine. 1033 * buffer length to be backfilled at the end of this routine.
1033 */ 1034 */
1034 *p++ = cpu_to_be32(2); 1035 *p++ = cpu_to_be32(3);
1035 q = p; 1036 q = p;
1036 p += 3; 1037 p += 4;
1037 1038
1038 if (iap->ia_valid & ATTR_SIZE) { 1039 if (iap->ia_valid & ATTR_SIZE) {
1039 bmval0 |= FATTR4_WORD0_SIZE; 1040 bmval0 |= FATTR4_WORD0_SIZE;
@@ -1080,9 +1081,10 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
1080 len, ((char *)p - (char *)q) + 4); 1081 len, ((char *)p - (char *)q) + 4);
1081 BUG(); 1082 BUG();
1082 } 1083 }
1083 len = (char *)p - (char *)q - 12; 1084 len = (char *)p - (char *)q - 16;
1084 *q++ = htonl(bmval0); 1085 *q++ = htonl(bmval0);
1085 *q++ = htonl(bmval1); 1086 *q++ = htonl(bmval1);
1087 *q++ = htonl(bmval2);
1086 *q = htonl(len); 1088 *q = htonl(len);
1087 1089
1088/* out: */ 1090/* out: */
@@ -1188,8 +1190,10 @@ encode_getattr_three(struct xdr_stream *xdr,
1188 1190
1189static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) 1191static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr)
1190{ 1192{
1191 encode_getattr_two(xdr, bitmask[0] & nfs4_fattr_bitmap[0], 1193 encode_getattr_three(xdr, bitmask[0] & nfs4_fattr_bitmap[0],
1192 bitmask[1] & nfs4_fattr_bitmap[1], hdr); 1194 bitmask[1] & nfs4_fattr_bitmap[1],
1195 bitmask[2] & nfs4_fattr_bitmap[2],
1196 hdr);
1193} 1197}
1194 1198
1195static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask, 1199static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask,