Newer
Older
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_putfh(xdr);
if (status)
status = decode_savefh(xdr);
if (status)
status = decode_putfh(xdr);
if (status)
status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo);
out:
return status;
}
/*
* Decode LINK response
*/
static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs4_link_res *res)
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_putfh(xdr);
if (status)
status = decode_savefh(xdr);
if (status)
status = decode_putfh(xdr);
if (status)
status = decode_link(xdr, &res->cinfo);
if (status)
goto out;
/*
* Note order: OP_LINK leaves the directory as the current
* filehandle.
*/
status = decode_restorefh(xdr);
if (status)
decode_getfattr(xdr, res->fattr, res->server);
out:
return status;
}
/*
* Decode CREATE response
*/
static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs4_create_res *res)
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_putfh(xdr);
if (status)
goto out;
status = decode_create(xdr, &res->dir_cinfo);
if (status)
status = decode_getfh(xdr, res->fh);
if (status)
decode_getfattr(xdr, res->fattr, res->server);
out:
return status;
}
/*
* Decode SYMLINK response
*/
static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs4_create_res *res)
return nfs4_xdr_dec_create(rqstp, xdr, res);
}
/*
* Decode GETATTR response
*/
static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs4_getattr_res *res)
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_getfattr(xdr, res->fattr, res->server);
/*
* Encode an SETACL request
*/
static void nfs4_xdr_enc_setacl(struct rpc_rqst *req, struct xdr_stream *xdr,
struct nfs_setaclargs *args)
.minorversion = nfs4_xdr_minorversion(&args->seq_args),
encode_compound_hdr(xdr, req, &hdr);
encode_sequence(xdr, &args->seq_args, &hdr);
encode_putfh(xdr, args->fh, &hdr);
encode_setacl(xdr, args, &hdr);
encode_nops(&hdr);
/*
* Decode SETACL response
*/
static int
nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
if (status)
goto out;
out:
return status;
}
/*
* Decode GETACL response
*/
static int
nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
if (res->acl_scratch != NULL) {
void *p = page_address(res->acl_scratch);
xdr_set_scratch_buffer(xdr, p, PAGE_SIZE);
}
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
if (status)
goto out;
status = decode_getacl(xdr, rqstp, res);
out:
return status;
}
static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_closeres *res)
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status != 0)
goto out;
/*
* Note: Server may do delete on close for this file
* in which case the getattr call will fail with
* an ESTALE error. Shouldn't be a problem,
* though, since fattr->valid will remain unset.
*/
decode_getfattr(xdr, res->fattr, res->server);
static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_openres *res)
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_getfh(xdr, &res->fh);
if (status)
if (res->access_request)
decode_access(xdr, &res->access_supported, &res->access_result);
decode_getfattr(xdr, res->f_attr, res->server);
}
/*
* Decode OPEN_CONFIRM response
*/
static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs_open_confirmres *res)
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_open_confirm(xdr, res);
static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs_openres *res)
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (res->access_request)
decode_access(xdr, &res->access_supported, &res->access_result);
decode_getfattr(xdr, res->f_attr, res->server);
}
/*
* Decode SETATTR response
*/
static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs_setattrres *res)
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
decode_getfattr(xdr, res->fattr, res->server);
static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_lock_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
out:
return status;
}
/*
* Decode LOCKT response
*/
static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_lockt_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
out:
return status;
}
/*
* Decode LOCKU response
*/
static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_locku_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
static int nfs4_xdr_dec_release_lockowner(struct rpc_rqst *rqstp,
struct xdr_stream *xdr, void *dummy)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_release_lockowner(xdr);
return status;
}
static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_readlink(xdr, rqstp);
out:
return status;
}
/*
* Decode READDIR response
*/
static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs4_readdir_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_readdir(xdr, rqstp, res);
out:
return status;
}
/*
* Decode Read response
*/
static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_readres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_read(xdr, rqstp, res);
if (!status)
status = res->count;
out:
return status;
}
/*
* Decode WRITE response
*/
static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_writeres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
decode_getfattr(xdr, res->fattr, res->server);
if (!status)
status = res->count;
out:
return status;
}
/*
* Decode COMMIT response
*/
static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_commitres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_commit(xdr, res);
static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, req);
status = decode_fsinfo(xdr, res->fsinfo);
static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, req);
status = decode_pathconf(xdr, res->pathconf);
static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, req);
status = decode_statfs(xdr, res->fsstat);
* Decode GETATTR_BITMAP response
static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req,
struct xdr_stream *xdr,
struct nfs4_server_caps_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, req);
status = decode_putfh(xdr);
if (status)
status = decode_server_caps(xdr, res);
out:
return status;
}
/*
* Decode RENEW response
*/
static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
void *__unused)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req,
struct xdr_stream *xdr,
struct nfs4_setclientid_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_setclientid(xdr, res);
* Decode SETCLIENTID_CONFIRM response
static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req,
struct xdr_stream *xdr,
struct nfs_fsinfo *fsinfo)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_setclientid_confirm(xdr);
status = decode_fsinfo(xdr, fsinfo);
static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_delegreturnres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status != 0)
goto out;
status = decode_getfattr(xdr, res->fattr, res->server);
if (status != 0)
goto out;
status = decode_delegreturn(xdr);
* Decode FS_LOCATIONS response
static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req,
struct xdr_stream *xdr,
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, req);
status = decode_putfh(xdr);
if (status)
status = decode_lookup(xdr);
if (status)
status = decode_getfattr_generic(xdr, &res->fs_locations->fattr,
NULL, res->fs_locations,
res->fs_locations->server);
out:
return status;
}
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
/*
* Decode SECINFO response
*/
static int nfs4_xdr_dec_secinfo(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_secinfo_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
if (status)
goto out;
status = decode_secinfo(xdr, res);
out:
return status;
}
/*
* Decode BIND_CONN_TO_SESSION response
*/
static int nfs4_xdr_dec_bind_conn_to_session(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (!status)
status = decode_bind_conn_to_session(xdr, res);
return status;
}
static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_exchange_id(xdr, res);
* Decode CREATE_SESSION response
static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs41_create_session_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_create_session(xdr, res);
* Decode DESTROY_SESSION response
static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_destroy_session(xdr, res);
/*
* Decode DESTROY_CLIENTID response
*/
static int nfs4_xdr_dec_destroy_clientid(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (!status)
status = decode_destroy_clientid(xdr, res);
return status;
}
static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_sequence_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, res, rqstp);
* Decode GET_LEASE_TIME response
static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_get_lease_time_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->lr_seq_res, rqstp);
status = decode_fsinfo(xdr, res->lr_fsinfo);
/*
* Decode RECLAIM_COMPLETE response
*/
static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs41_reclaim_complete_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
status = decode_sequence(xdr, &res->seq_res, rqstp);
status = decode_reclaim_complete(xdr, (void *)NULL);
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
/*
* Decode GETDEVICELIST response
*/
static int nfs4_xdr_dec_getdevicelist(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_getdevicelist_res *res)
{
struct compound_hdr hdr;
int status;
dprintk("encoding getdevicelist!\n");
status = decode_compound_hdr(xdr, &hdr);
if (status != 0)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status != 0)
goto out;
status = decode_putfh(xdr);
if (status != 0)
goto out;
status = decode_getdevicelist(xdr, res->devlist);
out:
return status;
}
/*
* Decode GETDEVINFO response
*/
static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_getdeviceinfo_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status != 0)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status != 0)
goto out;
status = decode_getdeviceinfo(xdr, res->pdev);
out:
return status;
}
/*
* Decode LAYOUTGET response
*/
static int nfs4_xdr_dec_layoutget(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_layoutget_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
if (status)
goto out;
status = decode_layoutget(xdr, rqstp, res);
out:
return status;
}
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
/*
* Decode LAYOUTRETURN response
*/
static int nfs4_xdr_dec_layoutreturn(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_layoutreturn_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
if (status)
goto out;
status = decode_layoutreturn(xdr, res);
out:
return status;
}
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
/*
* Decode LAYOUTCOMMIT response
*/
static int nfs4_xdr_dec_layoutcommit(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
struct nfs4_layoutcommit_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
if (status)
goto out;
status = decode_layoutcommit(xdr, rqstp, res);
if (status)
goto out;
decode_getfattr(xdr, res->fattr, res->server);