[cosmetic] formatting changes to open.c

This commit is contained in:
Olga Kornievskaia 2011-08-25 14:55:32 -04:00
parent 74147edb93
commit 328b175cae

View file

@ -58,13 +58,11 @@ static int create_open_state(
state->path.len = (unsigned short)strlen(state->path.path); state->path.len = (unsigned short)strlen(state->path.path);
path_fh_init(&state->file, &state->path); path_fh_init(&state->file, &state->path);
path_fh_init(&state->parent, &state->path); path_fh_init(&state->parent, &state->path);
last_component(state->path.path, state->file.name.name, last_component(state->path.path, state->file.name.name, &state->parent.name);
&state->parent.name);
StringCchPrintfA((LPSTR)state->owner.owner, NFS4_OPAQUE_LIMIT, StringCchPrintfA((LPSTR)state->owner.owner, NFS4_OPAQUE_LIMIT, "%u",
"%u", open_owner_id); open_owner_id);
state->owner.owner_len = (uint32_t)strlen( state->owner.owner_len = (uint32_t)strlen((const char*)state->owner.owner);
(const char*)state->owner.owner);
state->ref_count = 1; state->ref_count = 1;
list_init(&state->locks.list); list_init(&state->locks.list);
list_init(&state->client_entry); list_init(&state->client_entry);
@ -99,8 +97,7 @@ void nfs41_open_state_ref(
{ {
const LONG count = InterlockedIncrement(&state->ref_count); const LONG count = InterlockedIncrement(&state->ref_count);
dprintf(2, "nfs41_open_state_ref(%s) count %d\n", dprintf(2, "nfs41_open_state_ref(%s) count %d\n", state->path.path, count);
state->path.path, count);
} }
void nfs41_open_state_deref( void nfs41_open_state_deref(
@ -108,8 +105,7 @@ void nfs41_open_state_deref(
{ {
const LONG count = InterlockedDecrement(&state->ref_count); const LONG count = InterlockedDecrement(&state->ref_count);
dprintf(2, "nfs41_open_state_deref(%s) count %d\n", dprintf(2, "nfs41_open_state_deref(%s) count %d\n", state->path.path, count);
state->path.path, count);
if (count == 0) if (count == 0)
open_state_free(state); open_state_free(state);
} }
@ -286,7 +282,8 @@ out:
return status; return status;
} }
static BOOLEAN open_for_attributes(uint32_t type, ULONG access_mask, ULONG disposition) static BOOLEAN open_for_attributes(uint32_t type, ULONG access_mask,
ULONG disposition)
{ {
if (type == NF4DIR) { if (type == NF4DIR) {
if (disposition == FILE_OPEN || disposition == FILE_OVERWRITE) { if (disposition == FILE_OPEN || disposition == FILE_OVERWRITE) {
@ -554,7 +551,8 @@ static int handle_open(nfs41_upcall *upcall)
state->file.fh.superblock = state->parent.fh.superblock; state->file.fh.superblock = state->parent.fh.superblock;
status = NO_ERROR; status = NO_ERROR;
} else if (open_for_attributes(state->type, args->access_mask, args->disposition)) { } else if (open_for_attributes(state->type, args->access_mask,
args->disposition)) {
if (status) { if (status) {
dprintf(1, "nfs41_lookup failed with %d\n", status); dprintf(1, "nfs41_lookup failed with %d\n", status);
goto out_free_state; goto out_free_state;
@ -582,13 +580,13 @@ static int handle_open(nfs41_upcall *upcall)
} }
if (create == OPEN4_CREATE && (args->create_opts & FILE_DIRECTORY_FILE)) { if (create == OPEN4_CREATE && (args->create_opts & FILE_DIRECTORY_FILE)) {
status = nfs41_create(state->session, NF4DIR, args->mode, status = nfs41_create(state->session, NF4DIR, args->mode, NULL,
NULL, &state->parent, &state->file); &state->parent, &state->file);
args->std_info.Directory = 1; args->std_info.Directory = 1;
args->created = status == NFS4_OK ? TRUE : FALSE; args->created = status == NFS4_OK ? TRUE : FALSE;
} else { } else {
status = open_or_delegate(state, create, status = open_or_delegate(state, create, createhowmode, args->mode,
createhowmode, args->mode, TRUE, &info); TRUE, &info);
if (status == NFS4_OK) { if (status == NFS4_OK) {
nfs_to_basic_info(&info, &args->basic_info); nfs_to_basic_info(&info, &args->basic_info);
nfs_to_standard_info(&info, &args->std_info); nfs_to_standard_info(&info, &args->std_info);