diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-12-14 09:56:52 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-16 12:37:23 -0500 |
commit | b2cdd9c9c95e0e389a8b75fe25f266fc5267bbb6 (patch) | |
tree | b20565d1e8a0ed9f4612a4c7b58c583f04f1d760 /fs/nfs/nfs3xdr.c | |
parent | f5fc3c50c99a7df2bf908dfe66f112d35178ee07 (diff) |
NFS: Remove unused old NFSv3 decoder functions
Clean up. Remove unused legacy result decoder functions, and any
now unused decoder helper functions.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3xdr.c')
-rw-r--r-- | fs/nfs/nfs3xdr.c | 512 |
1 files changed, 4 insertions, 508 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 19c791101928..586587f42fc9 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -129,38 +129,6 @@ static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) | |||
129 | /* | 129 | /* |
130 | * Common NFS XDR functions as inlines | 130 | * Common NFS XDR functions as inlines |
131 | */ | 131 | */ |
132 | static inline __be32 * | ||
133 | xdr_decode_fhandle(__be32 *p, struct nfs_fh *fh) | ||
134 | { | ||
135 | if ((fh->size = ntohl(*p++)) <= NFS3_FHSIZE) { | ||
136 | memcpy(fh->data, p, fh->size); | ||
137 | return p + XDR_QUADLEN(fh->size); | ||
138 | } | ||
139 | return NULL; | ||
140 | } | ||
141 | |||
142 | static inline __be32 * | ||
143 | xdr_decode_fhandle_stream(struct xdr_stream *xdr, struct nfs_fh *fh) | ||
144 | { | ||
145 | __be32 *p; | ||
146 | p = xdr_inline_decode(xdr, 4); | ||
147 | if (unlikely(!p)) | ||
148 | goto out_overflow; | ||
149 | fh->size = ntohl(*p++); | ||
150 | |||
151 | if (fh->size <= NFS3_FHSIZE) { | ||
152 | p = xdr_inline_decode(xdr, fh->size); | ||
153 | if (unlikely(!p)) | ||
154 | goto out_overflow; | ||
155 | memcpy(fh->data, p, fh->size); | ||
156 | return p + XDR_QUADLEN(fh->size); | ||
157 | } | ||
158 | return NULL; | ||
159 | |||
160 | out_overflow: | ||
161 | print_overflow_msg(__func__, xdr); | ||
162 | return ERR_PTR(-EIO); | ||
163 | } | ||
164 | 132 | ||
165 | /* | 133 | /* |
166 | * Encode/decode time. | 134 | * Encode/decode time. |
@@ -221,51 +189,6 @@ xdr_decode_wcc_attr(__be32 *p, struct nfs_fattr *fattr) | |||
221 | return p; | 189 | return p; |
222 | } | 190 | } |
223 | 191 | ||
224 | static inline __be32 * | ||
225 | xdr_decode_post_op_attr(__be32 *p, struct nfs_fattr *fattr) | ||
226 | { | ||
227 | if (*p++) | ||
228 | p = xdr_decode_fattr(p, fattr); | ||
229 | return p; | ||
230 | } | ||
231 | |||
232 | static inline __be32 * | ||
233 | xdr_decode_post_op_attr_stream(struct xdr_stream *xdr, struct nfs_fattr *fattr) | ||
234 | { | ||
235 | __be32 *p; | ||
236 | |||
237 | p = xdr_inline_decode(xdr, 4); | ||
238 | if (unlikely(!p)) | ||
239 | goto out_overflow; | ||
240 | if (ntohl(*p++)) { | ||
241 | p = xdr_inline_decode(xdr, 84); | ||
242 | if (unlikely(!p)) | ||
243 | goto out_overflow; | ||
244 | p = xdr_decode_fattr(p, fattr); | ||
245 | } | ||
246 | return p; | ||
247 | out_overflow: | ||
248 | print_overflow_msg(__func__, xdr); | ||
249 | return ERR_PTR(-EIO); | ||
250 | } | ||
251 | |||
252 | static inline __be32 * | ||
253 | xdr_decode_pre_op_attr(__be32 *p, struct nfs_fattr *fattr) | ||
254 | { | ||
255 | if (*p++) | ||
256 | return xdr_decode_wcc_attr(p, fattr); | ||
257 | return p; | ||
258 | } | ||
259 | |||
260 | |||
261 | static inline __be32 * | ||
262 | xdr_decode_wcc_data(__be32 *p, struct nfs_fattr *fattr) | ||
263 | { | ||
264 | p = xdr_decode_pre_op_attr(p, fattr); | ||
265 | return xdr_decode_post_op_attr(p, fattr); | ||
266 | } | ||
267 | |||
268 | |||
269 | /* | 192 | /* |
270 | * Encode/decode NFSv3 basic data types | 193 | * Encode/decode NFSv3 basic data types |
271 | * | 194 | * |
@@ -1404,52 +1327,6 @@ static int nfs3_xdr_enc_readdirplus3args(struct rpc_rqst *req, __be32 *p, | |||
1404 | } | 1327 | } |
1405 | 1328 | ||
1406 | /* | 1329 | /* |
1407 | * Decode the result of a readdir call. | ||
1408 | * We just check for syntactical correctness. | ||
1409 | */ | ||
1410 | static int | ||
1411 | nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res) | ||
1412 | { | ||
1413 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | ||
1414 | struct kvec *iov = rcvbuf->head; | ||
1415 | struct page **page; | ||
1416 | size_t hdrlen; | ||
1417 | u32 recvd, pglen; | ||
1418 | int status; | ||
1419 | |||
1420 | status = ntohl(*p++); | ||
1421 | /* Decode post_op_attrs */ | ||
1422 | p = xdr_decode_post_op_attr(p, res->dir_attr); | ||
1423 | if (status) | ||
1424 | return nfs_stat_to_errno(status); | ||
1425 | /* Decode verifier cookie */ | ||
1426 | if (res->verf) { | ||
1427 | res->verf[0] = *p++; | ||
1428 | res->verf[1] = *p++; | ||
1429 | } else { | ||
1430 | p += 2; | ||
1431 | } | ||
1432 | |||
1433 | hdrlen = (u8 *) p - (u8 *) iov->iov_base; | ||
1434 | if (iov->iov_len < hdrlen) { | ||
1435 | dprintk("NFS: READDIR reply header overflowed:" | ||
1436 | "length %Zu > %Zu\n", hdrlen, iov->iov_len); | ||
1437 | return -errno_NFSERR_IO; | ||
1438 | } else if (iov->iov_len != hdrlen) { | ||
1439 | dprintk("NFS: READDIR header is short. iovec will be shifted.\n"); | ||
1440 | xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen); | ||
1441 | } | ||
1442 | |||
1443 | pglen = rcvbuf->page_len; | ||
1444 | recvd = rcvbuf->len - hdrlen; | ||
1445 | if (pglen > recvd) | ||
1446 | pglen = recvd; | ||
1447 | page = rcvbuf->pages; | ||
1448 | |||
1449 | return pglen; | ||
1450 | } | ||
1451 | |||
1452 | /* | ||
1453 | * 3.3.21 COMMIT3args | 1330 | * 3.3.21 COMMIT3args |
1454 | * | 1331 | * |
1455 | * struct COMMIT3args { | 1332 | * struct COMMIT3args { |
@@ -1526,22 +1403,11 @@ static int nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, __be32 *p, | |||
1526 | #endif /* CONFIG_NFS_V3_ACL */ | 1403 | #endif /* CONFIG_NFS_V3_ACL */ |
1527 | 1404 | ||
1528 | /* | 1405 | /* |
1529 | * NFS XDR decode functions | 1406 | * NFSv3 XDR decode functions |
1530 | */ | 1407 | * |
1531 | 1408 | * NFSv3 result types are defined in section 3.3 of RFC 1813: | |
1532 | /* | 1409 | * "NFS Version 3 Protocol Specification". |
1533 | * Decode attrstat reply. | ||
1534 | */ | 1410 | */ |
1535 | static int | ||
1536 | nfs3_xdr_attrstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) | ||
1537 | { | ||
1538 | int status; | ||
1539 | |||
1540 | if ((status = ntohl(*p++))) | ||
1541 | return nfs_stat_to_errno(status); | ||
1542 | xdr_decode_fattr(p, fattr); | ||
1543 | return 0; | ||
1544 | } | ||
1545 | 1411 | ||
1546 | /* | 1412 | /* |
1547 | * 3.3.1 GETATTR3res | 1413 | * 3.3.1 GETATTR3res |
@@ -1578,21 +1444,6 @@ out_default: | |||
1578 | } | 1444 | } |
1579 | 1445 | ||
1580 | /* | 1446 | /* |
1581 | * Decode status+wcc_data reply | ||
1582 | * SATTR, REMOVE, RMDIR | ||
1583 | */ | ||
1584 | static int | ||
1585 | nfs3_xdr_wccstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) | ||
1586 | { | ||
1587 | int status; | ||
1588 | |||
1589 | if ((status = ntohl(*p++))) | ||
1590 | status = nfs_stat_to_errno(status); | ||
1591 | xdr_decode_wcc_data(p, fattr); | ||
1592 | return status; | ||
1593 | } | ||
1594 | |||
1595 | /* | ||
1596 | * 3.3.2 SETATTR3res | 1447 | * 3.3.2 SETATTR3res |
1597 | * | 1448 | * |
1598 | * struct SETATTR3resok { | 1449 | * struct SETATTR3resok { |
@@ -1632,31 +1483,6 @@ out_status: | |||
1632 | return nfs_stat_to_errno(status); | 1483 | return nfs_stat_to_errno(status); |
1633 | } | 1484 | } |
1634 | 1485 | ||
1635 | static int | ||
1636 | nfs3_xdr_removeres(struct rpc_rqst *req, __be32 *p, struct nfs_removeres *res) | ||
1637 | { | ||
1638 | return nfs3_xdr_wccstat(req, p, res->dir_attr); | ||
1639 | } | ||
1640 | |||
1641 | /* | ||
1642 | * Decode LOOKUP reply | ||
1643 | */ | ||
1644 | static int | ||
1645 | nfs3_xdr_lookupres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res) | ||
1646 | { | ||
1647 | int status; | ||
1648 | |||
1649 | if ((status = ntohl(*p++))) { | ||
1650 | status = nfs_stat_to_errno(status); | ||
1651 | } else { | ||
1652 | if (!(p = xdr_decode_fhandle(p, res->fh))) | ||
1653 | return -errno_NFSERR_IO; | ||
1654 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
1655 | } | ||
1656 | xdr_decode_post_op_attr(p, res->dir_attr); | ||
1657 | return status; | ||
1658 | } | ||
1659 | |||
1660 | /* | 1486 | /* |
1661 | * 3.3.3 LOOKUP3res | 1487 | * 3.3.3 LOOKUP3res |
1662 | * | 1488 | * |
@@ -1707,21 +1533,6 @@ out_default: | |||
1707 | } | 1533 | } |
1708 | 1534 | ||
1709 | /* | 1535 | /* |
1710 | * Decode ACCESS reply | ||
1711 | */ | ||
1712 | static int | ||
1713 | nfs3_xdr_accessres(struct rpc_rqst *req, __be32 *p, struct nfs3_accessres *res) | ||
1714 | { | ||
1715 | int status = ntohl(*p++); | ||
1716 | |||
1717 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
1718 | if (status) | ||
1719 | return nfs_stat_to_errno(status); | ||
1720 | res->access = ntohl(*p++); | ||
1721 | return 0; | ||
1722 | } | ||
1723 | |||
1724 | /* | ||
1725 | * 3.3.4 ACCESS3res | 1536 | * 3.3.4 ACCESS3res |
1726 | * | 1537 | * |
1727 | * struct ACCESS3resok { | 1538 | * struct ACCESS3resok { |
@@ -1764,52 +1575,6 @@ out_default: | |||
1764 | } | 1575 | } |
1765 | 1576 | ||
1766 | /* | 1577 | /* |
1767 | * Decode READLINK reply | ||
1768 | */ | ||
1769 | static int | ||
1770 | nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) | ||
1771 | { | ||
1772 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | ||
1773 | struct kvec *iov = rcvbuf->head; | ||
1774 | size_t hdrlen; | ||
1775 | u32 len, recvd; | ||
1776 | int status; | ||
1777 | |||
1778 | status = ntohl(*p++); | ||
1779 | p = xdr_decode_post_op_attr(p, fattr); | ||
1780 | |||
1781 | if (status != 0) | ||
1782 | return nfs_stat_to_errno(status); | ||
1783 | |||
1784 | /* Convert length of symlink */ | ||
1785 | len = ntohl(*p++); | ||
1786 | if (len >= rcvbuf->page_len) { | ||
1787 | dprintk("nfs: server returned giant symlink!\n"); | ||
1788 | return -ENAMETOOLONG; | ||
1789 | } | ||
1790 | |||
1791 | hdrlen = (u8 *) p - (u8 *) iov->iov_base; | ||
1792 | if (iov->iov_len < hdrlen) { | ||
1793 | dprintk("NFS: READLINK reply header overflowed:" | ||
1794 | "length %Zu > %Zu\n", hdrlen, iov->iov_len); | ||
1795 | return -errno_NFSERR_IO; | ||
1796 | } else if (iov->iov_len != hdrlen) { | ||
1797 | dprintk("NFS: READLINK header is short. " | ||
1798 | "iovec will be shifted.\n"); | ||
1799 | xdr_shift_buf(rcvbuf, iov->iov_len - hdrlen); | ||
1800 | } | ||
1801 | recvd = req->rq_rcv_buf.len - hdrlen; | ||
1802 | if (recvd < len) { | ||
1803 | dprintk("NFS: server cheating in readlink reply: " | ||
1804 | "count %u > recvd %u\n", len, recvd); | ||
1805 | return -EIO; | ||
1806 | } | ||
1807 | |||
1808 | xdr_terminate_string(rcvbuf, len); | ||
1809 | return 0; | ||
1810 | } | ||
1811 | |||
1812 | /* | ||
1813 | * 3.3.5 READLINK3res | 1578 | * 3.3.5 READLINK3res |
1814 | * | 1579 | * |
1815 | * struct READLINK3resok { | 1580 | * struct READLINK3resok { |
@@ -1852,59 +1617,6 @@ out_default: | |||
1852 | } | 1617 | } |
1853 | 1618 | ||
1854 | /* | 1619 | /* |
1855 | * Decode READ reply | ||
1856 | */ | ||
1857 | static int | ||
1858 | nfs3_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res) | ||
1859 | { | ||
1860 | struct kvec *iov = req->rq_rcv_buf.head; | ||
1861 | size_t hdrlen; | ||
1862 | u32 count, ocount, recvd; | ||
1863 | int status; | ||
1864 | |||
1865 | status = ntohl(*p++); | ||
1866 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
1867 | |||
1868 | if (status != 0) | ||
1869 | return nfs_stat_to_errno(status); | ||
1870 | |||
1871 | /* Decode reply count and EOF flag. NFSv3 is somewhat redundant | ||
1872 | * in that it puts the count both in the res struct and in the | ||
1873 | * opaque data count. */ | ||
1874 | count = ntohl(*p++); | ||
1875 | res->eof = ntohl(*p++); | ||
1876 | ocount = ntohl(*p++); | ||
1877 | |||
1878 | if (ocount != count) { | ||
1879 | dprintk("NFS: READ count doesn't match RPC opaque count.\n"); | ||
1880 | return -errno_NFSERR_IO; | ||
1881 | } | ||
1882 | |||
1883 | hdrlen = (u8 *) p - (u8 *) iov->iov_base; | ||
1884 | if (iov->iov_len < hdrlen) { | ||
1885 | dprintk("NFS: READ reply header overflowed:" | ||
1886 | "length %Zu > %Zu\n", hdrlen, iov->iov_len); | ||
1887 | return -errno_NFSERR_IO; | ||
1888 | } else if (iov->iov_len != hdrlen) { | ||
1889 | dprintk("NFS: READ header is short. iovec will be shifted.\n"); | ||
1890 | xdr_shift_buf(&req->rq_rcv_buf, iov->iov_len - hdrlen); | ||
1891 | } | ||
1892 | |||
1893 | recvd = req->rq_rcv_buf.len - hdrlen; | ||
1894 | if (count > recvd) { | ||
1895 | dprintk("NFS: server cheating in read reply: " | ||
1896 | "count %u > recvd %u\n", count, recvd); | ||
1897 | count = recvd; | ||
1898 | res->eof = 0; | ||
1899 | } | ||
1900 | |||
1901 | if (count < res->count) | ||
1902 | res->count = count; | ||
1903 | |||
1904 | return count; | ||
1905 | } | ||
1906 | |||
1907 | /* | ||
1908 | * 3.3.6 READ3res | 1620 | * 3.3.6 READ3res |
1909 | * | 1621 | * |
1910 | * struct READ3resok { | 1622 | * struct READ3resok { |
@@ -1989,28 +1701,6 @@ out_status: | |||
1989 | } | 1701 | } |
1990 | 1702 | ||
1991 | /* | 1703 | /* |
1992 | * Decode WRITE response | ||
1993 | */ | ||
1994 | static int | ||
1995 | nfs3_xdr_writeres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res) | ||
1996 | { | ||
1997 | int status; | ||
1998 | |||
1999 | status = ntohl(*p++); | ||
2000 | p = xdr_decode_wcc_data(p, res->fattr); | ||
2001 | |||
2002 | if (status != 0) | ||
2003 | return nfs_stat_to_errno(status); | ||
2004 | |||
2005 | res->count = ntohl(*p++); | ||
2006 | res->verf->committed = (enum nfs3_stable_how)ntohl(*p++); | ||
2007 | res->verf->verifier[0] = *p++; | ||
2008 | res->verf->verifier[1] = *p++; | ||
2009 | |||
2010 | return res->count; | ||
2011 | } | ||
2012 | |||
2013 | /* | ||
2014 | * 3.3.7 WRITE3res | 1704 | * 3.3.7 WRITE3res |
2015 | * | 1705 | * |
2016 | * enum stable_how { | 1706 | * enum stable_how { |
@@ -2083,33 +1773,6 @@ out_status: | |||
2083 | } | 1773 | } |
2084 | 1774 | ||
2085 | /* | 1775 | /* |
2086 | * Decode a CREATE response | ||
2087 | */ | ||
2088 | static int | ||
2089 | nfs3_xdr_createres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res) | ||
2090 | { | ||
2091 | int status; | ||
2092 | |||
2093 | status = ntohl(*p++); | ||
2094 | if (status == 0) { | ||
2095 | if (*p++) { | ||
2096 | if (!(p = xdr_decode_fhandle(p, res->fh))) | ||
2097 | return -errno_NFSERR_IO; | ||
2098 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2099 | } else { | ||
2100 | memset(res->fh, 0, sizeof(*res->fh)); | ||
2101 | /* Do decode post_op_attr but set it to NULL */ | ||
2102 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2103 | res->fattr->valid = 0; | ||
2104 | } | ||
2105 | } else { | ||
2106 | status = nfs_stat_to_errno(status); | ||
2107 | } | ||
2108 | p = xdr_decode_wcc_data(p, res->dir_attr); | ||
2109 | return status; | ||
2110 | } | ||
2111 | |||
2112 | /* | ||
2113 | * 3.3.8 CREATE3res | 1776 | * 3.3.8 CREATE3res |
2114 | * | 1777 | * |
2115 | * struct CREATE3resok { | 1778 | * struct CREATE3resok { |
@@ -2215,21 +1878,6 @@ out_status: | |||
2215 | } | 1878 | } |
2216 | 1879 | ||
2217 | /* | 1880 | /* |
2218 | * Decode RENAME reply | ||
2219 | */ | ||
2220 | static int | ||
2221 | nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs_renameres *res) | ||
2222 | { | ||
2223 | int status; | ||
2224 | |||
2225 | if ((status = ntohl(*p++)) != 0) | ||
2226 | status = nfs_stat_to_errno(status); | ||
2227 | p = xdr_decode_wcc_data(p, res->old_fattr); | ||
2228 | p = xdr_decode_wcc_data(p, res->new_fattr); | ||
2229 | return status; | ||
2230 | } | ||
2231 | |||
2232 | /* | ||
2233 | * 3.3.14 RENAME3res | 1881 | * 3.3.14 RENAME3res |
2234 | * | 1882 | * |
2235 | * struct RENAME3resok { | 1883 | * struct RENAME3resok { |
@@ -2275,21 +1923,6 @@ out_status: | |||
2275 | } | 1923 | } |
2276 | 1924 | ||
2277 | /* | 1925 | /* |
2278 | * Decode LINK reply | ||
2279 | */ | ||
2280 | static int | ||
2281 | nfs3_xdr_linkres(struct rpc_rqst *req, __be32 *p, struct nfs3_linkres *res) | ||
2282 | { | ||
2283 | int status; | ||
2284 | |||
2285 | if ((status = ntohl(*p++)) != 0) | ||
2286 | status = nfs_stat_to_errno(status); | ||
2287 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2288 | p = xdr_decode_wcc_data(p, res->dir_attr); | ||
2289 | return status; | ||
2290 | } | ||
2291 | |||
2292 | /* | ||
2293 | * 3.3.15 LINK3res | 1926 | * 3.3.15 LINK3res |
2294 | * | 1927 | * |
2295 | * struct LINK3resok { | 1928 | * struct LINK3resok { |
@@ -2533,31 +2166,6 @@ out_default: | |||
2533 | } | 2166 | } |
2534 | 2167 | ||
2535 | /* | 2168 | /* |
2536 | * Decode FSSTAT reply | ||
2537 | */ | ||
2538 | static int | ||
2539 | nfs3_xdr_fsstatres(struct rpc_rqst *req, __be32 *p, struct nfs_fsstat *res) | ||
2540 | { | ||
2541 | int status; | ||
2542 | |||
2543 | status = ntohl(*p++); | ||
2544 | |||
2545 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2546 | if (status != 0) | ||
2547 | return nfs_stat_to_errno(status); | ||
2548 | |||
2549 | p = xdr_decode_hyper(p, &res->tbytes); | ||
2550 | p = xdr_decode_hyper(p, &res->fbytes); | ||
2551 | p = xdr_decode_hyper(p, &res->abytes); | ||
2552 | p = xdr_decode_hyper(p, &res->tfiles); | ||
2553 | p = xdr_decode_hyper(p, &res->ffiles); | ||
2554 | p = xdr_decode_hyper(p, &res->afiles); | ||
2555 | |||
2556 | /* ignore invarsec */ | ||
2557 | return 0; | ||
2558 | } | ||
2559 | |||
2560 | /* | ||
2561 | * 3.3.18 FSSTAT3res | 2169 | * 3.3.18 FSSTAT3res |
2562 | * | 2170 | * |
2563 | * struct FSSTAT3resok { | 2171 | * struct FSSTAT3resok { |
@@ -2627,35 +2235,6 @@ out_status: | |||
2627 | } | 2235 | } |
2628 | 2236 | ||
2629 | /* | 2237 | /* |
2630 | * Decode FSINFO reply | ||
2631 | */ | ||
2632 | static int | ||
2633 | nfs3_xdr_fsinfores(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *res) | ||
2634 | { | ||
2635 | int status; | ||
2636 | |||
2637 | status = ntohl(*p++); | ||
2638 | |||
2639 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2640 | if (status != 0) | ||
2641 | return nfs_stat_to_errno(status); | ||
2642 | |||
2643 | res->rtmax = ntohl(*p++); | ||
2644 | res->rtpref = ntohl(*p++); | ||
2645 | res->rtmult = ntohl(*p++); | ||
2646 | res->wtmax = ntohl(*p++); | ||
2647 | res->wtpref = ntohl(*p++); | ||
2648 | res->wtmult = ntohl(*p++); | ||
2649 | res->dtpref = ntohl(*p++); | ||
2650 | p = xdr_decode_hyper(p, &res->maxfilesize); | ||
2651 | p = xdr_decode_time3(p, &res->time_delta); | ||
2652 | |||
2653 | /* ignore properties */ | ||
2654 | res->lease_time = 0; | ||
2655 | return 0; | ||
2656 | } | ||
2657 | |||
2658 | /* | ||
2659 | * 3.3.19 FSINFO3res | 2238 | * 3.3.19 FSINFO3res |
2660 | * | 2239 | * |
2661 | * struct FSINFO3resok { | 2240 | * struct FSINFO3resok { |
@@ -2733,26 +2312,6 @@ out_status: | |||
2733 | } | 2312 | } |
2734 | 2313 | ||
2735 | /* | 2314 | /* |
2736 | * Decode PATHCONF reply | ||
2737 | */ | ||
2738 | static int | ||
2739 | nfs3_xdr_pathconfres(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *res) | ||
2740 | { | ||
2741 | int status; | ||
2742 | |||
2743 | status = ntohl(*p++); | ||
2744 | |||
2745 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2746 | if (status != 0) | ||
2747 | return nfs_stat_to_errno(status); | ||
2748 | res->max_link = ntohl(*p++); | ||
2749 | res->max_namelen = ntohl(*p++); | ||
2750 | |||
2751 | /* ignore remaining fields */ | ||
2752 | return 0; | ||
2753 | } | ||
2754 | |||
2755 | /* | ||
2756 | * 3.3.20 PATHCONF3res | 2315 | * 3.3.20 PATHCONF3res |
2757 | * | 2316 | * |
2758 | * struct PATHCONF3resok { | 2317 | * struct PATHCONF3resok { |
@@ -2817,24 +2376,6 @@ out_status: | |||
2817 | } | 2376 | } |
2818 | 2377 | ||
2819 | /* | 2378 | /* |
2820 | * Decode COMMIT reply | ||
2821 | */ | ||
2822 | static int | ||
2823 | nfs3_xdr_commitres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res) | ||
2824 | { | ||
2825 | int status; | ||
2826 | |||
2827 | status = ntohl(*p++); | ||
2828 | p = xdr_decode_wcc_data(p, res->fattr); | ||
2829 | if (status != 0) | ||
2830 | return nfs_stat_to_errno(status); | ||
2831 | |||
2832 | res->verf->verifier[0] = *p++; | ||
2833 | res->verf->verifier[1] = *p++; | ||
2834 | return 0; | ||
2835 | } | ||
2836 | |||
2837 | /* | ||
2838 | * 3.3.21 COMMIT3res | 2379 | * 3.3.21 COMMIT3res |
2839 | * | 2380 | * |
2840 | * struct COMMIT3resok { | 2381 | * struct COMMIT3resok { |
@@ -2877,37 +2418,6 @@ out_status: | |||
2877 | } | 2418 | } |
2878 | 2419 | ||
2879 | #ifdef CONFIG_NFS_V3_ACL | 2420 | #ifdef CONFIG_NFS_V3_ACL |
2880 | /* | ||
2881 | * Decode GETACL reply | ||
2882 | */ | ||
2883 | static int | ||
2884 | nfs3_xdr_getaclres(struct rpc_rqst *req, __be32 *p, | ||
2885 | struct nfs3_getaclres *res) | ||
2886 | { | ||
2887 | struct xdr_buf *buf = &req->rq_rcv_buf; | ||
2888 | int status = ntohl(*p++); | ||
2889 | struct posix_acl **acl; | ||
2890 | unsigned int *aclcnt; | ||
2891 | int err, base; | ||
2892 | |||
2893 | if (status != 0) | ||
2894 | return nfs_stat_to_errno(status); | ||
2895 | p = xdr_decode_post_op_attr(p, res->fattr); | ||
2896 | res->mask = ntohl(*p++); | ||
2897 | if (res->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) | ||
2898 | return -EINVAL; | ||
2899 | base = (char *)p - (char *)req->rq_rcv_buf.head->iov_base; | ||
2900 | |||
2901 | acl = (res->mask & NFS_ACL) ? &res->acl_access : NULL; | ||
2902 | aclcnt = (res->mask & NFS_ACLCNT) ? &res->acl_access_count : NULL; | ||
2903 | err = nfsacl_decode(buf, base, aclcnt, acl); | ||
2904 | |||
2905 | acl = (res->mask & NFS_DFACL) ? &res->acl_default : NULL; | ||
2906 | aclcnt = (res->mask & NFS_DFACLCNT) ? &res->acl_default_count : NULL; | ||
2907 | if (err > 0) | ||
2908 | err = nfsacl_decode(buf, base + err, aclcnt, acl); | ||
2909 | return (err > 0) ? 0 : err; | ||
2910 | } | ||
2911 | 2421 | ||
2912 | static inline int decode_getacl3resok(struct xdr_stream *xdr, | 2422 | static inline int decode_getacl3resok(struct xdr_stream *xdr, |
2913 | struct nfs3_getaclres *result) | 2423 | struct nfs3_getaclres *result) |
@@ -2973,20 +2483,6 @@ out_default: | |||
2973 | return nfs_stat_to_errno(status); | 2483 | return nfs_stat_to_errno(status); |
2974 | } | 2484 | } |
2975 | 2485 | ||
2976 | /* | ||
2977 | * Decode setacl reply. | ||
2978 | */ | ||
2979 | static int | ||
2980 | nfs3_xdr_setaclres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) | ||
2981 | { | ||
2982 | int status = ntohl(*p++); | ||
2983 | |||
2984 | if (status) | ||
2985 | return nfs_stat_to_errno(status); | ||
2986 | xdr_decode_post_op_attr(p, fattr); | ||
2987 | return 0; | ||
2988 | } | ||
2989 | |||
2990 | static int nfs3_xdr_dec_setacl3res(struct rpc_rqst *req, __be32 *p, | 2486 | static int nfs3_xdr_dec_setacl3res(struct rpc_rqst *req, __be32 *p, |
2991 | struct nfs_fattr *result) | 2487 | struct nfs_fattr *result) |
2992 | { | 2488 | { |