@@ -51,14 +51,14 @@
* u32 odm_raid_algorithm;
* };
*/
-static int pnfs_osd_xdr_encode_data_map(
+static enum nfsstat4 pnfs_osd_xdr_encode_data_map(
struct exp_xdr_stream *xdr,
struct pnfs_osd_data_map *data_map)
{
__be32 *p = exp_xdr_reserve_qwords(xdr, 1+2+1+1+1+1);
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
p = exp_xdr_encode_u32(p, data_map->odm_num_comps);
p = exp_xdr_encode_u64(p, data_map->odm_stripe_unit);
@@ -77,7 +77,7 @@ static int pnfs_osd_xdr_encode_data_map(
* u64 oid_object_id;
* };
*/
-static inline int pnfs_osd_xdr_encode_objid(
+static inline enum nfsstat4 pnfs_osd_xdr_encode_objid(
struct exp_xdr_stream *xdr,
struct pnfs_osd_objid *object_id)
{
@@ -86,7 +86,7 @@ static inline int pnfs_osd_xdr_encode_objid(
(struct nfsd4_pnfs_deviceid *)&object_id->oid_device_id;
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
p = exp_xdr_encode_u64(p, dev_id->fsid);
p = exp_xdr_encode_u64(p, dev_id->devid);
@@ -110,12 +110,12 @@ static inline int pnfs_osd_xdr_encode_objid(
* struct pnfs_osd_opaque_cred oc_cap;
* };
*/
-int pnfs_osd_xdr_encode_layout_cred(
+enum nfsstat4 pnfs_osd_xdr_encode_layout_cred(
struct exp_xdr_stream *xdr,
struct pnfs_osd_object_cred *olo_comp)
{
__be32 *p;
- int err;
+ enum nfsstat4 err;
err = pnfs_osd_xdr_encode_objid(xdr, &olo_comp->oc_object_id);
if (err)
@@ -123,7 +123,7 @@ int pnfs_osd_xdr_encode_layout_cred(
p = exp_xdr_reserve_space(xdr, 3*4 + 4+olo_comp->oc_cap.cred_len);
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
p = exp_xdr_encode_u32(p, olo_comp->oc_osd_version);
@@ -146,12 +146,12 @@ EXPORT_SYMBOL(pnfs_osd_xdr_encode_layout_cred);
* struct pnfs_osd_object_cred *olo_comps;
* };
*/
-int pnfs_osd_xdr_encode_layout_hdr(
+enum nfsstat4 pnfs_osd_xdr_encode_layout_hdr(
struct exp_xdr_stream *xdr,
struct pnfs_osd_layout *pol)
{
__be32 *p;
- int err;
+ enum nfsstat4 err;
err = pnfs_osd_xdr_encode_data_map(xdr, &pol->olo_map);
if (err)
@@ -159,7 +159,7 @@ int pnfs_osd_xdr_encode_layout_hdr(
p = exp_xdr_reserve_qwords(xdr, 2);
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
p = exp_xdr_encode_u32(p, pol->olo_comps_index);
p = exp_xdr_encode_u32(p, pol->olo_num_comps);
@@ -168,13 +168,13 @@ int pnfs_osd_xdr_encode_layout_hdr(
}
EXPORT_SYMBOL(pnfs_osd_xdr_encode_layout_hdr);
-static int _encode_string(struct exp_xdr_stream *xdr,
+static enum nfsstat4 _encode_string(struct exp_xdr_stream *xdr,
const struct nfs4_string *str)
{
__be32 *p = exp_xdr_reserve_space(xdr, 4 + str->len);
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
exp_xdr_encode_opaque(p, str->data, str->len);
return 0;
}
@@ -188,15 +188,15 @@ static int _encode_string(struct exp_xdr_stream *xdr,
* struct nfs4_string oda_osdname;
* };
*/
-int pnfs_osd_xdr_encode_deviceaddr(
+enum nfsstat4 pnfs_osd_xdr_encode_deviceaddr(
struct exp_xdr_stream *xdr, struct pnfs_osd_deviceaddr *devaddr)
{
__be32 *p;
- int err;
+ enum nfsstat4 err;
p = exp_xdr_reserve_space(xdr, 4 + 4 + sizeof(devaddr->oda_lun));
if (!p)
- return -E2BIG;
+ return NFS4ERR_TOOSMALL;
/* Empty oda_targetid */
p = exp_xdr_encode_u32(p, OBJ_TARGET_ANON);
@@ -17,16 +17,16 @@
#include <linux/exp_xdr.h>
/* Layout encoding */
-int pnfs_osd_xdr_encode_layout_hdr(
+enum nfsstat4 pnfs_osd_xdr_encode_layout_hdr(
struct exp_xdr_stream *xdr,
struct pnfs_osd_layout *layout);
-int pnfs_osd_xdr_encode_layout_cred(
+enum nfsstat4 pnfs_osd_xdr_encode_layout_cred(
struct exp_xdr_stream *xdr,
struct pnfs_osd_object_cred *cred);
/* deviceaddr encoding */
-int pnfs_osd_xdr_encode_deviceaddr(
+enum nfsstat4 pnfs_osd_xdr_encode_deviceaddr(
struct exp_xdr_stream *xdr, struct pnfs_osd_deviceaddr *devaddr);
/* layout_commit decoding */
* Change pnfs_osd_xdr_srv API to return nfs4 errors Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> --- fs/exportfs/pnfs_osd_xdr_srv.c | 30 +++++++++++++++--------------- include/linux/nfsd/pnfs_osd_xdr_srv.h | 6 +++--- 2 files changed, 18 insertions(+), 18 deletions(-)