diff options
author | Christoph Hellwig <hch@lst.de> | 2014-09-10 20:36:31 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-12 13:20:54 -0400 |
commit | d4b18c3e00b8d18fbd316abe9639b91ad416e1f3 (patch) | |
tree | bb4e90418ef3aaf994687252d96d6276630dfe20 /fs/nfs/nfs4xdr.c | |
parent | fd41b4748b3b6c1220f926427bf63bef456034a5 (diff) |
pnfs: remove GETDEVICELIST implementation
The current GETDEVICELIST implementation is buggy in that it doesn't handle
cursors correctly, and in that it returns an error if the server returns
NFSERR_NOTSUPP. Given that there is no actual need for GETDEVICELIST,
it has various issues and might get removed for NFSv4.2 stop using it in
the blocklayout driver, and thus the Linux NFS client as whole.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index f2cd957adb90..b8165eab0a32 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -362,17 +362,6 @@ static int nfs4_stat_to_errno(int); | |||
362 | XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) | 362 | XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) |
363 | #define encode_reclaim_complete_maxsz (op_encode_hdr_maxsz + 4) | 363 | #define encode_reclaim_complete_maxsz (op_encode_hdr_maxsz + 4) |
364 | #define decode_reclaim_complete_maxsz (op_decode_hdr_maxsz + 4) | 364 | #define decode_reclaim_complete_maxsz (op_decode_hdr_maxsz + 4) |
365 | #define encode_getdevicelist_maxsz (op_encode_hdr_maxsz + 4 + \ | ||
366 | encode_verifier_maxsz) | ||
367 | #define decode_getdevicelist_maxsz (op_decode_hdr_maxsz + \ | ||
368 | 2 /* nfs_cookie4 gdlr_cookie */ + \ | ||
369 | decode_verifier_maxsz \ | ||
370 | /* verifier4 gdlr_verifier */ + \ | ||
371 | 1 /* gdlr_deviceid_list count */ + \ | ||
372 | XDR_QUADLEN(NFS4_PNFS_GETDEVLIST_MAXNUM * \ | ||
373 | NFS4_DEVICEID4_SIZE) \ | ||
374 | /* gdlr_deviceid_list */ + \ | ||
375 | 1 /* bool gdlr_eof */) | ||
376 | #define encode_getdeviceinfo_maxsz (op_encode_hdr_maxsz + 4 + \ | 365 | #define encode_getdeviceinfo_maxsz (op_encode_hdr_maxsz + 4 + \ |
377 | XDR_QUADLEN(NFS4_DEVICEID4_SIZE)) | 366 | XDR_QUADLEN(NFS4_DEVICEID4_SIZE)) |
378 | #define decode_getdeviceinfo_maxsz (op_decode_hdr_maxsz + \ | 367 | #define decode_getdeviceinfo_maxsz (op_decode_hdr_maxsz + \ |
@@ -812,14 +801,6 @@ static int nfs4_stat_to_errno(int); | |||
812 | #define NFS4_dec_reclaim_complete_sz (compound_decode_hdr_maxsz + \ | 801 | #define NFS4_dec_reclaim_complete_sz (compound_decode_hdr_maxsz + \ |
813 | decode_sequence_maxsz + \ | 802 | decode_sequence_maxsz + \ |
814 | decode_reclaim_complete_maxsz) | 803 | decode_reclaim_complete_maxsz) |
815 | #define NFS4_enc_getdevicelist_sz (compound_encode_hdr_maxsz + \ | ||
816 | encode_sequence_maxsz + \ | ||
817 | encode_putfh_maxsz + \ | ||
818 | encode_getdevicelist_maxsz) | ||
819 | #define NFS4_dec_getdevicelist_sz (compound_decode_hdr_maxsz + \ | ||
820 | decode_sequence_maxsz + \ | ||
821 | decode_putfh_maxsz + \ | ||
822 | decode_getdevicelist_maxsz) | ||
823 | #define NFS4_enc_getdeviceinfo_sz (compound_encode_hdr_maxsz + \ | 804 | #define NFS4_enc_getdeviceinfo_sz (compound_encode_hdr_maxsz + \ |
824 | encode_sequence_maxsz +\ | 805 | encode_sequence_maxsz +\ |
825 | encode_getdeviceinfo_maxsz) | 806 | encode_getdeviceinfo_maxsz) |
@@ -1930,24 +1911,6 @@ static void encode_sequence(struct xdr_stream *xdr, | |||
1930 | 1911 | ||
1931 | #ifdef CONFIG_NFS_V4_1 | 1912 | #ifdef CONFIG_NFS_V4_1 |
1932 | static void | 1913 | static void |
1933 | encode_getdevicelist(struct xdr_stream *xdr, | ||
1934 | const struct nfs4_getdevicelist_args *args, | ||
1935 | struct compound_hdr *hdr) | ||
1936 | { | ||
1937 | __be32 *p; | ||
1938 | nfs4_verifier dummy = { | ||
1939 | .data = "dummmmmy", | ||
1940 | }; | ||
1941 | |||
1942 | encode_op_hdr(xdr, OP_GETDEVICELIST, decode_getdevicelist_maxsz, hdr); | ||
1943 | p = reserve_space(xdr, 16); | ||
1944 | *p++ = cpu_to_be32(args->layoutclass); | ||
1945 | *p++ = cpu_to_be32(NFS4_PNFS_GETDEVLIST_MAXNUM); | ||
1946 | xdr_encode_hyper(p, 0ULL); /* cookie */ | ||
1947 | encode_nfs4_verifier(xdr, &dummy); | ||
1948 | } | ||
1949 | |||
1950 | static void | ||
1951 | encode_getdeviceinfo(struct xdr_stream *xdr, | 1914 | encode_getdeviceinfo(struct xdr_stream *xdr, |
1952 | const struct nfs4_getdeviceinfo_args *args, | 1915 | const struct nfs4_getdeviceinfo_args *args, |
1953 | struct compound_hdr *hdr) | 1916 | struct compound_hdr *hdr) |
@@ -2901,24 +2864,6 @@ static void nfs4_xdr_enc_reclaim_complete(struct rpc_rqst *req, | |||
2901 | } | 2864 | } |
2902 | 2865 | ||
2903 | /* | 2866 | /* |
2904 | * Encode GETDEVICELIST request | ||
2905 | */ | ||
2906 | static void nfs4_xdr_enc_getdevicelist(struct rpc_rqst *req, | ||
2907 | struct xdr_stream *xdr, | ||
2908 | struct nfs4_getdevicelist_args *args) | ||
2909 | { | ||
2910 | struct compound_hdr hdr = { | ||
2911 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | ||
2912 | }; | ||
2913 | |||
2914 | encode_compound_hdr(xdr, req, &hdr); | ||
2915 | encode_sequence(xdr, &args->seq_args, &hdr); | ||
2916 | encode_putfh(xdr, args->fh, &hdr); | ||
2917 | encode_getdevicelist(xdr, args, &hdr); | ||
2918 | encode_nops(&hdr); | ||
2919 | } | ||
2920 | |||
2921 | /* | ||
2922 | * Encode GETDEVICEINFO request | 2867 | * Encode GETDEVICEINFO request |
2923 | */ | 2868 | */ |
2924 | static void nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, | 2869 | static void nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, |
@@ -5773,54 +5718,6 @@ out_overflow: | |||
5773 | } | 5718 | } |
5774 | 5719 | ||
5775 | #if defined(CONFIG_NFS_V4_1) | 5720 | #if defined(CONFIG_NFS_V4_1) |
5776 | /* | ||
5777 | * TODO: Need to handle case when EOF != true; | ||
5778 | */ | ||
5779 | static int decode_getdevicelist(struct xdr_stream *xdr, | ||
5780 | struct pnfs_devicelist *res) | ||
5781 | { | ||
5782 | __be32 *p; | ||
5783 | int status, i; | ||
5784 | nfs4_verifier verftemp; | ||
5785 | |||
5786 | status = decode_op_hdr(xdr, OP_GETDEVICELIST); | ||
5787 | if (status) | ||
5788 | return status; | ||
5789 | |||
5790 | p = xdr_inline_decode(xdr, 8 + 8 + 4); | ||
5791 | if (unlikely(!p)) | ||
5792 | goto out_overflow; | ||
5793 | |||
5794 | /* TODO: Skip cookie for now */ | ||
5795 | p += 2; | ||
5796 | |||
5797 | /* Read verifier */ | ||
5798 | p = xdr_decode_opaque_fixed(p, verftemp.data, NFS4_VERIFIER_SIZE); | ||
5799 | |||
5800 | res->num_devs = be32_to_cpup(p); | ||
5801 | |||
5802 | dprintk("%s: num_dev %d\n", __func__, res->num_devs); | ||
5803 | |||
5804 | if (res->num_devs > NFS4_PNFS_GETDEVLIST_MAXNUM) { | ||
5805 | printk(KERN_ERR "NFS: %s too many result dev_num %u\n", | ||
5806 | __func__, res->num_devs); | ||
5807 | return -EIO; | ||
5808 | } | ||
5809 | |||
5810 | p = xdr_inline_decode(xdr, | ||
5811 | res->num_devs * NFS4_DEVICEID4_SIZE + 4); | ||
5812 | if (unlikely(!p)) | ||
5813 | goto out_overflow; | ||
5814 | for (i = 0; i < res->num_devs; i++) | ||
5815 | p = xdr_decode_opaque_fixed(p, res->dev_id[i].data, | ||
5816 | NFS4_DEVICEID4_SIZE); | ||
5817 | res->eof = be32_to_cpup(p); | ||
5818 | return 0; | ||
5819 | out_overflow: | ||
5820 | print_overflow_msg(__func__, xdr); | ||
5821 | return -EIO; | ||
5822 | } | ||
5823 | |||
5824 | static int decode_getdeviceinfo(struct xdr_stream *xdr, | 5721 | static int decode_getdeviceinfo(struct xdr_stream *xdr, |
5825 | struct pnfs_device *pdev) | 5722 | struct pnfs_device *pdev) |
5826 | { | 5723 | { |
@@ -7105,32 +7002,6 @@ static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp, | |||
7105 | } | 7002 | } |
7106 | 7003 | ||
7107 | /* | 7004 | /* |
7108 | * Decode GETDEVICELIST response | ||
7109 | */ | ||
7110 | static int nfs4_xdr_dec_getdevicelist(struct rpc_rqst *rqstp, | ||
7111 | struct xdr_stream *xdr, | ||
7112 | struct nfs4_getdevicelist_res *res) | ||
7113 | { | ||
7114 | struct compound_hdr hdr; | ||
7115 | int status; | ||
7116 | |||
7117 | dprintk("encoding getdevicelist!\n"); | ||
7118 | |||
7119 | status = decode_compound_hdr(xdr, &hdr); | ||
7120 | if (status != 0) | ||
7121 | goto out; | ||
7122 | status = decode_sequence(xdr, &res->seq_res, rqstp); | ||
7123 | if (status != 0) | ||
7124 | goto out; | ||
7125 | status = decode_putfh(xdr); | ||
7126 | if (status != 0) | ||
7127 | goto out; | ||
7128 | status = decode_getdevicelist(xdr, res->devlist); | ||
7129 | out: | ||
7130 | return status; | ||
7131 | } | ||
7132 | |||
7133 | /* | ||
7134 | * Decode GETDEVINFO response | 7005 | * Decode GETDEVINFO response |
7135 | */ | 7006 | */ |
7136 | static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp, | 7007 | static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp, |
@@ -7498,7 +7369,6 @@ struct rpc_procinfo nfs4_procedures[] = { | |||
7498 | PROC(SECINFO_NO_NAME, enc_secinfo_no_name, dec_secinfo_no_name), | 7369 | PROC(SECINFO_NO_NAME, enc_secinfo_no_name, dec_secinfo_no_name), |
7499 | PROC(TEST_STATEID, enc_test_stateid, dec_test_stateid), | 7370 | PROC(TEST_STATEID, enc_test_stateid, dec_test_stateid), |
7500 | PROC(FREE_STATEID, enc_free_stateid, dec_free_stateid), | 7371 | PROC(FREE_STATEID, enc_free_stateid, dec_free_stateid), |
7501 | PROC(GETDEVICELIST, enc_getdevicelist, dec_getdevicelist), | ||
7502 | PROC(BIND_CONN_TO_SESSION, | 7372 | PROC(BIND_CONN_TO_SESSION, |
7503 | enc_bind_conn_to_session, dec_bind_conn_to_session), | 7373 | enc_bind_conn_to_session, dec_bind_conn_to_session), |
7504 | PROC(DESTROY_CLIENTID, enc_destroy_clientid, dec_destroy_clientid), | 7374 | PROC(DESTROY_CLIENTID, enc_destroy_clientid, dec_destroy_clientid), |