From dcde6457e7aec5035e3c808b672c334379c08d51 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Tue, 23 Aug 2011 11:45:59 -0400 Subject: [PATCH] simplifying nfs41_delegate_open args --- daemon/delegation.c | 12 ++++++------ daemon/delegation.h | 6 +----- daemon/open.c | 4 +--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/daemon/delegation.c b/daemon/delegation.c index d4865d5..eac9319 100644 --- a/daemon/delegation.c +++ b/daemon/delegation.c @@ -440,15 +440,15 @@ static int delegation_truncate( } int nfs41_delegate_open( - IN nfs41_client *client, - IN nfs41_path_fh *file, + IN nfs41_open_state *state, IN uint32_t create, IN uint32_t mode, - IN uint32_t access, - IN uint32_t deny, - OUT nfs41_delegation_state **deleg_out, OUT nfs41_file_info *info) { + nfs41_client *client = state->session->client; + nfs41_path_fh *file = &state->file; + uint32_t access = state->share_access; + uint32_t deny = state->share_deny; nfs41_delegation_state *deleg; stateid_arg stateid; int status; @@ -496,7 +496,7 @@ int nfs41_delegate_open( /* TODO: check access against deleg->state.permissions or send ACCESS */ - *deleg_out = deleg; + state->delegation.state = deleg; status = NFS4_OK; out: return status; diff --git a/daemon/delegation.h b/daemon/delegation.h index 438c226..d280add 100644 --- a/daemon/delegation.h +++ b/daemon/delegation.h @@ -55,13 +55,9 @@ int nfs41_delegation_granted( OUT nfs41_delegation_state **deleg_out); int nfs41_delegate_open( - IN nfs41_client *client, - IN nfs41_path_fh *file, + IN nfs41_open_state *state, IN uint32_t create, IN uint32_t mode, - IN uint32_t access, - IN uint32_t deny, - OUT nfs41_delegation_state **deleg_out, OUT nfs41_file_info *info); int nfs41_delegation_to_open( diff --git a/daemon/open.c b/daemon/open.c index 957b293..88624d6 100644 --- a/daemon/open.c +++ b/daemon/open.c @@ -237,9 +237,7 @@ static int open_or_delegate( int status; /* check for existing delegation */ - status = nfs41_delegate_open(state->session->client, &state->file, - create, mode, state->share_access, state->share_deny, - &state->delegation.state, info); + status = nfs41_delegate_open(state, create, mode, info); /* get an open stateid if we have no delegation stateid */ if (status)