linux/fs/nfsd/xdr4.h

/*
 *  Server-side types for NFSv4.
 *
 *  Copyright (c) 2002 The Regents of the University of Michigan.
 *  All rights reserved.
 *
 *  Kendrick Smith <[email protected]>
 *  Andy Adamson   <[email protected]>
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *  3. Neither the name of the University nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
 *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#ifndef _LINUX_NFSD_XDR4_H
#define _LINUX_NFSD_XDR4_H

#include "state.h"
#include "nfsd.h"

#define NFSD4_MAX_TAGLEN
#define XDR_LEN(n)

#define CURRENT_STATE_ID_FLAG
#define SAVED_STATE_ID_FLAG

#define SET_CSTATE_FLAG(c, f)
#define HAS_CSTATE_FLAG(c, f)
#define CLEAR_CSTATE_FLAG(c, f)

/**
 * nfsd4_encode_bool - Encode an XDR bool type result
 * @xdr: target XDR stream
 * @val: boolean value to encode
 *
 * Return values:
 *    %nfs_ok: @val encoded; @xdr advanced to next position
 *    %nfserr_resource: stream buffer space exhausted
 */
static __always_inline __be32
nfsd4_encode_bool(struct xdr_stream *xdr, bool val)
{}

/**
 * nfsd4_encode_uint32_t - Encode an XDR uint32_t type result
 * @xdr: target XDR stream
 * @val: integer value to encode
 *
 * Return values:
 *    %nfs_ok: @val encoded; @xdr advanced to next position
 *    %nfserr_resource: stream buffer space exhausted
 */
static __always_inline __be32
nfsd4_encode_uint32_t(struct xdr_stream *xdr, u32 val)
{}

#define nfsd4_encode_aceflag4(x, v)
#define nfsd4_encode_acemask4(x, v)
#define nfsd4_encode_acetype4(x, v)
#define nfsd4_encode_count4(x, v)
#define nfsd4_encode_mode4(x, v)
#define nfsd4_encode_nfs_lease4(x, v)
#define nfsd4_encode_qop4(x, v)
#define nfsd4_encode_sequenceid4(x, v)
#define nfsd4_encode_slotid4(x, v)

/**
 * nfsd4_encode_uint64_t - Encode an XDR uint64_t type result
 * @xdr: target XDR stream
 * @val: integer value to encode
 *
 * Return values:
 *    %nfs_ok: @val encoded; @xdr advanced to next position
 *    %nfserr_resource: stream buffer space exhausted
 */
static __always_inline __be32
nfsd4_encode_uint64_t(struct xdr_stream *xdr, u64 val)
{}

#define nfsd4_encode_changeid4(x, v)
#define nfsd4_encode_nfs_cookie4(x, v)
#define nfsd4_encode_length4(x, v)
#define nfsd4_encode_offset4(x, v)

/**
 * nfsd4_encode_opaque_fixed - Encode a fixed-length XDR opaque type result
 * @xdr: target XDR stream
 * @data: pointer to data
 * @size: length of data in bytes
 *
 * Return values:
 *    %nfs_ok: @data encoded; @xdr advanced to next position
 *    %nfserr_resource: stream buffer space exhausted
 */
static __always_inline __be32
nfsd4_encode_opaque_fixed(struct xdr_stream *xdr, const void *data,
			  size_t size)
{}

/**
 * nfsd4_encode_opaque - Encode a variable-length XDR opaque type result
 * @xdr: target XDR stream
 * @data: pointer to data
 * @size: length of data in bytes
 *
 * Return values:
 *    %nfs_ok: @data encoded; @xdr advanced to next position
 *    %nfserr_resource: stream buffer space exhausted
 */
static __always_inline __be32
nfsd4_encode_opaque(struct xdr_stream *xdr, const void *data, size_t size)
{}

#define nfsd4_encode_component4(x, d, s)

struct nfsd4_compound_state {};

static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
{}

struct nfsd4_change_info {};

struct nfsd4_access {};

struct nfsd4_close {};

struct nfsd4_commit {};

struct nfsd4_create {};
#define cr_datalen
#define cr_data
#define cr_first
#define cr_specdata1
#define cr_specdata2

struct nfsd4_delegreturn {};

struct nfsd4_getattr {};

struct nfsd4_link {};

struct nfsd4_lock_denied {};

struct nfsd4_lock {};
#define lk_new_open_seqid
#define lk_new_open_stateid
#define lk_new_lock_seqid
#define lk_new_clientid
#define lk_new_owner
#define lk_old_lock_stateid
#define lk_old_lock_seqid

struct nfsd4_lockt {};

struct nfsd4_locku {};


struct nfsd4_lookup {};

struct nfsd4_putfh {};

struct nfsd4_getxattr {};

struct nfsd4_setxattr {};

struct nfsd4_removexattr {};

struct nfsd4_listxattrs {};

struct nfsd4_open {};

struct nfsd4_open_confirm {};

struct nfsd4_open_downgrade {};


struct nfsd4_read {};

struct nfsd4_readdir {};

struct nfsd4_release_lockowner {};
struct nfsd4_readlink {};

struct nfsd4_remove {};

struct nfsd4_rename {};

struct nfsd4_secinfo {};

struct nfsd4_secinfo_no_name {};

struct nfsd4_setattr {};

struct nfsd4_setclientid {};

struct nfsd4_setclientid_confirm {};

struct nfsd4_test_stateid_id {};

struct nfsd4_test_stateid {};

struct nfsd4_free_stateid {};

struct nfsd4_get_dir_delegation {};

/* also used for NVERIFY */
struct nfsd4_verify {};

struct nfsd4_write {};

struct nfsd4_exchange_id {};

struct nfsd4_sequence {};

struct nfsd4_destroy_session {};

struct nfsd4_destroy_clientid {};

struct nfsd4_reclaim_complete {};

struct nfsd4_deviceid {};

struct nfsd4_layout_seg {};

struct nfsd4_getdeviceinfo {};

struct nfsd4_layoutget {};

struct nfsd4_layoutcommit {};

struct nfsd4_layoutreturn {};

struct nfsd4_fallocate {};

struct nfsd4_clone {};

struct nfsd42_write_res {};

struct nfsd4_cb_offload {};

struct nfsd4_copy {};

static inline void nfsd4_copy_set_sync(struct nfsd4_copy *copy, bool sync)
{}

static inline bool nfsd4_copy_is_sync(const struct nfsd4_copy *copy)
{}

static inline bool nfsd4_copy_is_async(const struct nfsd4_copy *copy)
{}

static inline bool nfsd4_ssc_is_inter(const struct nfsd4_copy *copy)
{}

struct nfsd4_seek {};

struct nfsd4_offload_status {};

struct nfsd4_copy_notify {};

struct nfsd4_op {};

bool nfsd4_cache_this_op(struct nfsd4_op *);

/*
 * Memory needed just for the duration of processing one compound:
 */
struct svcxdr_tmpbuf {};

struct nfsd4_compoundargs {};

struct nfsd4_compoundres {};

static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
{}

/*
 * The session reply cache only needs to cache replies that the client
 * actually asked us to.  But it's almost free for us to cache compounds
 * consisting of only a SEQUENCE op, so we may as well cache those too.
 * Also, the protocol doesn't give us a convenient response in the case
 * of a replay of a solo SEQUENCE op that wasn't cached
 * (RETRY_UNCACHED_REP can only be returned in the second op of a
 * compound).
 */
static inline bool nfsd4_cache_this(struct nfsd4_compoundres *resp)
{}

static inline bool nfsd4_last_compound_op(struct svc_rqst *rqstp)
{}

const struct nfsd4_operation *OPDESC(struct nfsd4_op *op);
int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op);
void warn_on_nonidempotent_op(struct nfsd4_op *op);

#define NFS4_SVC_XDRSIZE

bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
bool nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
bool nfs4svc_encode_compoundres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op);
__be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words,
		struct svc_fh *fhp, struct svc_export *exp,
		struct dentry *dentry,
		u32 *bmval, struct svc_rqst *, int ignore_crossmnt);
extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_create_session(struct svc_rqst *,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_sequence(struct svc_rqst *,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern void nfsd4_sequence_done(struct nfsd4_compoundres *resp);
extern __be32 nfsd4_destroy_session(struct svc_rqst *,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
__be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *,
		struct nfsd4_open *open, struct nfsd_net *nn);
extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
		struct svc_fh *current_fh, struct nfsd4_open *open);
extern void nfsd4_cstate_clear_replay(struct nfsd4_compound_state *cstate);
extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate,
		struct nfsd4_open *open);
extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern void nfsd4_lock_release(union nfsd4_op_u *u);
extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern void nfsd4_lockt_release(union nfsd4_op_u *u);
extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern __be32
nfsd4_release_lockowner(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern void nfsd4_release_compoundargs(struct svc_rqst *rqstp);
extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *u);
extern __be32 nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
		union nfsd4_op_u *u);
extern __be32 nfsd4_test_stateid(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *);
extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp,
		struct nfsd4_compound_state *, union nfsd4_op_u *);
extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr);

enum nfsd4_op_flags {};

struct nfsd4_operation {};

struct nfsd4_cb_recall_any {};

#endif