diff options
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e4bb8e6409a7..f7e064d997f6 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1491,12 +1491,17 @@ static void encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
1491 | encode_op_hdr(xdr, OP_PUTROOTFH, decode_putrootfh_maxsz, hdr); | 1491 | encode_op_hdr(xdr, OP_PUTROOTFH, decode_putrootfh_maxsz, hdr); |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | static void encode_open_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx, const struct nfs_lock_context *l_ctx, int zero_seqid) | 1494 | static void encode_open_stateid(struct xdr_stream *xdr, |
1495 | const struct nfs_open_context *ctx, | ||
1496 | const struct nfs_lock_context *l_ctx, | ||
1497 | fmode_t fmode, | ||
1498 | int zero_seqid) | ||
1495 | { | 1499 | { |
1496 | nfs4_stateid stateid; | 1500 | nfs4_stateid stateid; |
1497 | 1501 | ||
1498 | if (ctx->state != NULL) { | 1502 | if (ctx->state != NULL) { |
1499 | nfs4_select_rw_stateid(&stateid, ctx->state, l_ctx->lockowner, l_ctx->pid); | 1503 | nfs4_select_rw_stateid(&stateid, ctx->state, |
1504 | fmode, l_ctx->lockowner, l_ctx->pid); | ||
1500 | if (zero_seqid) | 1505 | if (zero_seqid) |
1501 | stateid.seqid = 0; | 1506 | stateid.seqid = 0; |
1502 | encode_nfs4_stateid(xdr, &stateid); | 1507 | encode_nfs4_stateid(xdr, &stateid); |
@@ -1510,7 +1515,7 @@ static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, | |||
1510 | 1515 | ||
1511 | encode_op_hdr(xdr, OP_READ, decode_read_maxsz, hdr); | 1516 | encode_op_hdr(xdr, OP_READ, decode_read_maxsz, hdr); |
1512 | encode_open_stateid(xdr, args->context, args->lock_context, | 1517 | encode_open_stateid(xdr, args->context, args->lock_context, |
1513 | hdr->minorversion); | 1518 | FMODE_READ, hdr->minorversion); |
1514 | 1519 | ||
1515 | p = reserve_space(xdr, 12); | 1520 | p = reserve_space(xdr, 12); |
1516 | p = xdr_encode_hyper(p, args->offset); | 1521 | p = xdr_encode_hyper(p, args->offset); |
@@ -1648,7 +1653,7 @@ static void encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *arg | |||
1648 | 1653 | ||
1649 | encode_op_hdr(xdr, OP_WRITE, decode_write_maxsz, hdr); | 1654 | encode_op_hdr(xdr, OP_WRITE, decode_write_maxsz, hdr); |
1650 | encode_open_stateid(xdr, args->context, args->lock_context, | 1655 | encode_open_stateid(xdr, args->context, args->lock_context, |
1651 | hdr->minorversion); | 1656 | FMODE_WRITE, hdr->minorversion); |
1652 | 1657 | ||
1653 | p = reserve_space(xdr, 16); | 1658 | p = reserve_space(xdr, 16); |
1654 | p = xdr_encode_hyper(p, args->offset); | 1659 | p = xdr_encode_hyper(p, args->offset); |