ReactOS  0.4.12-dev-18-gf469aca
nfs41_ops.h File Reference
#include "nfs41.h"
#include "pnfs.h"
Include dependency graph for nfs41_ops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __state_protect4_a
 
struct  __nfs41_exchange_id_args
 
struct  __state_protect4_r
 
struct  __nfs41_exchange_id_res
 
struct  __nfs41_callback_sec_parms
 
struct  __nfs41_create_session_args
 
struct  __nfs41_create_session_res
 
struct  __nfs41_bind_conn_to_session_args
 
struct  __nfs41_bind_conn_to_session_res
 
struct  __nfs41_destroy_session_args
 
struct  __nfs41_destroy_session_res
 
struct  __nfs41_destroy_clientid_args
 
struct  __nfs41_destroy_clientid_res
 
struct  __nfs41_sequence_args
 
struct  __nfs41_sequence_res_ok
 
struct  __nfs41_sequence_res
 
struct  __nfs41_reclaim_complete_res
 
struct  __stateid_arg
 
struct  __nfs41_access_args
 
struct  __nfs41_access_res
 
struct  __nfs41_op_close_args
 
struct  __nfs41_op_close_res
 
struct  __nfs41_commit_args
 
struct  __nfs41_commit_res
 
struct  __specdata4
 
struct  __createtype4
 
struct  __nfs41_create_args
 
struct  __nfs41_create_res
 
struct  __nfs41_delegpurge_res
 
struct  __nfs41_delegreturn_args
 
struct  __nfs41_delegreturn_res
 
struct  __nfs41_link_args
 
struct  __nfs41_link_res
 
struct  __open_to_lock_owner4
 
struct  __exist_lock_owner4
 
struct  __locker4
 
struct  __nfs41_lock_args
 
struct  __lock_res_denied
 
struct  __lock_res_ok
 
struct  __nfs41_lock_res
 
struct  __nfs41_lockt_args
 
struct  __nfs41_lockt_res
 
struct  __nfs41_locku_args
 
struct  __nfs41_locku_res
 
struct  __nfs41_lookup_args
 
struct  __nfs41_lookup_res
 
struct  __nfs41_getfh_res
 
struct  __nfs41_putfh_args
 
struct  __nfs41_putfh_res
 
struct  __nfs41_putrootfh_res
 
struct  __nfs41_getattr_args
 
struct  __nfs41_getattr_res
 
struct  __createhow4
 
struct  __openflag4
 
struct  __open_claim4
 
struct  __nfs41_op_open_args
 
struct  __nfs41_op_open_res_ok
 
struct  __nfs41_op_open_res
 
struct  __nfs41_openattr_args
 
struct  __nfs41_openattr_res
 
struct  __nfs41_read_args
 
struct  __nfs41_read_res_ok
 
struct  __nfs41_read_res
 
struct  __nfs41_readdir_args
 
struct  __nfs41_readdir_entry
 
struct  __nfs41_readdir_list
 
struct  __nfs41_readdir_res
 
struct  __nfs41_readlink_res
 
struct  __nfs41_remove_args
 
struct  __nfs41_remove_res
 
struct  __nfs41_rename_args
 
struct  __nfs41_rename_res
 
struct  __nfs41_restorefh_savefh_res
 
struct  __nfs41_setattr_args
 
struct  __nfs41_setattr_res
 
struct  __deleg_claim4
 
struct  __nfs41_want_delegation_args
 
struct  __nfs41_want_delegation_res
 
struct  __nfs41_free_stateid_args
 
struct  __nfs41_free_stateid_res
 
struct  __nfs41_test_stateid_args
 
struct  __nfs41_test_stateid_res
 
struct  __nfs41_write_args
 
struct  __nfs41_write_res_ok
 
struct  __nfs41_write_res
 
struct  __nfs41_secinfo_info
 
struct  __nfs41_secinfo_args
 
struct  __nfs41_secinfo_noname_args
 
struct  __nfs41_secinfo_noname_res
 
struct  __pnfs_layoutget_args
 
struct  __pnfs_layoutget_res_ok
 
struct  __pnfs_layoutget_res
 
struct  __pnfs_layoutcommit_args
 
struct  __pnfs_layoutcommit_res
 
struct  __pnfs_layoutreturn_args
 
struct  __pnfs_layoutreturn_res
 
struct  __pnfs_getdeviceinfo_args
 
struct  __pnfs_getdeviceinfo_res_ok
 
struct  __pnfs_getdeviceinfo_res
 

Macros

#define RPCSEC_GSS   6
 
#define MAX_OID_LEN   128
 
#define MAX_SECINFOS   6
 

Typedefs

typedef struct __state_protect4_a state_protect4_a
 
typedef struct __nfs41_exchange_id_args nfs41_exchange_id_args
 
typedef struct __state_protect4_r state_protect4_r
 
typedef struct __nfs41_exchange_id_res nfs41_exchange_id_res
 
typedef struct __nfs41_callback_sec_parms nfs41_callback_secparms
 
typedef struct __nfs41_create_session_args nfs41_create_session_args
 
typedef struct __nfs41_create_session_res nfs41_create_session_res
 
typedef struct __nfs41_bind_conn_to_session_args nfs41_bind_conn_to_session_args
 
typedef struct __nfs41_bind_conn_to_session_res nfs41_bind_conn_to_session_res
 
typedef struct __nfs41_destroy_session_args nfs41_destroy_session_args
 
typedef struct __nfs41_destroy_session_res nfs41_destroy_session_res
 
typedef struct __nfs41_destroy_clientid_args nfs41_destroy_clientid_args
 
typedef struct __nfs41_destroy_clientid_res nfs41_destroy_clientid_res
 
typedef struct __nfs41_sequence_args nfs41_sequence_args
 
typedef struct __nfs41_sequence_res_ok nfs41_sequence_res_ok
 
typedef struct __nfs41_sequence_res nfs41_sequence_res
 
typedef struct __nfs41_reclaim_complete_res nfs41_reclaim_complete_res
 
typedef struct __stateid_arg stateid_arg
 
typedef struct __nfs41_access_args nfs41_access_args
 
typedef struct __nfs41_access_res nfs41_access_res
 
typedef struct __nfs41_op_close_args nfs41_op_close_args
 
typedef struct __nfs41_op_close_res nfs41_op_close_res
 
typedef struct __nfs41_commit_args nfs41_commit_args
 
typedef struct __nfs41_commit_res nfs41_commit_res
 
typedef struct __specdata4 specdata4
 
typedef struct __createtype4 createtype4
 
typedef struct __nfs41_create_args nfs41_create_args
 
typedef struct __nfs41_create_res nfs41_create_res
 
typedef struct __nfs41_delegpurge_res nfs41_delegpurge_res
 
typedef struct __nfs41_delegreturn_args nfs41_delegreturn_args
 
typedef struct __nfs41_delegreturn_res nfs41_delegreturn_res
 
typedef struct __nfs41_link_args nfs41_link_args
 
typedef struct __nfs41_link_res nfs41_link_res
 
typedef struct __open_to_lock_owner4 open_to_lock_owner4
 
typedef struct __exist_lock_owner4 exist_lock_owner4
 
typedef struct __locker4 locker4
 
typedef struct __nfs41_lock_args nfs41_lock_args
 
typedef struct __lock_res_denied lock_res_denied
 
typedef struct __lock_res_ok lock_res_ok
 
typedef struct __nfs41_lock_res nfs41_lock_res
 
typedef struct __nfs41_lockt_args nfs41_lockt_args
 
typedef struct __nfs41_lockt_res nfs41_lockt_res
 
typedef struct __nfs41_locku_args nfs41_locku_args
 
typedef struct __nfs41_locku_res nfs41_locku_res
 
typedef struct __nfs41_lookup_args nfs41_lookup_args
 
typedef struct __nfs41_lookup_res nfs41_lookup_res
 
typedef struct __nfs41_getfh_res nfs41_getfh_res
 
typedef struct __nfs41_putfh_args nfs41_putfh_args
 
typedef struct __nfs41_putfh_res nfs41_putfh_res
 
typedef struct __nfs41_putrootfh_res nfs41_putrootfh_res
 
typedef struct __nfs41_getattr_args nfs41_getattr_args
 
typedef struct __nfs41_getattr_res nfs41_getattr_res
 
typedef struct __createhow4 createhow4
 
typedef struct __openflag4 openflag4
 
typedef struct __open_claim4 open_claim4
 
typedef struct __nfs41_op_open_args nfs41_op_open_args
 
typedef struct __nfs41_op_open_res_ok nfs41_op_open_res_ok
 
typedef struct __nfs41_op_open_res nfs41_op_open_res
 
typedef struct __nfs41_openattr_args nfs41_openattr_args
 
typedef struct __nfs41_openattr_res nfs41_openattr_res
 
typedef struct __nfs41_read_args nfs41_read_args
 
typedef struct __nfs41_read_res_ok nfs41_read_res_ok
 
typedef struct __nfs41_read_res nfs41_read_res
 
typedef struct __nfs41_readdir_args nfs41_readdir_args
 
typedef struct __nfs41_readdir_entry nfs41_readdir_entry
 
typedef struct __nfs41_readdir_list nfs41_readdir_list
 
typedef struct __nfs41_readdir_res nfs41_readdir_res
 
typedef struct __nfs41_readlink_res nfs41_readlink_res
 
typedef struct __nfs41_remove_args nfs41_remove_args
 
typedef struct __nfs41_remove_res nfs41_remove_res
 
typedef struct __nfs41_rename_args nfs41_rename_args
 
typedef struct __nfs41_rename_res nfs41_rename_res
 
typedef struct __nfs41_restorefh_savefh_res nfs41_restorefh_res
 
typedef struct __nfs41_restorefh_savefh_res nfs41_savefh_res
 
typedef struct __nfs41_setattr_args nfs41_setattr_args
 
typedef struct __nfs41_setattr_res nfs41_setattr_res
 
typedef struct __deleg_claim4 deleg_claim4
 
typedef struct __nfs41_want_delegation_args nfs41_want_delegation_args
 
typedef struct __nfs41_want_delegation_res nfs41_want_delegation_res
 
typedef struct __nfs41_free_stateid_args nfs41_free_stateid_args
 
typedef struct __nfs41_free_stateid_res nfs41_free_stateid_res
 
typedef struct __nfs41_test_stateid_args nfs41_test_stateid_args
 
typedef struct __nfs41_test_stateid_res nfs41_test_stateid_res
 
typedef struct __nfs41_write_args nfs41_write_args
 
typedef struct __nfs41_write_res_ok nfs41_write_res_ok
 
typedef struct __nfs41_write_res nfs41_write_res
 
typedef struct __nfs41_secinfo_info nfs41_secinfo_info
 
typedef struct __nfs41_secinfo_args nfs41_secinfo_args
 
typedef struct __nfs41_secinfo_noname_args nfs41_secinfo_noname_args
 
typedef struct __nfs41_secinfo_noname_res nfs41_secinfo_noname_res
 
typedef struct __pnfs_layoutget_args pnfs_layoutget_args
 
typedef struct __pnfs_layoutget_res_ok pnfs_layoutget_res_ok
 
typedef struct __pnfs_layoutget_res pnfs_layoutget_res
 
typedef struct __pnfs_layoutcommit_args pnfs_layoutcommit_args
 
typedef struct __pnfs_layoutcommit_res pnfs_layoutcommit_res
 
typedef struct __pnfs_layoutreturn_args pnfs_layoutreturn_args
 
typedef struct __pnfs_layoutreturn_res pnfs_layoutreturn_res
 
typedef struct __pnfs_getdeviceinfo_args pnfs_getdeviceinfo_args
 
typedef struct __pnfs_getdeviceinfo_res_ok pnfs_getdeviceinfo_res_ok
 
typedef struct __pnfs_getdeviceinfo_res pnfs_getdeviceinfo_res
 

Enumerations

enum  nfs_opnum4 {
  OP_ACCESS = 3, OP_CLOSE = 4, OP_COMMIT = 5, OP_CREATE = 6,
  OP_DELEGPURGE = 7, OP_DELEGRETURN = 8, OP_GETATTR = 9, OP_GETFH = 10,
  OP_LINK = 11, OP_LOCK = 12, OP_LOCKT = 13, OP_LOCKU = 14,
  OP_LOOKUP = 15, OP_LOOKUPP = 16, OP_NVERIFY = 17, OP_OPEN = 18,
  OP_OPENATTR = 19, OP_OPEN_CONFIRM = 20, OP_OPEN_DOWNGRADE = 21, OP_PUTFH = 22,
  OP_PUTPUBFH = 23, OP_PUTROOTFH = 24, OP_READ = 25, OP_READDIR = 26,
  OP_READLINK = 27, OP_REMOVE = 28, OP_RENAME = 29, OP_RENEW = 30,
  OP_RESTOREFH = 31, OP_SAVEFH = 32, OP_SECINFO = 33, OP_SETATTR = 34,
  OP_SETCLIENTID = 35, OP_SETCLIENTID_CONFIRM = 36, OP_VERIFY = 37, OP_WRITE = 38,
  OP_RELEASE_LOCKOWNER = 39, OP_BACKCHANNEL_CTL = 40, OP_BIND_CONN_TO_SESSION = 41, OP_EXCHANGE_ID = 42,
  OP_CREATE_SESSION = 43, OP_DESTROY_SESSION = 44, OP_FREE_STATEID = 45, OP_GET_DIR_DELEGATION = 46,
  OP_GETDEVICEINFO = 47, OP_GETDEVICELIST = 48, OP_LAYOUTCOMMIT = 49, OP_LAYOUTGET = 50,
  OP_LAYOUTRETURN = 51, OP_SECINFO_NO_NAME = 52, OP_SEQUENCE = 53, OP_SET_SSV = 54,
  OP_TEST_STATEID = 55, OP_WANT_DELEGATION = 56, OP_DESTROY_CLIENTID = 57, OP_RECLAIM_COMPLETE = 58,
  OP_ILLEGAL = 10044
}
 
enum  {
  EXCHGID4_FLAG_SUPP_MOVED_REFER = 0x00000001, EXCHGID4_FLAG_SUPP_MOVED_MIGR = 0x00000002, EXCHGID4_FLAG_BIND_PRINC_STATEID = 0x00000100, EXCHGID4_FLAG_USE_NON_PNFS = 0x00010000,
  EXCHGID4_FLAG_USE_PNFS_MDS = 0x00020000, EXCHGID4_FLAG_USE_PNFS_DS = 0x00040000, EXCHGID4_FLAG_MASK_PNFS = 0x00070000, EXCHGID4_FLAG_UPD_CONFIRMED_REC_A = 0x40000000,
  EXCHGID4_FLAG_CONFIRMED_R = 0x80000000
}
 
enum  state_protect_how4 { SP4_NONE = 0, SP4_MACH_CRED = 1, SP4_SSV = 2 }
 
enum  channel_dir_from_client4 { CDFC4_FORE = 0x1, CDFC4_BACK = 0x2, CDFC4_FORE_OR_BOTH = 0x3, CDFC4_BACK_OR_BOTH = 0x7 }
 
enum  channel_dir_from_server4 { CDFS4_FORE = 0x1, CDFS4_BACK = 0x2, CDFS4_BOTH = 0x3 }
 
enum  {
  SEQ4_STATUS_CB_PATH_DOWN = 0x00000001, SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING = 0x00000002, SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED = 0x00000004, SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED = 0x00000008,
  SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED = 0x00000010, SEQ4_STATUS_ADMIN_STATE_REVOKED = 0x00000020, SEQ4_STATUS_RECALLABLE_STATE_REVOKED = 0x00000040, SEQ4_STATUS_LEASE_MOVED = 0x00000080,
  SEQ4_STATUS_RESTART_RECLAIM_NEEDED = 0x00000100, SEQ4_STATUS_CB_PATH_DOWN_SESSION = 0x00000200, SEQ4_STATUS_BACKCHANNEL_FAULT = 0x00000400, SEQ4_STATUS_DEVID_CHANGED = 0x00000800,
  SEQ4_STATUS_DEVID_DELETED = 0x00001000
}
 
enum  stateid_type {
  STATEID_OPEN, STATEID_LOCK, STATEID_DELEG_FILE, STATEID_DELEG_DIR,
  STATEID_LAYOUT, STATEID_SPECIAL
}
 
enum  {
  ACCESS4_READ = 0x00000001, ACCESS4_LOOKUP = 0x00000002, ACCESS4_MODIFY = 0x00000004, ACCESS4_EXTEND = 0x00000008,
  ACCESS4_DELETE = 0x00000010, ACCESS4_EXECUTE = 0x00000020
}
 
enum  { READ_LT = 1, WRITE_LT = 2, READW_LT = 3, WRITEW_LT = 4 }
 
enum  createmode4 { UNCHECKED4 = 0, GUARDED4 = 1, EXCLUSIVE4 = 2, EXCLUSIVE4_1 = 3 }
 
enum  opentype4 { OPEN4_NOCREATE = 0, OPEN4_CREATE = 1 }
 
enum  {
  OPEN4_SHARE_ACCESS_READ = 0x00000001, OPEN4_SHARE_ACCESS_WRITE = 0x00000002, OPEN4_SHARE_ACCESS_BOTH = 0x00000003, OPEN4_SHARE_DENY_NONE = 0x00000000,
  OPEN4_SHARE_DENY_READ = 0x00000001, OPEN4_SHARE_DENY_WRITE = 0x00000002, OPEN4_SHARE_DENY_BOTH = 0x00000003, OPEN4_SHARE_ACCESS_WANT_DELEG_MASK = 0xFF00,
  OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE = 0x0000, OPEN4_SHARE_ACCESS_WANT_READ_DELEG = 0x0100, OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG = 0x0200, OPEN4_SHARE_ACCESS_WANT_ANY_DELEG = 0x0300,
  OPEN4_SHARE_ACCESS_WANT_NO_DELEG = 0x0400, OPEN4_SHARE_ACCESS_WANT_CANCEL = 0x0500, OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL = 0x10000, OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED = 0x20000
}
 
enum  open_delegation_type4 { OPEN_DELEGATE_NONE = 0, OPEN_DELEGATE_READ = 1, OPEN_DELEGATE_WRITE = 2, OPEN_DELEGATE_NONE_EXT = 3 }
 
enum  open_claim_type4 {
  CLAIM_NULL = 0, CLAIM_PREVIOUS = 1, CLAIM_DELEGATE_CUR = 2, CLAIM_DELEGATE_PREV = 3,
  CLAIM_FH = 4, CLAIM_DELEG_CUR_FH = 5, CLAIM_DELEG_PREV_FH = 6
}
 
enum  why_no_delegation4 {
  WND4_NOT_WANTED = 0, WND4_CONTENTION = 1, WND4_RESOURCE = 2, WND4_NOT_SUPP_FTYPE = 3,
  WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4, WND4_NOT_SUPP_UPGRADE = 5, WND4_NOT_SUPP_DOWNGRADE = 6, WND4_CANCELED = 7,
  WND4_IS_DIR = 8
}
 
enum  { OPEN4_RESULT_CONFIRM = 0x00000002, OPEN4_RESULT_LOCKTYPE_POSIX = 0x00000004, OPEN4_RESULT_PRESERVE_UNLINKED = 0x00000008, OPEN4_RESULT_MAY_NOTIFY_LOCK = 0x00000020 }
 
enum  time_how4 { SET_TO_SERVER_TIME4 = 0, SET_TO_CLIENT_TIME4 = 1 }
 
enum  stable_how4 { UNSTABLE4 = 0, DATA_SYNC4 = 1, FILE_SYNC4 = 2 }
 
enum  sec_flavor { RPC_GSS_SVC_NONE = 1, RPC_GSS_SVC_INTEGRITY = 2, RPC_GSS_SVC_PRIVACY = 3 }
 
enum  secinfo_no_name_type { SECINFO_STYLE4_CURRENT_FH = 0, SECINFO_STYLE4_PARENT = 1 }
 

Functions

int nfs41_exchange_id (IN nfs41_rpc_clnt *rpc, IN client_owner4 *owner, IN uint32_t flags_in, OUT nfs41_exchange_id_res *res_out)
 
int nfs41_create_session (IN nfs41_client *clnt, OUT nfs41_session *session, IN bool_t try_recovery)
 
enum nfsstat4 nfs41_bind_conn_to_session (IN nfs41_rpc_clnt *rpc, IN const unsigned char *sessionid, IN enum channel_dir_from_client4 dir)
 
int nfs41_destroy_session (IN nfs41_session *session)
 
int nfs41_destroy_clientid (IN nfs41_rpc_clnt *rpc, IN uint64_t clientid)
 
int nfs41_send_sequence (IN nfs41_session *session)
 
enum nfsstat4 nfs41_reclaim_complete (IN nfs41_session *session)
 
int nfs41_lookup (IN nfs41_root *root, IN nfs41_session *session, IN OUT nfs41_abs_path *path, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT nfs41_session **session_out)
 
int nfs41_open (IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN state_owner4 *owner, IN open_claim4 *claim, IN uint32_t allow, IN uint32_t deny, IN uint32_t create, IN uint32_t how_mode, IN OPTIONAL nfs41_file_info *createattrs, IN bool_t try_recovery, OUT stateid4 *stateid, OUT open_delegation4 *delegation, OUT OPTIONAL nfs41_file_info *info)
 
int nfs41_create (IN nfs41_session *session, IN uint32_t type, IN nfs41_file_info *createattrs, IN OPTIONAL const char *symlink, IN nfs41_path_fh *parent, OUT nfs41_path_fh *file, OUT nfs41_file_info *info)
 
int nfs41_close (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid)
 
int nfs41_write (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN unsigned char *data, IN uint32_t data_len, IN uint64_t offset, IN enum stable_how4 stable, OUT uint32_t *bytes_written, OUT nfs41_write_verf *verf, OUT nfs41_file_info *cinfo)
 
int nfs41_read (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN uint64_t offset, IN uint32_t count, OUT unsigned char *data_out, OUT uint32_t *data_len_out, OUT bool_t *eof_out)
 
int nfs41_commit (IN nfs41_session *session, IN nfs41_path_fh *file, IN uint64_t offset, IN uint32_t count, IN bool_t do_getattr, OUT nfs41_write_verf *verf, OUT nfs41_file_info *cinfo)
 
int nfs41_lock (IN nfs41_session *session, IN nfs41_path_fh *file, IN state_owner4 *owner, IN uint32_t type, IN uint64_t offset, IN uint64_t length, IN bool_t reclaim, IN bool_t try_recovery, IN OUT stateid_arg *stateid)
 
int nfs41_unlock (IN nfs41_session *session, IN nfs41_path_fh *file, IN uint64_t offset, IN uint64_t length, IN OUT stateid_arg *stateid)
 
stateid4nfs41_lock_stateid_copy (IN nfs41_lock_state *lock_state, IN OUT stateid4 *dest)
 
int nfs41_readdir (IN nfs41_session *session, IN nfs41_path_fh *file, IN bitmap4 *attr_request, IN nfs41_readdir_cookie *cookie, OUT unsigned char *entries, IN OUT uint32_t *entries_len, OUT bool_t *eof_out)
 
int nfs41_getattr (IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
 
int nfs41_superblock_getattr (IN nfs41_session *session, IN nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info, OUT bool_t *supports_named_attrs)
 
int nfs41_cached_getattr (IN nfs41_session *session, IN nfs41_path_fh *file, OUT nfs41_file_info *info)
 
int nfs41_remove (IN nfs41_session *session, IN nfs41_path_fh *parent, IN const nfs41_component *target, IN uint64_t fileid)
 
int nfs41_rename (IN nfs41_session *session, IN nfs41_path_fh *src_dir, IN const nfs41_component *src_name, IN nfs41_path_fh *dst_dir, IN const nfs41_component *dst_name)
 
int nfs41_setattr (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
 
int nfs41_link (IN nfs41_session *session, IN nfs41_path_fh *src, IN nfs41_path_fh *dst_dir, IN const nfs41_component *target, OUT nfs41_file_info *cinfo)
 
int nfs41_symlink_target (IN nfs41_session *session, IN nfs41_path_fh *file, OUT nfs41_abs_path *target)
 
int nfs41_symlink_follow (IN nfs41_root *root, IN nfs41_session *session, IN nfs41_path_fh *symlink, OUT nfs41_file_info *info)
 
int nfs41_readlink (IN nfs41_session *session, IN nfs41_path_fh *file, IN uint32_t max_len, OUT char *link_out, OUT uint32_t *len_out)
 
int nfs41_access (IN nfs41_session *session, IN nfs41_path_fh *file, IN uint32_t requested, OUT uint32_t *supported OPTIONAL, OUT uint32_t *access OPTIONAL)
 
enum nfsstat4 nfs41_want_delegation (IN nfs41_session *session, IN nfs41_path_fh *file, IN deleg_claim4 *claim, IN uint32_t want, IN bool_t try_recovery, OUT open_delegation4 *delegation)
 
int nfs41_delegpurge (IN nfs41_session *session)
 
int nfs41_delegreturn (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN bool_t try_recovery)
 
enum nfsstat4 nfs41_fs_locations (IN nfs41_session *session, IN nfs41_path_fh *parent, IN const nfs41_component *name, OUT fs_locations4 *locations)
 
int nfs41_secinfo (IN nfs41_session *session, IN nfs41_path_fh *file, IN const nfs41_component *name, OUT nfs41_secinfo_info *secinfo)
 
int nfs41_secinfo_noname (IN nfs41_session *session, IN nfs41_path_fh *file, OUT nfs41_secinfo_info *secinfo)
 
enum nfsstat4 nfs41_free_stateid (IN nfs41_session *session, IN stateid4 *stateid)
 
enum nfsstat4 nfs41_test_stateid (IN nfs41_session *session, IN stateid_arg *stateid_array, IN uint32_t count, OUT uint32_t *status_array)
 
enum nfsstat4 pnfs_rpc_layoutget (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN enum pnfs_iomode iomode, IN uint64_t offset, IN uint64_t minlength, IN uint64_t length, OUT pnfs_layoutget_res_ok *layoutget_res)
 
enum nfsstat4 pnfs_rpc_layoutcommit (IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid4 *stateid, IN uint64_t offset, IN uint64_t length, IN OPTIONAL uint64_t *new_last_offset, IN OPTIONAL nfstime4 *new_time_modify, OUT nfs41_file_info *info)
 
enum nfsstat4 pnfs_rpc_layoutreturn (IN nfs41_session *session, IN nfs41_path_fh *file, IN enum pnfs_layout_type type, IN enum pnfs_iomode iomode, IN uint64_t offset, IN uint64_t length, IN stateid4 *stateid, OUT pnfs_layoutreturn_res *layoutreturn_res)
 
enum nfsstat4 pnfs_rpc_getdeviceinfo (IN nfs41_session *session, IN unsigned char *deviceid, OUT pnfs_file_device *device)
 
enum nfsstat4 nfs41_rpc_openattr (IN nfs41_session *session, IN nfs41_path_fh *file, IN bool_t createdir, OUT nfs41_fh *fh_out)
 

Macro Definition Documentation

◆ MAX_OID_LEN

#define MAX_OID_LEN   128

Definition at line 868 of file nfs41_ops.h.

Referenced by xdr_secinfo().

◆ MAX_SECINFOS

#define MAX_SECINFOS   6

◆ RPCSEC_GSS

Typedef Documentation

◆ createhow4

◆ createtype4

◆ deleg_claim4

◆ exist_lock_owner4

◆ lock_res_denied

◆ lock_res_ok

◆ locker4

◆ nfs41_access_args

◆ nfs41_access_res

◆ nfs41_bind_conn_to_session_args

◆ nfs41_bind_conn_to_session_res

◆ nfs41_callback_secparms

◆ nfs41_commit_args

◆ nfs41_commit_res

◆ nfs41_create_args

◆ nfs41_create_res

◆ nfs41_create_session_args

◆ nfs41_create_session_res

◆ nfs41_delegpurge_res

◆ nfs41_delegreturn_args

◆ nfs41_delegreturn_res

◆ nfs41_destroy_clientid_args

◆ nfs41_destroy_clientid_res

◆ nfs41_destroy_session_args

◆ nfs41_destroy_session_res

◆ nfs41_exchange_id_args

◆ nfs41_exchange_id_res

◆ nfs41_free_stateid_args

◆ nfs41_free_stateid_res

◆ nfs41_getattr_args

◆ nfs41_getattr_res

◆ nfs41_getfh_res

◆ nfs41_link_args

◆ nfs41_link_res

◆ nfs41_lock_args

◆ nfs41_lock_res

◆ nfs41_lockt_args

◆ nfs41_lockt_res

◆ nfs41_locku_args

◆ nfs41_locku_res

◆ nfs41_lookup_args

◆ nfs41_lookup_res

◆ nfs41_op_close_args

◆ nfs41_op_close_res

◆ nfs41_op_open_args

◆ nfs41_op_open_res

◆ nfs41_op_open_res_ok

◆ nfs41_openattr_args

◆ nfs41_openattr_res

◆ nfs41_putfh_args

◆ nfs41_putfh_res

◆ nfs41_putrootfh_res

◆ nfs41_read_args

◆ nfs41_read_res

◆ nfs41_read_res_ok

◆ nfs41_readdir_args

◆ nfs41_readdir_entry

◆ nfs41_readdir_list

◆ nfs41_readdir_res

◆ nfs41_readlink_res

◆ nfs41_reclaim_complete_res

◆ nfs41_remove_args

◆ nfs41_remove_res

◆ nfs41_rename_args

◆ nfs41_rename_res

◆ nfs41_restorefh_res

◆ nfs41_savefh_res

◆ nfs41_secinfo_args

◆ nfs41_secinfo_info

◆ nfs41_secinfo_noname_args

◆ nfs41_secinfo_noname_res

◆ nfs41_sequence_args

◆ nfs41_sequence_res

◆ nfs41_sequence_res_ok

◆ nfs41_setattr_args

◆ nfs41_setattr_res

◆ nfs41_test_stateid_args

◆ nfs41_test_stateid_res

◆ nfs41_want_delegation_args

◆ nfs41_want_delegation_res

◆ nfs41_write_args

◆ nfs41_write_res

◆ nfs41_write_res_ok

◆ open_claim4

◆ open_to_lock_owner4

◆ openflag4

◆ pnfs_getdeviceinfo_args

◆ pnfs_getdeviceinfo_res

◆ pnfs_getdeviceinfo_res_ok

◆ pnfs_layoutcommit_args

◆ pnfs_layoutcommit_res

◆ pnfs_layoutget_args

◆ pnfs_layoutget_res

◆ pnfs_layoutget_res_ok

◆ pnfs_layoutreturn_args

◆ pnfs_layoutreturn_res

◆ specdata4

◆ state_protect4_a

◆ state_protect4_r

◆ stateid_arg

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EXCHGID4_FLAG_SUPP_MOVED_REFER 
EXCHGID4_FLAG_SUPP_MOVED_MIGR 
EXCHGID4_FLAG_BIND_PRINC_STATEID 
EXCHGID4_FLAG_USE_NON_PNFS 
EXCHGID4_FLAG_USE_PNFS_MDS 
EXCHGID4_FLAG_USE_PNFS_DS 
EXCHGID4_FLAG_MASK_PNFS 
EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 
EXCHGID4_FLAG_CONFIRMED_R 

Definition at line 94 of file nfs41_ops.h.

◆ anonymous enum

anonymous enum
Enumerator
SEQ4_STATUS_CB_PATH_DOWN 
SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 
SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 
SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 
SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 
SEQ4_STATUS_ADMIN_STATE_REVOKED 
SEQ4_STATUS_RECALLABLE_STATE_REVOKED 
SEQ4_STATUS_LEASE_MOVED 
SEQ4_STATUS_RESTART_RECLAIM_NEEDED 
SEQ4_STATUS_CB_PATH_DOWN_SESSION 
SEQ4_STATUS_BACKCHANNEL_FAULT 
SEQ4_STATUS_DEVID_CHANGED 
SEQ4_STATUS_DEVID_DELETED 

Definition at line 236 of file nfs41_ops.h.

◆ anonymous enum

anonymous enum
Enumerator
ACCESS4_READ 
ACCESS4_LOOKUP 
ACCESS4_MODIFY 
ACCESS4_EXTEND 
ACCESS4_DELETE 
ACCESS4_EXECUTE 

Definition at line 292 of file nfs41_ops.h.

292  {
293  ACCESS4_READ = 0x00000001,
294  ACCESS4_LOOKUP = 0x00000002,
295  ACCESS4_MODIFY = 0x00000004,
296  ACCESS4_EXTEND = 0x00000008,
297  ACCESS4_DELETE = 0x00000010,
298  ACCESS4_EXECUTE = 0x00000020
299 };

◆ anonymous enum

anonymous enum
Enumerator
READ_LT 
WRITE_LT 
READW_LT 
WRITEW_LT 

Definition at line 398 of file nfs41_ops.h.

398  {
399  READ_LT = 1,
400  WRITE_LT = 2,
401  READW_LT = 3, /* blocking read */
402  WRITEW_LT = 4 /* blocking write */
403 };

◆ anonymous enum

anonymous enum
Enumerator
OPEN4_SHARE_ACCESS_READ 
OPEN4_SHARE_ACCESS_WRITE 
OPEN4_SHARE_ACCESS_BOTH 
OPEN4_SHARE_DENY_NONE 
OPEN4_SHARE_DENY_READ 
OPEN4_SHARE_DENY_WRITE 
OPEN4_SHARE_DENY_BOTH 
OPEN4_SHARE_ACCESS_WANT_DELEG_MASK 
OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE 
OPEN4_SHARE_ACCESS_WANT_READ_DELEG 
OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG 
OPEN4_SHARE_ACCESS_WANT_ANY_DELEG 
OPEN4_SHARE_ACCESS_WANT_NO_DELEG 
OPEN4_SHARE_ACCESS_WANT_CANCEL 
OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL 
OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED 

Definition at line 563 of file nfs41_ops.h.

563  {
564  OPEN4_SHARE_ACCESS_READ = 0x00000001,
565  OPEN4_SHARE_ACCESS_WRITE = 0x00000002,
566  OPEN4_SHARE_ACCESS_BOTH = 0x00000003,
567 
568  OPEN4_SHARE_DENY_NONE = 0x00000000,
569  OPEN4_SHARE_DENY_READ = 0x00000001,
570  OPEN4_SHARE_DENY_WRITE = 0x00000002,
571  OPEN4_SHARE_DENY_BOTH = 0x00000003,
572 
580 
583 };

◆ anonymous enum

anonymous enum
Enumerator
OPEN4_RESULT_CONFIRM 
OPEN4_RESULT_LOCKTYPE_POSIX 
OPEN4_RESULT_PRESERVE_UNLINKED 
OPEN4_RESULT_MAY_NOTIFY_LOCK 

Definition at line 650 of file nfs41_ops.h.

◆ channel_dir_from_client4

Enumerator
CDFC4_FORE 
CDFC4_BACK 
CDFC4_FORE_OR_BOTH 
CDFC4_BACK_OR_BOTH 

Definition at line 182 of file nfs41_ops.h.

182  {
183  CDFC4_FORE = 0x1,
184  CDFC4_BACK = 0x2,
185  CDFC4_FORE_OR_BOTH = 0x3,
186  CDFC4_BACK_OR_BOTH = 0x7
187 };

◆ channel_dir_from_server4

Enumerator
CDFS4_FORE 
CDFS4_BACK 
CDFS4_BOTH 

Definition at line 189 of file nfs41_ops.h.

189  {
190  CDFS4_FORE = 0x1,
191  CDFS4_BACK = 0x2,
192  CDFS4_BOTH = 0x3
193 };

◆ createmode4

Enumerator
UNCHECKED4 
GUARDED4 
EXCLUSIVE4 
EXCLUSIVE4_1 

Definition at line 539 of file nfs41_ops.h.

539  {
540  UNCHECKED4 = 0,
541  GUARDED4 = 1,
542  EXCLUSIVE4 = 2,
543  EXCLUSIVE4_1 = 3
544 };

◆ nfs_opnum4

Enumerator
OP_ACCESS 
OP_CLOSE 
OP_COMMIT 
OP_CREATE 
OP_DELEGPURGE 
OP_DELEGRETURN 
OP_GETATTR 
OP_GETFH 
OP_LINK 
OP_LOCK 
OP_LOCKT 
OP_LOCKU 
OP_LOOKUP 
OP_LOOKUPP 
OP_NVERIFY 
OP_OPEN 
OP_OPENATTR 
OP_OPEN_CONFIRM 
OP_OPEN_DOWNGRADE 
OP_PUTFH 
OP_PUTPUBFH 
OP_PUTROOTFH 
OP_READ 
OP_READDIR 
OP_READLINK 
OP_REMOVE 
OP_RENAME 
OP_RENEW 
OP_RESTOREFH 
OP_SAVEFH 
OP_SECINFO 
OP_SETATTR 
OP_SETCLIENTID 
OP_SETCLIENTID_CONFIRM 
OP_VERIFY 
OP_WRITE 
OP_RELEASE_LOCKOWNER 
OP_BACKCHANNEL_CTL 
OP_BIND_CONN_TO_SESSION 
OP_EXCHANGE_ID 
OP_CREATE_SESSION 
OP_DESTROY_SESSION 
OP_FREE_STATEID 
OP_GET_DIR_DELEGATION 
OP_GETDEVICEINFO 
OP_GETDEVICELIST 
OP_LAYOUTCOMMIT 
OP_LAYOUTGET 
OP_LAYOUTRETURN 
OP_SECINFO_NO_NAME 
OP_SEQUENCE 
OP_SET_SSV 
OP_TEST_STATEID 
OP_WANT_DELEGATION 
OP_DESTROY_CLIENTID 
OP_RECLAIM_COMPLETE 
OP_ILLEGAL 

Definition at line 30 of file nfs41_ops.h.

30  {
31  OP_ACCESS = 3,
32  OP_CLOSE = 4,
33  OP_COMMIT = 5,
34  OP_CREATE = 6,
35  OP_DELEGPURGE = 7,
36  OP_DELEGRETURN = 8,
37  OP_GETATTR = 9,
38  OP_GETFH = 10,
39  OP_LINK = 11,
40  OP_LOCK = 12,
41  OP_LOCKT = 13,
42  OP_LOCKU = 14,
43  OP_LOOKUP = 15,
44  OP_LOOKUPP = 16,
45  OP_NVERIFY = 17,
46  OP_OPEN = 18,
47  OP_OPENATTR = 19,
48  OP_OPEN_CONFIRM = 20, /* Mandatory not-to-implement */
49  OP_OPEN_DOWNGRADE = 21,
50  OP_PUTFH = 22,
51  OP_PUTPUBFH = 23,
52  OP_PUTROOTFH = 24,
53  OP_READ = 25,
54  OP_READDIR = 26,
55  OP_READLINK = 27,
56  OP_REMOVE = 28,
57  OP_RENAME = 29,
58  OP_RENEW = 30, /* Mandatory not-to-implement */
59  OP_RESTOREFH = 31,
60  OP_SAVEFH = 32,
61  OP_SECINFO = 33,
62  OP_SETATTR = 34,
63  OP_SETCLIENTID = 35, /* Mandatory not-to-implement */
64  OP_SETCLIENTID_CONFIRM = 36, /* Mandatory not-to-implement */
65  OP_VERIFY = 37,
66  OP_WRITE = 38,
67  OP_RELEASE_LOCKOWNER = 39, /* Mandatory not-to-implement */
68 
69  /* new operations for NFSv4.1 */
70  OP_BACKCHANNEL_CTL = 40,
72  OP_EXCHANGE_ID = 42,
73  OP_CREATE_SESSION = 43,
74  OP_DESTROY_SESSION = 44,
75  OP_FREE_STATEID = 45,
77  OP_GETDEVICEINFO = 47,
78  OP_GETDEVICELIST = 48,
79  OP_LAYOUTCOMMIT = 49,
80  OP_LAYOUTGET = 50,
81  OP_LAYOUTRETURN = 51,
82  OP_SECINFO_NO_NAME = 52,
83  OP_SEQUENCE = 53,
84  OP_SET_SSV = 54,
85  OP_TEST_STATEID = 55,
86  OP_WANT_DELEGATION = 56,
89  OP_ILLEGAL = 10044
90 };

◆ open_claim_type4

Enumerator
CLAIM_NULL 
CLAIM_PREVIOUS 
CLAIM_DELEGATE_CUR 
CLAIM_DELEGATE_PREV 
CLAIM_FH 
CLAIM_DELEG_CUR_FH 
CLAIM_DELEG_PREV_FH 

Definition at line 592 of file nfs41_ops.h.

◆ open_delegation_type4

Enumerator
OPEN_DELEGATE_NONE 
OPEN_DELEGATE_READ 
OPEN_DELEGATE_WRITE 
OPEN_DELEGATE_NONE_EXT 

Definition at line 585 of file nfs41_ops.h.

◆ opentype4

Enumerator
OPEN4_NOCREATE 
OPEN4_CREATE 

Definition at line 552 of file nfs41_ops.h.

552  {
553  OPEN4_NOCREATE = 0,
554  OPEN4_CREATE = 1
555 };

◆ sec_flavor

Enumerator
RPC_GSS_SVC_NONE 
RPC_GSS_SVC_INTEGRITY 
RPC_GSS_SVC_PRIVACY 

Definition at line 861 of file nfs41_ops.h.

◆ secinfo_no_name_type

Enumerator
SECINFO_STYLE4_CURRENT_FH 
SECINFO_STYLE4_PARENT 

Definition at line 884 of file nfs41_ops.h.

◆ stable_how4

Enumerator
UNSTABLE4 
DATA_SYNC4 
FILE_SYNC4 

Definition at line 835 of file nfs41_ops.h.

835  {
836  UNSTABLE4 = 0,
837  DATA_SYNC4 = 1,
838  FILE_SYNC4 = 2
839 };

◆ state_protect_how4

Enumerator
SP4_NONE 
SP4_MACH_CRED 
SP4_SSV 

Definition at line 110 of file nfs41_ops.h.

110  {
111  SP4_NONE = 0,
112  SP4_MACH_CRED = 1,
113  SP4_SSV = 2
state_protect_how4
Definition: nfs41_ops.h:110

◆ stateid_type

Enumerator
STATEID_OPEN 
STATEID_LOCK 
STATEID_DELEG_FILE 
STATEID_DELEG_DIR 
STATEID_LAYOUT 
STATEID_SPECIAL 

Definition at line 275 of file nfs41_ops.h.

◆ time_how4

Enumerator
SET_TO_SERVER_TIME4 
SET_TO_CLIENT_TIME4 

Definition at line 776 of file nfs41_ops.h.

◆ why_no_delegation4

Enumerator
WND4_NOT_WANTED 
WND4_CONTENTION 
WND4_RESOURCE 
WND4_NOT_SUPP_FTYPE 
WND4_WRITE_DELEG_NOT_SUPP_FTYPE 
WND4_NOT_SUPP_UPGRADE 
WND4_NOT_SUPP_DOWNGRADE 
WND4_CANCELED 
WND4_IS_DIR 

Definition at line 602 of file nfs41_ops.h.

Function Documentation

◆ nfs41_access()

int nfs41_access ( IN nfs41_session session,
IN nfs41_path_fh file,
IN uint32_t  requested,
OUT uint32_t *supported  OPTIONAL,
OUT uint32_t *access  OPTIONAL 
)

Definition at line 1554 of file nfs41_ops.c.

Referenced by check_execute_access().

1560 {
1561  int status;
1562  nfs41_compound compound;
1563  nfs_argop4 argops[3];
1564  nfs_resop4 resops[3];
1565  nfs41_sequence_args sequence_args;
1566  nfs41_sequence_res sequence_res;
1567  nfs41_putfh_args putfh_args;
1568  nfs41_putfh_res putfh_res;
1569  nfs41_access_args access_args;
1571 
1572  compound_init(&compound, argops, resops, "access");
1573 
1574  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1575  nfs41_session_sequence(&sequence_args, session, 0);
1576 
1577  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1578  putfh_args.file = file;
1579  putfh_args.in_recovery = 0;
1580 
1581  compound_add_op(&compound, OP_ACCESS, &access_args, &access_res);
1582  access_args.access = requested;
1583 
1584  status = compound_encode_send_decode(session, &compound, TRUE);
1585  if (status)
1586  goto out;
1587 
1588  if (compound_error(status = compound.res.status))
1589  goto out;
1590 
1591  if (supported)
1592  *supported = access_res.supported;
1593  if (access)
1594  *access = access_res.access;
1595 out:
1596  return status;
1597 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
nfs41_compound_res res
int compound_error(int status)
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
uint32_t supported
Definition: nfs41_ops.h:308
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_bind_conn_to_session()

enum nfsstat4 nfs41_bind_conn_to_session ( IN nfs41_rpc_clnt rpc,
IN const unsigned char sessionid,
IN enum channel_dir_from_client4  dir 
)

Definition at line 185 of file nfs41_ops.c.

Referenced by compound_encode_send_decode(), and rpc_reconnect().

189 {
190  int status;
191  nfs41_compound compound;
192  nfs_argop4 argop;
193  nfs_resop4 resop;
194  nfs41_bind_conn_to_session_args bind_args = { 0 };
195  nfs41_bind_conn_to_session_res bind_res = { 0 };
196 
197  compound_init(&compound, &argop, &resop, "bind_conn_to_session");
198 
199  compound_add_op(&compound, OP_BIND_CONN_TO_SESSION, &bind_args, &bind_res);
200  bind_args.sessionid = (unsigned char *)sessionid;
201  bind_args.dir = dir;
202 
203  status = nfs41_send_compound(rpc,
204  (char*)&compound.args, (char*)&compound.res);
205  if (status)
206  goto out;
207 
208  compound_error(status = compound.res.status);
209 
210 out:
211  return status;
212 }
enum channel_dir_from_client4 dir
Definition: nfs41_ops.h:197
nfs41_compound_res res
unsigned int dir
Definition: maze.c:112
nfs41_compound_args args
int compound_error(int status)
int nfs41_send_compound(IN nfs41_rpc_clnt *rpc, IN char *inbuf, OUT char *outbuf)
Definition: nfs41_rpc.c:337
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_cached_getattr()

int nfs41_cached_getattr ( IN nfs41_session session,
IN nfs41_path_fh file,
OUT nfs41_file_info info 
)

Definition at line 32 of file getattr.c.

Referenced by handle_getattr(), and readdir_add_dots().

36 {
37  int status;
38 
39  /* first look for cached attributes */
41  file->fh.fileid, info);
42 
43  if (status) {
44  /* fetch attributes from the server */
45  bitmap4 attr_request;
46  nfs41_superblock_getattr_mask(file->fh.superblock, &attr_request);
47 
48  status = nfs41_getattr(session, file, &attr_request, info);
49  if (status) {
50  eprintf("nfs41_getattr() failed with %s\n",
51  nfs_error_string(status));
52  status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
53  }
54  }
55  return status;
56 }
int nfs_to_windows_error(int status, int default_error)
Definition: util.c:235
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
#define ERROR_BAD_NET_RESP
Definition: winerror.h:150
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
int nfs41_getattr(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
Definition: nfs41_ops.c:1063
const char * nfs_error_string(int status)
Definition: daemon_debug.c:370
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
int nfs41_attr_cache_lookup(IN struct nfs41_name_cache *cache, IN uint64_t fileid, OUT nfs41_file_info *info_out)
Definition: name_cache.c:859
static SERVICE_STATUS status
Definition: service.c:31
Definition: fci.c:126

◆ nfs41_close()

int nfs41_close ( IN nfs41_session session,
IN nfs41_path_fh file,
IN stateid_arg stateid 
)

Definition at line 627 of file nfs41_ops.c.

Referenced by cancel_open(), do_nfs41_close(), get_ea_value(), recover_delegation_open(), and set_ea_value().

631 {
632  int status;
633  nfs41_compound compound;
634  nfs_argop4 argops[4];
635  nfs_resop4 resops[4];
636  nfs41_sequence_args sequence_args;
637  nfs41_sequence_res sequence_res;
638  nfs41_putfh_args putfh_args;
639  nfs41_putfh_res putfh_res;
640  nfs41_op_close_args close_args;
641  nfs41_op_close_res close_res;
642  nfs41_getattr_args getattr_args;
643  nfs41_getattr_res getattr_res;
644  bitmap4 attr_request;
646 
647  nfs41_superblock_getattr_mask(file->fh.superblock, &attr_request);
648 
649  compound_init(&compound, argops, resops, "close");
650 
651  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
652  nfs41_session_sequence(&sequence_args, session, 1);
653 
654  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
655  putfh_args.file = file;
656  putfh_args.in_recovery = 0;
657 
658  compound_add_op(&compound, OP_CLOSE, &close_args, &close_res);
659  close_args.stateid = stateid;
660 
661  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
662  getattr_args.attr_request = &attr_request;
664  getattr_res.info = &info;
665 
666  status = compound_encode_send_decode(session, &compound, TRUE);
667  if (status)
668  goto out;
669 
670  if (compound_error(status = compound.res.status))
671  goto out;
672 
673  if (info.type == NF4NAMEDATTR)
674  goto out;
675 
676  /* update the attributes of the parent directory */
677  memcpy(&info.attrmask, &getattr_res.obj_attributes.attrmask,
678  sizeof(bitmap4));
680  file->fh.fileid, &info);
681 out:
682  return status;
683 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
stateid_arg * stateid
Definition: nfs41_ops.h:316
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
bitmap4 attrmask
Definition: nfs41_types.h:160
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
int compound_error(int status)
int nfs41_attr_cache_update(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const nfs41_file_info *info)
Definition: name_cache.c:891
nfs41_file_info * info
Definition: nfs41_ops.h:534
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
Definition: fci.c:126

◆ nfs41_commit()

int nfs41_commit ( IN nfs41_session session,
IN nfs41_path_fh file,
IN uint64_t  offset,
IN uint32_t  count,
IN bool_t  do_getattr,
OUT nfs41_write_verf verf,
OUT nfs41_file_info cinfo 
)

Definition at line 833 of file nfs41_ops.c.

Referenced by file_layout_write_thread(), mds_commit(), and write_to_mds().

841 {
842  int status;
843  nfs41_compound compound;
844  nfs_argop4 argops[4];
845  nfs_resop4 resops[4];
846  nfs41_sequence_args sequence_args;
847  nfs41_sequence_res sequence_res;
848  nfs41_putfh_args putfh_args;
849  nfs41_putfh_res putfh_res;
850  nfs41_commit_args commit_args;
851  nfs41_commit_res commit_res;
852  nfs41_getattr_args getattr_args;
853  nfs41_getattr_res getattr_res = {0};
854  bitmap4 attr_request;
855  nfs41_file_info info, *pinfo;
856 
857  compound_init(&compound, argops, resops,
858  do_getattr ? "commit" : "ds commit");
859 
860  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
861  nfs41_session_sequence(&sequence_args, session, 1);
862 
863  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
864  putfh_args.file = file;
865  putfh_args.in_recovery = 0;
866 
867  compound_add_op(&compound, OP_COMMIT, &commit_args, &commit_res);
868  commit_args.offset = offset;
869  commit_args.count = count;
870  commit_res.verf = verf;
871 
872  /* send a GETATTR request to update the attribute cache,
873  * but not if we're talking to a data server! */
874  if (cinfo) pinfo = cinfo;
875  else pinfo = &info;
876  if (do_getattr) {
877  nfs41_superblock_getattr_mask(file->fh.superblock, &attr_request);
878 
879  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
880  getattr_args.attr_request = &attr_request;
882  getattr_res.info = pinfo;
883  }
884 
885  status = compound_encode_send_decode(session, &compound, TRUE);
886  if (status)
887  goto out;
888 
889  if (compound_error(status = compound.res.status))
890  goto out;
891 
892  if (do_getattr) {
893  /* update the attribute cache */
894  memcpy(&pinfo->attrmask, &getattr_res.obj_attributes.attrmask,
895  sizeof(bitmap4));
897  file->fh.fileid, pinfo);
898  }
899  nfs41_superblock_space_changed(file->fh.superblock);
900 out:
901  return status;
902 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
GLintptr offset
Definition: glext.h:5920
bitmap4 attrmask
Definition: nfs41_types.h:160
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
void nfs41_superblock_space_changed(IN nfs41_superblock *superblock)
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
int compound_error(int status)
int nfs41_attr_cache_update(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const nfs41_file_info *info)
Definition: name_cache.c:891
nfs41_file_info * info
Definition: nfs41_ops.h:534
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
nfs41_write_verf * verf
Definition: nfs41_ops.h:332
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
Definition: fci.c:126

◆ nfs41_create()

int nfs41_create ( IN nfs41_session session,
IN uint32_t  type,
IN nfs41_file_info createattrs,
IN OPTIONAL const char symlink,
IN nfs41_path_fh parent,
OUT nfs41_path_fh file,
OUT nfs41_file_info info 
)

Definition at line 530 of file nfs41_ops.c.

Referenced by handle_open(), and handle_symlink().

538 {
539  int status;
540  nfs41_compound compound;
541  nfs_argop4 argops[8];
542  nfs_resop4 resops[8];
543  nfs41_sequence_args sequence_args;
544  nfs41_sequence_res sequence_res;
545  nfs41_putfh_args putfh_args;
546  nfs41_putfh_res putfh_res;
547  nfs41_create_args create_args;
548  nfs41_create_res create_res;
549  nfs41_getfh_res getfh_res;
550  nfs41_getattr_args getattr_args;
551  nfs41_getattr_res getattr_res, pgetattr_res;
552  bitmap4 attr_request;
553  nfs41_file_info dir_info;
554  nfs41_savefh_res savefh_res;
555  nfs41_restorefh_res restorefh_res;
556 
557  nfs41_superblock_getattr_mask(parent->fh.superblock, &attr_request);
558 
559  compound_init(&compound, argops, resops, "create");
560 
561  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
562  nfs41_session_sequence(&sequence_args, session, 1);
563 
564  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
565  putfh_args.file = parent;
566  putfh_args.in_recovery = 0;
567 
568  compound_add_op(&compound, OP_SAVEFH, NULL, &savefh_res);
569 
570  compound_add_op(&compound, OP_CREATE, &create_args, &create_res);
571  create_args.objtype.type = type;
572  if (type == NF4LNK) {
573  create_args.objtype.u.lnk.linkdata = symlink;
574  create_args.objtype.u.lnk.linkdata_len = (uint32_t)strlen(symlink);
575  }
576  create_args.name = &file->name;
577  create_args.createattrs = createattrs;
579  parent->fh.superblock, &createattrs->attrmask);
580 
581  compound_add_op(&compound, OP_GETFH, NULL, &getfh_res);
582  getfh_res.fh = &file->fh;
583 
584  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
585  getattr_args.attr_request = &attr_request;
587  getattr_res.info = info;
588 
589  compound_add_op(&compound, OP_RESTOREFH, NULL, &restorefh_res);
590 
591  compound_add_op(&compound, OP_GETATTR, &getattr_args, &pgetattr_res);
592  getattr_args.attr_request = &attr_request;
594  pgetattr_res.info = &dir_info;
595 
596  status = compound_encode_send_decode(session, &compound, TRUE);
597  if (status)
598  goto out;
599 
600  if (compound_error(status = compound.res.status))
601  goto out;
602 
603  /* fill in the file handle's fileid and superblock */
604  file->fh.fileid = info->fileid;
605  file->fh.superblock = parent->fh.superblock;
606 
607  /* update the attributes of the parent directory */
608  memcpy(&dir_info.attrmask, &pgetattr_res.obj_attributes.attrmask,
609  sizeof(bitmap4));
611  parent->fh.fileid, &dir_info);
612 
613  /* add the new file handle and attributes to the name cache */
614  memcpy(&info->attrmask, &getattr_res.obj_attributes.attrmask,
615  sizeof(bitmap4));
616  AcquireSRWLockShared(&file->path->lock);
618  file->path->path, &file->name, &file->fh,
619  info, &create_res.cinfo, OPEN_DELEGATE_NONE);
620  ReleaseSRWLockShared(&file->path->lock);
621 
622  nfs41_superblock_space_changed(file->fh.superblock);
623 out:
624  return status;
625 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
nfs41_fh * fh
Definition: nfs41_ops.h:504
#define TRUE
Definition: types.h:120
change_info4 cinfo
Definition: nfs41_ops.h:364
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
uint32_t type
Definition: nfs41_ops.h:343
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
struct __createtype4::@37::__create_type_lnk lnk
const nfs41_component * name
Definition: nfs41_ops.h:357
nfs41_file_info * createattrs
Definition: nfs41_ops.h:358
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
bitmap4 attrmask
Definition: nfs41_types.h:160
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
char name[1]
Definition: fci.c:135
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
int nfs41_name_cache_insert(IN struct nfs41_name_cache *cache, IN const char *path, IN const nfs41_component *name, IN OPTIONAL const nfs41_fh *fh, IN OPTIONAL const nfs41_file_info *info, IN OPTIONAL const change_info4 *cinfo, IN enum open_delegation_type4 delegation)
Definition: name_cache.c:923
void nfs41_superblock_space_changed(IN nfs41_superblock *superblock)
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
smooth NULL
Definition: ftsmooth.c:416
static __inline void nfs41_superblock_supported_attrs(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
Definition: nfs41.h:454
union __createtype4::@37 u
int compound_error(int status)
int nfs41_attr_cache_update(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const nfs41_file_info *info)
Definition: name_cache.c:891
r parent
Definition: btrfs.c:2644
nfs41_file_info * info
Definition: nfs41_ops.h:534
static FILE * out
Definition: regtests2xml.c:44
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
createtype4 objtype
Definition: nfs41_ops.h:356
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
WCHAR * path
Definition: filesystem.c:121
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
#define uint32_t
Definition: nsiface.idl:61
static SERVICE_STATUS status
Definition: service.c:31
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89
Definition: fci.c:126

◆ nfs41_create_session()

int nfs41_create_session ( IN nfs41_client clnt,
OUT nfs41_session session,
IN bool_t  try_recovery 
)

◆ nfs41_delegpurge()

int nfs41_delegpurge ( IN nfs41_session session)

Definition at line 1666 of file nfs41_ops.c.

Referenced by nfs41_client_delegation_recovery().

1668 {
1669  int status;
1670  nfs41_compound compound;
1671  nfs_argop4 argops[2];
1672  nfs_resop4 resops[2];
1673  nfs41_sequence_args sequence_args;
1674  nfs41_sequence_res sequence_res;
1675  nfs41_delegpurge_res dp_res;
1676 
1677  compound_init(&compound, argops, resops, "delegpurge");
1678 
1679  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1680  nfs41_session_sequence(&sequence_args, session, 0);
1681 
1682  compound_add_op(&compound, OP_DELEGPURGE, NULL, &dp_res);
1683 
1684  status = compound_encode_send_decode(session, &compound, TRUE);
1685  if (status)
1686  goto out;
1687 
1688  compound_error(status = compound.res.status);
1689 out:
1690  return status;
1691 }
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
nfs41_compound_res res
smooth NULL
Definition: ftsmooth.c:416
int compound_error(int status)
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_delegreturn()

int nfs41_delegreturn ( IN nfs41_session session,
IN nfs41_path_fh file,
IN stateid_arg stateid,
IN bool_t  try_recovery 
)

Definition at line 1693 of file nfs41_ops.c.

Referenced by delegation_return(), nfs41_delegation_granted(), and open_delegation_return().

1698 {
1699  int status;
1700  nfs41_compound compound;
1701  nfs_argop4 argops[3];
1702  nfs_resop4 resops[3];
1703  nfs41_sequence_args sequence_args;
1704  nfs41_sequence_res sequence_res;
1705  nfs41_putfh_args putfh_args;
1706  nfs41_putfh_res putfh_res;
1707  nfs41_delegreturn_args dr_args;
1708  nfs41_delegreturn_res dr_res;
1709 
1710  compound_init(&compound, argops, resops, "delegreturn");
1711 
1712  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1713  nfs41_session_sequence(&sequence_args, session, 0);
1714 
1715  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1716  putfh_args.file = file;
1717  putfh_args.in_recovery = 0;
1718 
1719  compound_add_op(&compound, OP_DELEGRETURN, &dr_args, &dr_res);
1720  dr_args.stateid = stateid;
1721 
1722  status = compound_encode_send_decode(session, &compound, try_recovery);
1723  if (status)
1724  goto out;
1725 
1726  if (compound_error(status = compound.res.status))
1727  goto out;
1728 
1729  AcquireSRWLockShared(&file->path->lock);
1731  file->fh.fileid, file->path->path, &file->name);
1732  ReleaseSRWLockShared(&file->path->lock);
1733 out:
1734  return status;
1735 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
char name[1]
Definition: fci.c:135
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
stateid_arg * stateid
Definition: nfs41_ops.h:377
int compound_error(int status)
int nfs41_name_cache_delegreturn(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const char *path, IN const nfs41_component *name)
Definition: name_cache.c:1012
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
WCHAR * path
Definition: filesystem.c:121
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89
Definition: fci.c:126

◆ nfs41_destroy_clientid()

int nfs41_destroy_clientid ( IN nfs41_rpc_clnt rpc,
IN uint64_t  clientid 
)

Definition at line 242 of file nfs41_ops.c.

Referenced by nfs41_client_free().

245 {
246  int status;
247  nfs41_compound compound;
248  nfs_argop4 argops;
249  nfs_resop4 resops;
252 
253  compound_init(&compound, &argops, &resops, "destroy_clientid");
254 
255  compound_add_op(&compound, OP_DESTROY_CLIENTID, &dc_args, &dc_res);
256  dc_args.dca_clientid = clientid;
257 
258  status = nfs41_send_compound(rpc, (char *)&compound.args,
259  (char *)&compound.res);
260  if (status)
261  goto out;
262 
263  compound_error(status = compound.res.status);
264 out:
265  return status;
266 }
nfs41_compound_res res
nfs41_compound_args args
int compound_error(int status)
int nfs41_send_compound(IN nfs41_rpc_clnt *rpc, IN char *inbuf, OUT char *outbuf)
Definition: nfs41_rpc.c:337
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_destroy_session()

int nfs41_destroy_session ( IN nfs41_session session)

Definition at line 214 of file nfs41_ops.c.

Referenced by nfs41_session_free().

216 {
217  int status;
218  nfs41_compound compound;
219  nfs_argop4 argop;
220  nfs_resop4 resop;
223 
224  compound_init(&compound, &argop, &resop, "destroy_session");
225 
226  compound_add_op(&compound, OP_DESTROY_SESSION, &ds_args, &ds_res);
227  ds_args.dsa_sessionid = session->session_id;
228 
229  /* don't attempt to recover from BADSESSION/STALE_CLIENTID */
230  status = compound_encode_send_decode(session, &compound, FALSE);
231  if (status)
232  goto out;
233 
234  status = compound.res.status;
235  if (status)
236  eprintf("%s failed with status %d.\n",
238 out:
239  return status;
240 }
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
unsigned char * dsa_sessionid
Definition: nfs41_ops.h:209
nfs41_compound_res res
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
const char * nfs_opnum_to_string(int opnum)
Definition: daemon_debug.c:305
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_exchange_id()

int nfs41_exchange_id ( IN nfs41_rpc_clnt rpc,
IN client_owner4 owner,
IN uint32_t  flags_in,
OUT nfs41_exchange_id_res res_out 
)

Definition at line 36 of file nfs41_ops.c.

Referenced by nfs41_client_renew(), and nfs41_root_mount_addrs().

41 {
42  int status = 0;
43  nfs41_compound compound;
44  nfs_argop4 argop;
45  nfs_resop4 resop;
47 
48  compound_init(&compound, &argop, &resop, "exchange_id");
49 
50  compound_add_op(&compound, OP_EXCHANGE_ID, &ex_id, res_out);
51  ex_id.eia_clientowner = owner;
52  ex_id.eia_flags = flags_in;
54  ex_id.eia_client_impl_id = NULL;
55 
56  res_out->server_owner.so_major_id_len = NFS4_OPAQUE_LIMIT;
57  res_out->server_scope_len = NFS4_OPAQUE_LIMIT;
58 
59  status = nfs41_send_compound(rpc, (char *)&compound.args,
60  (char *)&compound.res);
61  if (status)
62  goto out;
63 
64  compound_error(status = compound.res.status);
65 out:
66  return status;
67 }
nfs_impl_id4 * eia_client_impl_id
Definition: nfs41_ops.h:124
nfs41_compound_res res
client_owner4 * eia_clientowner
Definition: nfs41_ops.h:121
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
smooth NULL
Definition: ftsmooth.c:416
nfs41_compound_args args
int compound_error(int status)
int nfs41_send_compound(IN nfs41_rpc_clnt *rpc, IN char *inbuf, OUT char *outbuf)
Definition: nfs41_rpc.c:337
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
state_protect_how4 spa_how
Definition: nfs41_ops.h:117
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
state_protect4_a eia_state_protect
Definition: nfs41_ops.h:123
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ nfs41_free_stateid()

enum nfsstat4 nfs41_free_stateid ( IN nfs41_session session,
IN stateid4 stateid 
)

Definition at line 1870 of file nfs41_ops.c.

Referenced by nfs41_client_state_revoked().

1873 {
1874  enum nfsstat4 status;
1875  nfs41_compound compound;
1876  nfs_argop4 argops[2];
1877  nfs_resop4 resops[2];
1878  nfs41_sequence_args sequence_args;
1879  nfs41_sequence_res sequence_res;
1880  nfs41_free_stateid_args freestateid_args;
1881  nfs41_free_stateid_res freestateid_res;
1882 
1883  compound_init(&compound, argops, resops, "free_stateid");
1884 
1885  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1886  nfs41_session_sequence(&sequence_args, session, 0);
1887 
1888  compound_add_op(&compound, OP_FREE_STATEID, &freestateid_args, &freestateid_res);
1889  freestateid_args.stateid = stateid;
1890 
1891  status = compound_encode_send_decode(session, &compound, FALSE);
1892  if (status)
1893  goto out;
1894 
1895  compound_error(status = compound.res.status);
1896 out:
1897  return status;
1898 }
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
nfs41_compound_res res
int compound_error(int status)
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
nfsstat4
Definition: nfs41_const.h:86
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_fs_locations()

enum nfsstat4 nfs41_fs_locations ( IN nfs41_session session,
IN nfs41_path_fh parent,
IN const nfs41_component name,
OUT fs_locations4 locations 
)

Definition at line 1737 of file nfs41_ops.c.

Referenced by referral_resolve().

1742 {
1743  enum nfsstat4 status;
1744  nfs41_compound compound;
1745  nfs_argop4 argops[4];
1746  nfs_resop4 resops[4];
1747  nfs41_sequence_args sequence_args;
1748  nfs41_sequence_res sequence_res;
1749  nfs41_putfh_args putfh_args;
1750  nfs41_putfh_res putfh_res;
1751  nfs41_lookup_args lookup_args;
1752  nfs41_lookup_res lookup_res;
1753  nfs41_getattr_args getattr_args;
1754  nfs41_getattr_res getattr_res;
1755  bitmap4 attr_request = { 1, { FATTR4_WORD0_FS_LOCATIONS } };
1757 
1758  compound_init(&compound, argops, resops, "fs_locations");
1759 
1760  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1761  nfs41_session_sequence(&sequence_args, session, 0);
1762 
1763  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1764  putfh_args.file = parent;
1765  putfh_args.in_recovery = 0;
1766 
1767  compound_add_op(&compound, OP_LOOKUP, &lookup_args, &lookup_res);
1768  lookup_args.name = name;
1769 
1770  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
1771  getattr_args.attr_request = &attr_request;
1772  info.fs_locations = locations;
1774  getattr_res.info = &info;
1775 
1776  status = compound_encode_send_decode(session, &compound, TRUE);
1777  if (status)
1778  goto out;
1779 
1780  compound_error(status = compound.res.status);
1781 out:
1782  return status;
1783 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
fs_locations4 * fs_locations
Definition: nfs41_types.h:232
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
nfs41_compound_res res
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
int compound_error(int status)
r parent
Definition: btrfs.c:2644
nfs41_file_info * info
Definition: nfs41_ops.h:534
static FILE * out
Definition: regtests2xml.c:44
const nfs41_component * name
Definition: nfs41_ops.h:492
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
nfsstat4
Definition: nfs41_const.h:86
GLsizei const GLint * locations
Definition: glext.h:10542
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
GLuint const GLchar * name
Definition: glext.h:6031

◆ nfs41_getattr()

int nfs41_getattr ( IN nfs41_session session,
IN OPTIONAL nfs41_path_fh file,
IN bitmap4 attr_request,
OUT nfs41_file_info info 
)

Definition at line 1063 of file nfs41_ops.c.

Referenced by get_volume_size_info(), handle_getacl(), nfs41_cached_getattr(), pnfs_write(), session_get_lease(), and write_to_mds().

1068 {
1069  int status;
1070  nfs41_compound compound;
1071  nfs_argop4 argops[3];
1072  nfs_resop4 resops[3];
1073  nfs41_sequence_args sequence_args;
1074  nfs41_sequence_res sequence_res;
1075  nfs41_putfh_args putfh_args;
1076  nfs41_putfh_res putfh_res;
1077  nfs41_getattr_args getattr_args;
1078  nfs41_getattr_res getattr_res;
1079 
1080  compound_init(&compound, argops, resops, "getattr");
1081 
1082  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1083  nfs41_session_sequence(&sequence_args, session, 0);
1084 
1085  if (file) {
1086  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1087  putfh_args.file = file;
1088  putfh_args.in_recovery = 0;
1089  } else {
1090  compound_add_op(&compound, OP_PUTROOTFH, NULL, &putfh_res);
1091  }
1092 
1093  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
1094  getattr_args.attr_request = attr_request;
1096  getattr_res.info = info;
1097 
1098  status = compound_encode_send_decode(session, &compound, TRUE);
1099  if (status)
1100  goto out;
1101 
1102  if (compound_error(status = compound.res.status))
1103  goto out;
1104 
1105  if (file) {
1106  /* update the name cache with whatever attributes we got */
1107  memcpy(&info->attrmask, &getattr_res.obj_attributes.attrmask,
1108  sizeof(bitmap4));
1110  file->fh.fileid, info);
1111  }
1112 out:
1113  return status;
1114 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
bitmap4 attrmask
Definition: nfs41_types.h:160
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
smooth NULL
Definition: ftsmooth.c:416
int compound_error(int status)
int nfs41_attr_cache_update(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const nfs41_file_info *info)
Definition: name_cache.c:891
nfs41_file_info * info
Definition: nfs41_ops.h:534
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
Definition: fci.c:126

◆ nfs41_link()

int nfs41_link ( IN nfs41_session session,
IN nfs41_path_fh src,
IN nfs41_path_fh dst_dir,
IN const nfs41_component target,
OUT nfs41_file_info cinfo 
)

Definition at line 1407 of file nfs41_ops.c.

1413 {
1414  int status;
1415  nfs41_compound compound;
1416  nfs_argop4 argops[9];
1417  nfs_resop4 resops[9];
1418  nfs41_sequence_args sequence_args;
1419  nfs41_sequence_res sequence_res;
1420  nfs41_putfh_args putfh_args[2];
1421  nfs41_putfh_res putfh_res[2];
1422  nfs41_savefh_res savefh_res;
1423  nfs41_link_args link_args;
1424  nfs41_link_res link_res;
1425  nfs41_lookup_args lookup_args;
1426  nfs41_lookup_res lookup_res;
1427  nfs41_getfh_res getfh_res;
1428  nfs41_getattr_args getattr_args[2];
1429  nfs41_getattr_res getattr_res[2];
1430  nfs41_file_info info = { 0 };
1432 
1433  nfs41_superblock_getattr_mask(src->fh.superblock, &info.attrmask);
1434  nfs41_superblock_getattr_mask(dst_dir->fh.superblock, &cinfo->attrmask);
1435  cinfo->attrmask.arr[0] |= FATTR4_WORD0_FSID;
1436 
1437  compound_init(&compound, argops, resops, "link");
1438 
1439  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1440  nfs41_session_sequence(&sequence_args, session, 1);
1441 
1442  /* PUTFH(src) */
1443  compound_add_op(&compound, OP_PUTFH, &putfh_args[0], &putfh_res[0]);
1444  putfh_args[0].file = src;
1445  putfh_args[0].in_recovery = 0;
1446 
1447  compound_add_op(&compound, OP_SAVEFH, NULL, &savefh_res);
1448 
1449  /* PUTFH(dst_dir) */
1450  compound_add_op(&compound, OP_PUTFH, &putfh_args[1], &putfh_res[1]);
1451  putfh_args[1].file = dst_dir;
1452  putfh_args[1].in_recovery = 0;
1453 
1454  compound_add_op(&compound, OP_LINK, &link_args, &link_res);
1455  link_args.newname = target;
1456 
1457  /* GETATTR(dst_dir) */
1458  compound_add_op(&compound, OP_GETATTR, &getattr_args[0], &getattr_res[0]);
1459  getattr_args[0].attr_request = &info.attrmask;
1461  getattr_res[0].info = &info;
1462 
1463  /* LOOKUP(target) */
1464  compound_add_op(&compound, OP_LOOKUP, &lookup_args, &lookup_res);
1465  lookup_args.name = target;
1466 
1467  /* GETATTR(target) */
1468  compound_add_op(&compound, OP_GETATTR, &getattr_args[1], &getattr_res[1]);
1469  getattr_args[1].attr_request = &cinfo->attrmask;
1471  getattr_res[1].info = cinfo;
1472 
1473  /* GETFH(target) */
1474  compound_add_op(&compound, OP_GETFH, NULL, &getfh_res);
1475  getfh_res.fh = &file.fh;
1476 
1477  status = compound_encode_send_decode(session, &compound, TRUE);
1478  if (status)
1479  goto out;
1480 
1481  if (compound_error(status = compound.res.status))
1482  goto out;
1483 
1484  /* fill in the file handle's fileid and superblock */
1485  file.fh.fileid = cinfo->fileid;
1486  status = nfs41_superblock_for_fh(session,
1487  &cinfo->fsid, &dst_dir->fh, &file);
1488  if (status)
1489  goto out;
1490 
1491  /* update the attributes of the destination directory */
1492  memcpy(&info.attrmask, &getattr_res[0].obj_attributes.attrmask,
1493  sizeof(bitmap4));
1495  info.fileid, &info);
1496 
1497  /* add the new file handle and attributes to the name cache */
1498  memcpy(&cinfo->attrmask, &getattr_res[1].obj_attributes.attrmask,
1499  sizeof(bitmap4));
1500  AcquireSRWLockShared(&dst_dir->path->lock);
1502  dst_dir->path->path, target, &file.fh,
1503  cinfo, &link_res.cinfo, OPEN_DELEGATE_NONE);
1504  ReleaseSRWLockShared(&dst_dir->path->lock);
1505 
1506  nfs41_superblock_space_changed(dst_dir->fh.superblock);
1507 out:
1508  return status;
1509 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
nfs41_fh * fh
Definition: nfs41_ops.h:504
#define TRUE
Definition: types.h:120
uint64_t fileid
Definition: nfs41_types.h:55
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
bitmap4 attrmask
Definition: nfs41_types.h:160
int nfs41_superblock_for_fh(IN nfs41_session *session, IN const nfs41_fsid *fsid, IN const nfs41_fh *parent OPTIONAL, OUT nfs41_path_fh *file)
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
GLuint const GLubyte GLvoid * src
Definition: s_context.h:57
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
nfs41_compound_res res
int nfs41_name_cache_insert(IN struct nfs41_name_cache *cache, IN const char *path, IN const nfs41_component *name, IN OPTIONAL const nfs41_fh *fh, IN OPTIONAL const nfs41_file_info *info, IN OPTIONAL const change_info4 *cinfo, IN enum open_delegation_type4 delegation)
Definition: name_cache.c:923
void nfs41_superblock_space_changed(IN nfs41_superblock *superblock)
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
smooth NULL
Definition: ftsmooth.c:416
int compound_error(int status)
int nfs41_attr_cache_update(IN struct nfs41_name_cache *cache, IN uint64_t fileid, IN const nfs41_file_info *info)
Definition: name_cache.c:891
nfs41_file_info * info
Definition: nfs41_ops.h:534
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
const nfs41_component * name
Definition: nfs41_ops.h:492
uint32_t attr_vals_len
Definition: nfs41_types.h:161
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
GLenum target
Definition: glext.h:7315
static SERVICE_STATUS status
Definition: service.c:31
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89

◆ nfs41_lock()

int nfs41_lock ( IN nfs41_session session,
IN nfs41_path_fh file,
IN state_owner4 owner,
IN uint32_t  type,
IN uint64_t  offset,
IN uint64_t  length,
IN bool_t  reclaim,
IN bool_t  try_recovery,
IN OUT stateid_arg stateid 
)

Definition at line 904 of file nfs41_ops.c.

Referenced by delegation_flush_locks(), handle_lock(), and recover_locks().

914 {
915  int status;
916  nfs41_compound compound;
917  nfs_argop4 argops[3];
918  nfs_resop4 resops[3];
919  nfs41_sequence_args sequence_args;
920  nfs41_sequence_res sequence_res;
921  nfs41_putfh_args putfh_args;
922  nfs41_putfh_res putfh_res;
923  nfs41_lock_args lock_args;
924  nfs41_lock_res lock_res;
925 
926  compound_init(&compound, argops, resops, "lock");
927 
928  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
929  nfs41_session_sequence(&sequence_args, session, 0);
930 
931  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
932  putfh_args.file = file;
933  putfh_args.in_recovery = 0;
934 
935  compound_add_op(&compound, OP_LOCK, &lock_args, &lock_res);
936  lock_args.locktype = type;
937  lock_args.reclaim = reclaim;
938  lock_args.offset = offset;
939  lock_args.length = length;
940  if (stateid->type == STATEID_LOCK) {
941  lock_args.locker.new_lock_owner = 0;
942  lock_args.locker.u.lock_owner.lock_stateid = stateid;
943  lock_args.locker.u.lock_owner.lock_seqid = 0; /* ignored */
944  } else {
945  lock_args.locker.new_lock_owner = 1;
946  lock_args.locker.u.open_owner.open_seqid = 0; /* ignored */
947  lock_args.locker.u.open_owner.open_stateid = stateid;
948  lock_args.locker.u.open_owner.lock_seqid = 0; /* ignored */
949  lock_args.locker.u.open_owner.lock_owner = owner;
950  }
951  lock_res.u.resok4.lock_stateid = &stateid->stateid;
953 
954  status = compound_encode_send_decode(session, &compound, try_recovery);
955  if (status)
956  goto out;
957 
958  if (compound_error(status = compound.res.status))
959  goto out;
960 
961  stateid->type = STATEID_LOCK; /* returning a lock stateid */
962 out:
963  return status;
964 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
lock_res_ok resok4
Definition: nfs41_ops.h:450
union __locker4::@38 u
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
GLintptr offset
Definition: glext.h:5920
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
state_owner4 * lock_owner
Definition: nfs41_ops.h:409
uint64_t length
Definition: nfs41_ops.h:431
stateid_arg * lock_stateid
Definition: nfs41_ops.h:413
nfs41_compound_res res
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
uint64_t offset
Definition: nfs41_ops.h:430
state_owner4 owner
Definition: nfs41_ops.h:439
uint32_t owner_len
Definition: nfs41_types.h:118
int compound_error(int status)
stateid4 * lock_stateid
Definition: nfs41_ops.h:443
uint32_t locktype
Definition: nfs41_ops.h:428
open_to_lock_owner4 open_owner
Definition: nfs41_ops.h:421
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
union __nfs41_lock_res::@39 u
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
bool_t new_lock_owner
Definition: nfs41_ops.h:418
exist_lock_owner4 lock_owner
Definition: nfs41_ops.h:423
uint32_t lock_seqid
Definition: nfs41_ops.h:414
lock_res_denied denied
Definition: nfs41_ops.h:452
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
stateid_arg * open_stateid
Definition: nfs41_ops.h:407

◆ nfs41_lock_stateid_copy()

stateid4* nfs41_lock_stateid_copy ( IN nfs41_lock_state lock_state,
IN OUT stateid4 dest 
)

◆ nfs41_lookup()

int nfs41_lookup ( IN nfs41_root root,
IN nfs41_session session,
IN OUT nfs41_abs_path path,
OUT OPTIONAL nfs41_path_fh parent_out,
OUT OPTIONAL nfs41_path_fh target_out,
OUT OPTIONAL nfs41_file_info info_out,
OUT nfs41_session **  session_out 
)

Definition at line 424 of file lookup.c.

Referenced by handle_mount(), handle_open(), lookup_entry(), lookup_symlink(), nfs41_lookup(), and nfs41_symlink_follow().

432 {
434  struct nfs41_name_cache *cache = session_name_cache(session);
436  const char *path_pos, *path_end;
437  struct lookup_referral referral;
438  bool_t negative = 0;
439  int status;
440 
441  if (session_out) *session_out = session;
442 
443  InitializeSRWLock(&path.lock);
444 
445  /* to avoid holding this lock over multiple rpcs,
446  * make a copy of the path and use that instead */
447  AcquireSRWLockShared(&path_inout->lock);
448  abs_path_copy(&path, path_inout);
449  ReleaseSRWLockShared(&path_inout->lock);
450 
451  path_pos = path.path;
452  path_end = path.path + path.len;
453 
454  dprintf(LULVL, "--> nfs41_lookup('%s')\n", path.path);
455 
456  if (parent_out == NULL) parent_out = &parent;
457  if (target_out == NULL) target_out = ⌖
458  parent_out->fh.len = target_out->fh.len = 0;
459 
460  status = nfs41_name_cache_lookup(cache, path_pos, path_end, &path_pos,
461  &parent_out->fh, &target_out->fh, info_out, &negative);
462  if (status == NO_ERROR || negative)
463  goto out;
464 
465  if (parent_out->fh.len) {
466  /* start where the name cache left off */
467  if (&parent != parent_out) {
468  /* must make a copy for server_start, because
469  * server_lookup_loop() will overwrite parent_out */
470  path_fh_copy(&parent, parent_out);
471  }
472  server_start = &parent;
473  } else {
474  /* start with PUTROOTFH */
475  server_start = NULL;
476  }
477 
478  status = server_lookup_loop(session, server_start,
479  &path, path_pos, &referral, parent_out, target_out, info_out);
480 
481  if (status == ERROR_FILESYSTEM_ABSENT) {
482  nfs41_session *new_session;
483 
484  /* create a session to the referred server and
485  * reformat the path relative to that server's root */
486  status = referral_resolve(root, session,
487  &referral, path_inout, &new_session);
488  if (status) {
489  eprintf("referral_resolve() failed with %d\n", status);
490  goto out;
491  }
492 
493  /* update the positions of the parent and target components */
494  last_component(path_inout->path, path_inout->path + path_inout->len,
495  &target_out->name);
496  last_component(path_inout->path, target_out->name.name,
497  &parent_out->name);
498 
499  if (session_out) *session_out = new_session;
500 
501  /* look up the new path */
502  status = nfs41_lookup(root, new_session, path_inout,
503  parent_out, target_out, info_out, session_out);
504  }
505 out:
506  dprintf(LULVL, "<-- nfs41_lookup() returning %d\n", status);
507  return status;
508 }
Definition: cache.c:46
int32_t bool_t
Definition: types.h:101
GLsizei const GLchar ** path
Definition: glext.h:7234
#define LULVL
Definition: lookup.c:33
int nfs41_lookup(IN nfs41_root *root, IN nfs41_session *session, IN OUT nfs41_abs_path *path_inout, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT nfs41_session **session_out)
Definition: lookup.c:424
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
int nfs41_name_cache_lookup(IN struct nfs41_name_cache *cache, IN const char *path, IN const char *path_end, OUT OPTIONAL const char **remaining_path_out, OUT OPTIONAL nfs41_fh *parent_out, OUT OPTIONAL nfs41_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT OPTIONAL bool_t *is_negative)
Definition: name_cache.c:824
#define NO_ERROR
Definition: dderror.h:5
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
Definition: util.c:317
static int referral_resolve(IN nfs41_root *root, IN nfs41_session *session_in, IN struct lookup_referral *referral, OUT nfs41_abs_path *path_out, OUT nfs41_session **session_out)
Definition: lookup.c:373
void abs_path_copy(OUT nfs41_abs_path *dst, IN const nfs41_abs_path *src)
Definition: util.c:338
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
Definition: name_cache.h:34
static void server_start(server_params *par)
Definition: sock.c:522
#define dprintf
Definition: regdump.c:33
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2644
unsigned short len
Definition: nfs41_types.h:43
static FILE * out
Definition: regtests2xml.c:44
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
Definition: sync.c:75
#define ERROR_FILESYSTEM_ABSENT
Definition: lookup.c:39
static int server_lookup_loop(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *parent_in, IN nfs41_abs_path *path, IN const char *path_pos, IN struct lookup_referral *referral, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out)
Definition: lookup.c:298
GLenum target
Definition: glext.h:7315
char path[NFS41_MAX_PATH_LEN]
Definition: nfs41_types.h:42
static SERVICE_STATUS status
Definition: service.c:31
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89
void path_fh_copy(OUT nfs41_path_fh *dst, IN const nfs41_path_fh *src)
Definition: util.c:364

◆ nfs41_open()

int nfs41_open ( IN nfs41_session session,
IN nfs41_path_fh parent,
IN nfs41_path_fh file,
IN state_owner4 owner,
IN open_claim4 claim,
IN uint32_t  allow,
IN uint32_t  deny,
IN uint32_t  create,
IN uint32_t  how_mode,
IN OPTIONAL nfs41_file_info createattrs,
IN bool_t  try_recovery,
OUT stateid4 stateid,
OUT open_delegation4 delegation,
OUT OPTIONAL nfs41_file_info info 
)

Definition at line 366 of file nfs41_ops.c.

Referenced by do_open(), get_ea_value(), nfs41_delegation_to_open(), recover_open_grace(), recover_open_no_grace(), and set_ea_value().

381 {
382  int status;
383  nfs41_compound compound;
384  nfs_argop4 argops[8];
385  nfs_resop4 resops[8];
386  nfs41_sequence_args sequence_args;
387  nfs41_sequence_res sequence_res;
388  nfs41_putfh_args putfh_args[2];
389  nfs41_putfh_res putfh_res[2];
390  nfs41_op_open_args open_args;
391  nfs41_op_open_res open_res;
392  nfs41_getfh_res getfh_res;
393  bitmap4 attr_request;
394  nfs41_getattr_args getattr_args;
395  nfs41_getattr_res getattr_res, pgetattr_res;
396  nfs41_savefh_res savefh_res;
397  nfs41_restorefh_res restorefh_res;
398  nfs41_file_info tmp_info, dir_info;
399  bool_t current_fh_is_dir;
400  bool_t already_delegated = delegation->type == OPEN_DELEGATE_READ
401  || delegation->type == OPEN_DELEGATE_WRITE;
402 
403  /* depending on the claim type, OPEN expects CURRENT_FH set
404  * to either the parent directory, or to the file itself */
405  switch (claim->claim) {
406  case CLAIM_NULL:
407  case CLAIM_DELEGATE_CUR:
408  case CLAIM_DELEGATE_PREV:
409  /* CURRENT_FH: directory */
410  current_fh_is_dir = TRUE;
411  /* SEQUENCE; PUTFH(dir); SAVEFH; OPEN;
412  * GETFH(file); GETATTR(file); RESTOREFH(dir); GETATTR */
413  nfs41_superblock_getattr_mask(parent->fh.superblock, &attr_request);
414  break;
415  case CLAIM_PREVIOUS:
416  case CLAIM_FH:
417  case CLAIM_DELEG_CUR_FH:
418  case CLAIM_DELEG_PREV_FH:
419  default:
420  /* CURRENT_FH: file being opened */
421  current_fh_is_dir = FALSE;
422  /* SEQUENCE; PUTFH(file); OPEN; GETATTR(file); PUTFH(dir); GETATTR */
423  nfs41_superblock_getattr_mask(file->fh.superblock, &attr_request);
424  break;
425  }
426 
427  if (info == NULL)
428  info = &tmp_info;
429 
430  attr_request.arr[0] |= FATTR4_WORD0_FSID;
431 
432  compound_init(&compound, argops, resops, "open");
433 
434  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
435  nfs41_session_sequence(&sequence_args, session, 1);
436 
437  if (current_fh_is_dir) {
438  /* CURRENT_FH: directory */
439  compound_add_op(&compound, OP_PUTFH, &putfh_args[0], &putfh_res[0]);
440  putfh_args[0].file = parent;
441  putfh_args[0].in_recovery = 0;
442 
443  compound_add_op(&compound, OP_SAVEFH, NULL, &savefh_res);
444  } else {
445  /* CURRENT_FH: file being opened */
446  compound_add_op(&compound, OP_PUTFH, &putfh_args[0], &putfh_res[0]);
447  putfh_args[0].file = file;
448  putfh_args[0].in_recovery = 0;
449  }
450 
451  compound_add_op(&compound, OP_OPEN, &open_args, &open_res);
452  open_args.seqid = 0;
453 #ifdef DISABLE_FILE_DELEGATIONS
455 #else
456  open_args.share_access = allow;
457 #endif
458  open_args.share_deny = deny;
459  open_args.owner = owner;
460  open_args.openhow.opentype = create;
461  open_args.openhow.how.mode = how_mode;
462  open_args.openhow.how.createattrs = createattrs;
463  if (how_mode == EXCLUSIVE4_1) {
465  time((time_t*)open_args.openhow.how.createverf);
466  memcpy(open_args.openhow.how.createverf+4, &tid, sizeof(tid));
467  /* mask unsupported attributes */
469  parent->fh.superblock, &createattrs->attrmask);
470  } else if (createattrs) {
471  /* mask unsupported attributes */
473  parent->fh.superblock, &createattrs->attrmask);
474  }
475  open_args.claim = claim;
476  open_res.resok4.stateid = stateid;
477  open_res.resok4.delegation = delegation;
478 
479  if (current_fh_is_dir) {
480  compound_add_op(&compound, OP_GETFH, NULL, &getfh_res);
481  getfh_res.fh = &file->fh;
482  }
483 
484  compound_add_op(&compound, OP_GETATTR, &getattr_args, &getattr_res);
485  getattr_args.attr_request = &attr_request;
487  getattr_res.info = info;
488 
489  if (current_fh_is_dir) {
490  compound_add_op(&compound, OP_RESTOREFH, NULL, &restorefh_res);
491  } else {
492  compound_add_op(&compound, OP_PUTFH, &putfh_args[1], &putfh_res[1]);
493  putfh_args[1].file = parent;
494  putfh_args[1].in_recovery = 0;
495  }
496 
497  compound_add_op(&compound, OP_GETATTR, &getattr_args, &pgetattr_res);
498  getattr_args.attr_request = &attr_request;
500  pgetattr_res.info = &dir_info;
501 
502  status = compound_encode_send_decode(session, &compound, try_recovery);
503  if (status)
504  goto out;
505 
506  if (compound_error(status = compound.res.status))
507  goto out;
508 
509  if (dir_info.type == NF4ATTRDIR) {
510  file->fh.superblock = parent->fh.superblock;
511  goto out;
512  }
513 
514  /* fill in the file handle's fileid and superblock */
515  file->fh.fileid = info->fileid;
516  status = nfs41_superblock_for_fh(session, &info->fsid, &parent->fh, file);
517  if (status)
518  goto out;
519 
520  if (create == OPEN4_CREATE)
521  nfs41_superblock_space_changed(file->fh.superblock);
522 
523  /* update the name/attr cache with the results */
524  open_update_cache(session, parent, file, try_recovery, delegation,
525  already_delegated, &open_res.resok4.cinfo, &pgetattr_res, &getattr_res);
526 out:
527  return status;
528 }
open_delegation4 * delegation
Definition: nfs41_ops.h:662
nfs41_path_fh * file
Definition: nfs41_ops.h:510
nfs41_fh * fh
Definition: nfs41_ops.h:504
#define TRUE
Definition: types.h:120
static __inline void nfs41_superblock_supported_attrs_exclcreat(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
Definition: nfs41.h:460
int32_t bool_t
Definition: types.h:101
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
open_claim4 * claim
Definition: nfs41_ops.h:647
__u16 time
Definition: mkdosfs.c:366
nfs41_op_open_res_ok resok4
Definition: nfs41_ops.h:668
unsigned char createverf[NFS4_VERIFIER_SIZE]
Definition: nfs41_ops.h:549
uint32_t arr[3]
Definition: nfs41_types.h:97
int nfs41_superblock_for_fh(IN nfs41_session *session, IN const nfs41_fsid *fsid, IN const nfs41_fh *parent OPTIONAL, OUT nfs41_path_fh *file)
struct _test_info info[]
Definition: SetCursorPos.c:19
bitmap4 * attr_request
Definition: nfs41_ops.h:527
nfs41_compound_res res
void nfs41_superblock_space_changed(IN nfs41_superblock *superblock)
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
nfs41_file_info * createattrs
Definition: nfs41_ops.h:548
smooth NULL
Definition: ftsmooth.c:416
change_info4 cinfo
Definition: nfs41_ops.h:659
static __inline void nfs41_superblock_supported_attrs(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
Definition: nfs41.h:454
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
int compound_error(int status)
r parent
Definition: btrfs.c:2644
nfs41_file_info * info
Definition: nfs41_ops.h:534
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
uint32_t attr_vals_len
Definition: nfs41_types.h:161
createhow4 how
Definition: nfs41_ops.h:560
state_owner4 * owner
Definition: nfs41_ops.h:645
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
uint32_t share_access
Definition: nfs41_ops.h:643
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
__kernel_time_t time_t
Definition: linux.h:252
uint32_t mode
Definition: nfs41_ops.h:547
static void open_update_cache(IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN bool_t try_recovery, IN open_delegation4 *delegation, IN bool_t already_delegated, IN change_info4 *changeinfo, IN nfs41_getattr_res *dir_attrs, IN nfs41_getattr_res *file_attrs)
Definition: nfs41_ops.c:321
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
Definition: nfs41.h:448
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
uint32_t opentype
Definition: nfs41_ops.h:558
static const struct access_res create[16]
Definition: package.c:7720
static SERVICE_STATUS status
Definition: service.c:31
static TfClientId tid
Definition: fci.c:126

◆ nfs41_read()

int nfs41_read ( IN nfs41_session session,
IN nfs41_path_fh file,
IN stateid_arg stateid,
IN uint64_t  offset,
IN uint32_t  count,
OUT unsigned char data_out,
OUT uint32_t data_len_out,
OUT bool_t eof_out 
)

Definition at line 774 of file nfs41_ops.c.

Referenced by file_layout_read_thread(), get_ea_value(), and read_from_mds().

783 {
784  int status;
785  nfs41_compound compound;
786  nfs_argop4 argops[4];
787  nfs_resop4 resops[4];
788  nfs41_sequence_args sequence_args;
789  nfs41_sequence_res sequence_res;
790  nfs41_putfh_args putfh_args;
791  nfs41_putfh_res putfh_res;
792  nfs41_read_args read_args;
793  nfs41_read_res read_res;
794 
795  compound_init(&compound, argops, resops,
796  stateid->stateid.seqid == 0 ? "ds read" : "read");
797 
798  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
799  nfs41_session_sequence(&sequence_args, session, 0);
800 
801  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
802  putfh_args.file = file;
803  putfh_args.in_recovery = 0;
804 
805  compound_add_op(&compound, OP_READ, &read_args, &read_res);
806  read_args.stateid = stateid;
807  read_args.offset = offset;
808  read_args.count = count;
809  read_res.resok4.data_len = count;
810  read_res.resok4.data = data_out;
811 
812  status = compound_encode_send_decode(session, &compound, TRUE);
813  if (status)
814  goto out;
815 
816  if (compound_error(status = compound.res.status))
817  goto out;
818 
819  *data_len_out = read_res.resok4.data_len;
820  *eof_out = read_res.resok4.eof;
821 
822  /* we shouldn't ever see this, but a buggy server could
823  * send us into an infinite loop. return NFS4ERR_IO */
824  if (!read_res.resok4.data_len && !read_res.resok4.eof) {
825  status = NFS4ERR_IO;
826  eprintf("READ succeeded with len=0 and eof=0; returning %s\n",
827  nfs_error_string(status));
828  }
829 out:
830  return status;
831 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
GLintptr offset
Definition: glext.h:5920
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
unsigned char * data
Definition: nfs41_ops.h:692
nfs41_compound_res res
stateid_arg * stateid
Definition: nfs41_ops.h:684
nfs41_read_res_ok resok4
Definition: nfs41_ops.h:698
int compound_error(int status)
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
const char * nfs_error_string(int status)
Definition: daemon_debug.c:370
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
uint64_t offset
Definition: nfs41_ops.h:685
uint32_t count
Definition: nfs41_ops.h:686
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_readdir()

int nfs41_readdir ( IN nfs41_session session,
IN nfs41_path_fh file,
IN bitmap4 attr_request,
IN nfs41_readdir_cookie cookie,
OUT unsigned char entries,
IN OUT uint32_t entries_len,
OUT bool_t eof_out 
)

Definition at line 1010 of file nfs41_ops.c.

Referenced by handle_readdir(), and read_entire_dir().

1018 {
1019  int status;
1020  nfs41_compound compound;
1021  nfs_argop4 argops[3];
1022  nfs_resop4 resops[3];
1023  nfs41_sequence_args sequence_args;
1024  nfs41_sequence_res sequence_res;
1025  nfs41_putfh_args putfh_args;
1026  nfs41_putfh_res putfh_res;
1027  nfs41_readdir_args readdir_args;
1028  nfs41_readdir_res readdir_res;
1029 
1030  compound_init(&compound, argops, resops, "readdir");
1031 
1032  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1033  nfs41_session_sequence(&sequence_args, session, 0);
1034 
1035  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1036  putfh_args.file = file;
1037  putfh_args.in_recovery = 0;
1038 
1039  compound_add_op(&compound, OP_READDIR, &readdir_args, &readdir_res);
1040  readdir_args.cookie.cookie = cookie->cookie;
1041  memcpy(readdir_args.cookie.verf, cookie->verf, NFS4_VERIFIER_SIZE);
1042  readdir_args.dircount = *entries_len;
1043  readdir_args.maxcount = *entries_len + sizeof(nfs41_readdir_res);
1044  readdir_args.attr_request = attr_request;
1045  readdir_res.reply.entries_len = *entries_len;
1046  readdir_res.reply.entries = entries;
1047  ZeroMemory(entries, readdir_args.dircount);
1048 
1049  status = compound_encode_send_decode(session, &compound, TRUE);
1050  if (status)
1051  goto out;
1052 
1053  if (compound_error(status = compound.res.status))
1054  goto out;
1055 
1056  *entries_len = readdir_res.reply.entries_len;
1057  *eof_out = readdir_res.reply.eof;
1058  memcpy(cookie->verf, readdir_res.cookieverf, NFS4_VERIFIER_SIZE);
1059 out:
1060  return status;
1061 }
unsigned char * entries
Definition: nfs41_ops.h:721
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
#define ZeroMemory
Definition: winbase.h:1635
bitmap4 * attr_request
Definition: nfs41_ops.h:707
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
nfs41_compound_res res
unsigned char cookieverf[NFS4_VERIFIER_SIZE]
Definition: nfs41_ops.h:728
int compound_error(int status)
struct __nfs41_readdir_res nfs41_readdir_res
nfs41_readdir_list reply
Definition: nfs41_ops.h:729
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
uint32_t entries_len
Definition: nfs41_ops.h:720
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
nfs41_readdir_cookie cookie
Definition: nfs41_ops.h:704
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_readlink()

int nfs41_readlink ( IN nfs41_session session,
IN nfs41_path_fh file,
IN uint32_t  max_len,
OUT char link_out,
OUT uint32_t len_out 
)

Definition at line 1511 of file nfs41_ops.c.

Referenced by handle_symlink(), and nfs41_symlink_target().

1517 {
1518  int status;
1519  nfs41_compound compound;
1520  nfs_argop4 argops[3];
1521  nfs_resop4 resops[3];
1522  nfs41_sequence_args sequence_args;
1523  nfs41_sequence_res sequence_res;
1524  nfs41_putfh_args putfh_args;
1525  nfs41_putfh_res putfh_res;
1526  nfs41_readlink_res readlink_res;
1527 
1528  compound_init(&compound, argops, resops, "readlink");
1529 
1530  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
1531  nfs41_session_sequence(&sequence_args, session, 0);
1532 
1533  compound_add_op(&compound, OP_PUTFH, &putfh_args, &putfh_res);
1534  putfh_args.file = file;
1535  putfh_args.in_recovery = 0;
1536 
1537  compound_add_op(&compound, OP_READLINK, NULL, &readlink_res);
1538  readlink_res.link_len = max_len - 1;
1539  readlink_res.link = link_out;
1540 
1541  status = compound_encode_send_decode(session, &compound, TRUE);
1542  if (status)
1543  goto out;
1544 
1545  if (compound_error(status = compound.res.status))
1546  goto out;
1547 
1548  link_out[readlink_res.link_len] = '\0';
1549  *len_out = readlink_res.link_len;
1550 out:
1551  return status;
1552 }
nfs41_path_fh * file
Definition: nfs41_ops.h:510
#define TRUE
Definition: types.h:120
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
nfs41_compound_res res
smooth NULL
Definition: ftsmooth.c:416
int compound_error(int status)
const char file[]
Definition: icontest.c:11
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31

◆ nfs41_reclaim_complete()

enum nfsstat4 nfs41_reclaim_complete ( IN nfs41_session session)

Definition at line 268 of file nfs41_ops.c.

Referenced by nfs41_recover_client_state(), nfs41_recover_sequence_flags(), recover_delegation_open(), recover_delegation_want(), recover_locks(), recover_open(), and root_client_create().

270 {
271  enum nfsstat4 status = NFS4_OK;
272  nfs41_compound compound;
273  nfs_argop4 argops[2];
274  nfs_resop4 resops[2];
275  nfs41_sequence_args sequence_args;
276  nfs41_sequence_res sequence_res;
277  nfs41_reclaim_complete_res reclaim_res;
278 
279  compound_init(&compound, argops, resops, "reclaim_complete");
280 
281  compound_add_op(&compound, OP_SEQUENCE, &sequence_args, &sequence_res);
282  nfs41_session_sequence(&sequence_args, session, 0);
283 
284  compound_add_op(&compound, OP_RECLAIM_COMPLETE, NULL, &reclaim_res);
285 
286  /* don't attempt to recover from BADSESSION */
287  status = compound_encode_send_decode(session, &compound, FALSE);
288  if (status)
289  goto out;
290 
291  compound_error(status = compound.res.status);
292 out:
293  return status;
294 }
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
nfs41_compound_res res
smooth NULL
Definition: ftsmooth.c:416
int compound_error(int status)
static FILE * out
Definition: regtests2xml.c:44
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
nfsstat4
Definition: nfs41_const.h:86
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ nfs41_remove()

int nfs41_remove ( IN nfs41_session session,
IN nfs41_path_fh parent,
IN const nfs41_component target