open: nfs41_rpc_open() takes open_claim4 and open_delegation4

combined nfs41_open() and nfs41_open_reclaim() into nfs41_rpc_open() by factoring out the open_claim4 argument.  new function nfs41_open() in open.c deals with the nfs41_open_state, adding it to the client's list, and handles any delegations granted

added xdr for OPEN CLAIM types CLAIM_DELEGATE_CUR, CLAIM_DELEG_CUR_FH, CLAIM_DELEGATE_PREV, CLAIM_DELEG_PREV_FH (the _FH types are new to 4.1, and not supported by linux server)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-07-05 10:23:33 -04:00 committed by unknown
parent 2b5a5fb071
commit 0c874a66ba
7 changed files with 187 additions and 182 deletions

View file

@ -546,7 +546,7 @@ enum createmode4 {
typedef struct __createhow4 {
uint32_t mode;
createattrs4 createattrs;
unsigned char *createverf;
unsigned char createverf[NFS4_VERIFIER_SIZE];
} createhow4;
enum opentype4 {
@ -620,8 +620,21 @@ typedef struct __open_claim4 {
} null;
/* case CLAIM_PREVIOUS: */
struct __open_claim_prev {
uint32_t delegate_type;
uint32_t delegate_type;
} prev;
/* case CLAIM_DELEGATE_CUR: */
struct __open_claim_deleg_cur {
stateid4 *delegate_stateid;
nfs41_component *name;
} deleg_cur;
/* case CLAIM_DELEG_CUR_FH: */
struct __open_claim_deleg_cur_fh {
stateid4 *delegate_stateid;
} deleg_cur_fh;
/* case CLAIM_DELEGATE_PREV: */
struct __open_claim_deleg_prev {
const nfs41_component *filename;
} deleg_prev;
} u;
} open_claim4;
@ -631,7 +644,7 @@ typedef struct __nfs41_op_open_args {
uint32_t share_deny;
state_owner4 *owner;
openflag4 openhow;
open_claim4 claim;
open_claim4 *claim;
} nfs41_op_open_args;
enum {
@ -646,8 +659,7 @@ typedef struct __nfs41_op_open_res_ok {
change_info4 cinfo;
uint32_t rflags;
bitmap4 attrset;
uint32_t delegation_type;
stateid4 deleg_stateid;
open_delegation4 *delegation;
uint32_t why_no_deleg;
uint32_t why_none_flag;
} nfs41_op_open_res_ok;
@ -985,26 +997,22 @@ int nfs41_lookup(
OUT OPTIONAL nfs41_file_info *info_out,
OUT nfs41_session **session_out);
int nfs41_open(
int nfs41_rpc_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 uint32_t mode,
IN bool_t try_recovery,
IN OUT nfs41_open_state *state,
OUT stateid4 *stateid,
OUT open_delegation4 *delegation,
OUT OPTIONAL nfs41_file_info *info);
int nfs41_open_reclaim(
IN nfs41_session *session,
IN nfs41_path_fh *parent,
IN nfs41_path_fh *file,
IN state_owner4 *owner,
IN uint32_t allow,
IN uint32_t deny,
OUT stateid4 *stateid);
int nfs41_create(
IN nfs41_session *session,
IN uint32_t type,