moving session and open_state in upcall header
every upcall (except few) pass session and open_state pointer, so add that to marshal_nfs41_header() in the driver. remove passing of session and open_state elsewhere in marshal functions. in the deamon, upcall.c now reads and stores pointers to session and open_state in nfs41_upcall datastructure instead of having each individual upcall store their own pointers. setattrl and readdir args keeping pointer because the rest of the code uses them a lot. in upcall_parse() up refcounts on session and open_state if valid handles were passed in. down refcounts upcall_cleanup() as before. but need to be careful with count value for mount and open upcalls. we need to take an extra ref because upcall_cleanup() now will always decrement it.
This commit is contained in:
parent
ea390c1d25
commit
529d7ce6db
13 changed files with 132 additions and 334 deletions
|
|
@ -195,12 +195,6 @@ static int parse_symlink(unsigned char *buffer, uint32_t length, nfs41_upcall *u
|
|||
symlink_upcall_args *args = &upcall->args.symlink;
|
||||
int status;
|
||||
|
||||
status = safe_read(&buffer, &length, &args->root, sizeof(HANDLE));
|
||||
if (status) goto out;
|
||||
upcall_root_ref(upcall, args->root);
|
||||
status = safe_read(&buffer, &length, &args->state, sizeof(nfs41_open_state *));
|
||||
if (status) goto out;
|
||||
upcall_open_state_ref(upcall, args->state);
|
||||
status = get_name(&buffer, &length, &args->path);
|
||||
if (status) goto out;
|
||||
status = safe_read(&buffer, &length, &args->set, sizeof(BOOLEAN));
|
||||
|
|
@ -211,8 +205,7 @@ static int parse_symlink(unsigned char *buffer, uint32_t length, nfs41_upcall *u
|
|||
else
|
||||
args->target_set = NULL;
|
||||
|
||||
dprintf(1, "parsing NFS41_SYMLINK: root=0x%p open_state=0x%p "
|
||||
"path='%s' set=%u target='%s'\n", args->root, args->state,
|
||||
dprintf(1, "parsing NFS41_SYMLINK: path='%s' set=%u target='%s'\n",
|
||||
args->path, args->set, args->target_set);
|
||||
out:
|
||||
return status;
|
||||
|
|
@ -231,7 +224,7 @@ static int map_symlink_errors(int status)
|
|||
static int handle_symlink(nfs41_upcall *upcall)
|
||||
{
|
||||
symlink_upcall_args *args = &upcall->args.symlink;
|
||||
nfs41_open_state *state = args->state;
|
||||
nfs41_open_state *state = upcall->state_ref;
|
||||
int status = NO_ERROR;
|
||||
|
||||
if (args->set) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue