diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 13:48:19 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 15:42:44 -0400 |
commit | 778d28172f710184855bcfeadcdd6b46997c4de2 (patch) | |
tree | d7aaf6c46d3e408f129a6e514d5684c56d860f9d /fs/nfs/nfs4xdr.c | |
parent | 7c317fcfbae773e493ecee1c53738db774b1d0ca (diff) |
NFSv4: Simplify the NFSv4 REMOVE, LINK and RENAME compounds
Get rid of the post-op GETATTR on the directory in order to reduce
the amount of processing done on the server.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 1a70097a8dc7..49483f19c5d3 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -589,38 +589,29 @@ static int nfs4_stat_to_errno(int); | |||
589 | #define NFS4_enc_remove_sz (compound_encode_hdr_maxsz + \ | 589 | #define NFS4_enc_remove_sz (compound_encode_hdr_maxsz + \ |
590 | encode_sequence_maxsz + \ | 590 | encode_sequence_maxsz + \ |
591 | encode_putfh_maxsz + \ | 591 | encode_putfh_maxsz + \ |
592 | encode_remove_maxsz + \ | 592 | encode_remove_maxsz) |
593 | encode_getattr_maxsz) | ||
594 | #define NFS4_dec_remove_sz (compound_decode_hdr_maxsz + \ | 593 | #define NFS4_dec_remove_sz (compound_decode_hdr_maxsz + \ |
595 | decode_sequence_maxsz + \ | 594 | decode_sequence_maxsz + \ |
596 | decode_putfh_maxsz + \ | 595 | decode_putfh_maxsz + \ |
597 | decode_remove_maxsz + \ | 596 | decode_remove_maxsz) |
598 | decode_getattr_maxsz) | ||
599 | #define NFS4_enc_rename_sz (compound_encode_hdr_maxsz + \ | 597 | #define NFS4_enc_rename_sz (compound_encode_hdr_maxsz + \ |
600 | encode_sequence_maxsz + \ | 598 | encode_sequence_maxsz + \ |
601 | encode_putfh_maxsz + \ | 599 | encode_putfh_maxsz + \ |
602 | encode_savefh_maxsz + \ | 600 | encode_savefh_maxsz + \ |
603 | encode_putfh_maxsz + \ | 601 | encode_putfh_maxsz + \ |
604 | encode_rename_maxsz + \ | 602 | encode_rename_maxsz) |
605 | encode_getattr_maxsz + \ | ||
606 | encode_restorefh_maxsz + \ | ||
607 | encode_getattr_maxsz) | ||
608 | #define NFS4_dec_rename_sz (compound_decode_hdr_maxsz + \ | 603 | #define NFS4_dec_rename_sz (compound_decode_hdr_maxsz + \ |
609 | decode_sequence_maxsz + \ | 604 | decode_sequence_maxsz + \ |
610 | decode_putfh_maxsz + \ | 605 | decode_putfh_maxsz + \ |
611 | decode_savefh_maxsz + \ | 606 | decode_savefh_maxsz + \ |
612 | decode_putfh_maxsz + \ | 607 | decode_putfh_maxsz + \ |
613 | decode_rename_maxsz + \ | 608 | decode_rename_maxsz) |
614 | decode_getattr_maxsz + \ | ||
615 | decode_restorefh_maxsz + \ | ||
616 | decode_getattr_maxsz) | ||
617 | #define NFS4_enc_link_sz (compound_encode_hdr_maxsz + \ | 609 | #define NFS4_enc_link_sz (compound_encode_hdr_maxsz + \ |
618 | encode_sequence_maxsz + \ | 610 | encode_sequence_maxsz + \ |
619 | encode_putfh_maxsz + \ | 611 | encode_putfh_maxsz + \ |
620 | encode_savefh_maxsz + \ | 612 | encode_savefh_maxsz + \ |
621 | encode_putfh_maxsz + \ | 613 | encode_putfh_maxsz + \ |
622 | encode_link_maxsz + \ | 614 | encode_link_maxsz + \ |
623 | encode_getattr_maxsz + \ | ||
624 | encode_restorefh_maxsz + \ | 615 | encode_restorefh_maxsz + \ |
625 | encode_getattr_maxsz) | 616 | encode_getattr_maxsz) |
626 | #define NFS4_dec_link_sz (compound_decode_hdr_maxsz + \ | 617 | #define NFS4_dec_link_sz (compound_decode_hdr_maxsz + \ |
@@ -629,7 +620,6 @@ static int nfs4_stat_to_errno(int); | |||
629 | decode_savefh_maxsz + \ | 620 | decode_savefh_maxsz + \ |
630 | decode_putfh_maxsz + \ | 621 | decode_putfh_maxsz + \ |
631 | decode_link_maxsz + \ | 622 | decode_link_maxsz + \ |
632 | decode_getattr_maxsz + \ | ||
633 | decode_restorefh_maxsz + \ | 623 | decode_restorefh_maxsz + \ |
634 | decode_getattr_maxsz) | 624 | decode_getattr_maxsz) |
635 | #define NFS4_enc_symlink_sz (compound_encode_hdr_maxsz + \ | 625 | #define NFS4_enc_symlink_sz (compound_encode_hdr_maxsz + \ |
@@ -2052,7 +2042,6 @@ static void nfs4_xdr_enc_remove(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2052 | encode_sequence(xdr, &args->seq_args, &hdr); | 2042 | encode_sequence(xdr, &args->seq_args, &hdr); |
2053 | encode_putfh(xdr, args->fh, &hdr); | 2043 | encode_putfh(xdr, args->fh, &hdr); |
2054 | encode_remove(xdr, &args->name, &hdr); | 2044 | encode_remove(xdr, &args->name, &hdr); |
2055 | encode_getfattr(xdr, args->bitmask, &hdr); | ||
2056 | encode_nops(&hdr); | 2045 | encode_nops(&hdr); |
2057 | } | 2046 | } |
2058 | 2047 | ||
@@ -2072,9 +2061,6 @@ static void nfs4_xdr_enc_rename(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2072 | encode_savefh(xdr, &hdr); | 2061 | encode_savefh(xdr, &hdr); |
2073 | encode_putfh(xdr, args->new_dir, &hdr); | 2062 | encode_putfh(xdr, args->new_dir, &hdr); |
2074 | encode_rename(xdr, args->old_name, args->new_name, &hdr); | 2063 | encode_rename(xdr, args->old_name, args->new_name, &hdr); |
2075 | encode_getfattr(xdr, args->bitmask, &hdr); | ||
2076 | encode_restorefh(xdr, &hdr); | ||
2077 | encode_getfattr(xdr, args->bitmask, &hdr); | ||
2078 | encode_nops(&hdr); | 2064 | encode_nops(&hdr); |
2079 | } | 2065 | } |
2080 | 2066 | ||
@@ -2094,7 +2080,6 @@ static void nfs4_xdr_enc_link(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2094 | encode_savefh(xdr, &hdr); | 2080 | encode_savefh(xdr, &hdr); |
2095 | encode_putfh(xdr, args->dir_fh, &hdr); | 2081 | encode_putfh(xdr, args->dir_fh, &hdr); |
2096 | encode_link(xdr, args->name, &hdr); | 2082 | encode_link(xdr, args->name, &hdr); |
2097 | encode_getfattr(xdr, args->bitmask, &hdr); | ||
2098 | encode_restorefh(xdr, &hdr); | 2083 | encode_restorefh(xdr, &hdr); |
2099 | encode_getfattr(xdr, args->bitmask, &hdr); | 2084 | encode_getfattr(xdr, args->bitmask, &hdr); |
2100 | encode_nops(&hdr); | 2085 | encode_nops(&hdr); |
@@ -5782,9 +5767,6 @@ static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5782 | if (status) | 5767 | if (status) |
5783 | goto out; | 5768 | goto out; |
5784 | status = decode_remove(xdr, &res->cinfo); | 5769 | status = decode_remove(xdr, &res->cinfo); |
5785 | if (status) | ||
5786 | goto out; | ||
5787 | decode_getfattr(xdr, res->dir_attr, res->server); | ||
5788 | out: | 5770 | out: |
5789 | return status; | 5771 | return status; |
5790 | } | 5772 | } |
@@ -5814,15 +5796,6 @@ static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5814 | if (status) | 5796 | if (status) |
5815 | goto out; | 5797 | goto out; |
5816 | status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo); | 5798 | status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo); |
5817 | if (status) | ||
5818 | goto out; | ||
5819 | /* Current FH is target directory */ | ||
5820 | if (decode_getfattr(xdr, res->new_fattr, res->server)) | ||
5821 | goto out; | ||
5822 | status = decode_restorefh(xdr); | ||
5823 | if (status) | ||
5824 | goto out; | ||
5825 | decode_getfattr(xdr, res->old_fattr, res->server); | ||
5826 | out: | 5799 | out: |
5827 | return status; | 5800 | return status; |
5828 | } | 5801 | } |
@@ -5858,8 +5831,6 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5858 | * Note order: OP_LINK leaves the directory as the current | 5831 | * Note order: OP_LINK leaves the directory as the current |
5859 | * filehandle. | 5832 | * filehandle. |
5860 | */ | 5833 | */ |
5861 | if (decode_getfattr(xdr, res->dir_attr, res->server)) | ||
5862 | goto out; | ||
5863 | status = decode_restorefh(xdr); | 5834 | status = decode_restorefh(xdr); |
5864 | if (status) | 5835 | if (status) |
5865 | goto out; | 5836 | goto out; |