static void encode_readdirplus3args(struct xdr_stream *xdr,
                                    const struct nfs3_readdirargs *args)
 {
+       uint32_t dircount = args->count;
+       uint32_t maxcount = args->count;
        __be32 *p;
 
        encode_nfs_fh3(xdr, args->fh);
         * readdirplus: need dircount + buffer size.
         * We just make sure we make dircount big enough
         */
-       *p++ = cpu_to_be32(args->count >> 3);
-
-       *p = cpu_to_be32(args->count);
+       *p++ = cpu_to_be32(dircount);
+       *p = cpu_to_be32(maxcount);
 }
 
 static void nfs3_xdr_enc_readdirplus3args(struct rpc_rqst *req,
 
                FATTR4_WORD0_RDATTR_ERROR,
                FATTR4_WORD1_MOUNTED_ON_FILEID,
        };
-       uint32_t dircount = readdir->count >> 1;
+       uint32_t dircount = readdir->count;
+       uint32_t maxcount = readdir->count;
        __be32 *p, verf[2];
        uint32_t attrlen = 0;
        unsigned int i;
                        FATTR4_WORD1_SPACE_USED|FATTR4_WORD1_TIME_ACCESS|
                        FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY;
                attrs[2] |= FATTR4_WORD2_SECURITY_LABEL;
-               dircount >>= 1;
        }
        /* Use mounted_on_fileid only if the server supports it */
        if (!(readdir->bitmask[1] & FATTR4_WORD1_MOUNTED_ON_FILEID))
        encode_nfs4_verifier(xdr, &readdir->verifier);
        p = reserve_space(xdr, 12 + (attrlen << 2));
        *p++ = cpu_to_be32(dircount);
-       *p++ = cpu_to_be32(readdir->count);
+       *p++ = cpu_to_be32(maxcount);
        *p++ = cpu_to_be32(attrlen);
        for (i = 0; i < attrlen; i++)
                *p++ = cpu_to_be32(attrs[i]);