use readdir to generate ea list

when given a null for FILE_GET_EA_INFORMATION, use READDIR to construct one with
 the full named attribute directory listing

new function read_entire_dir() allocates an initial buffer for readdir entries a
nd calls nfs41_readdir() repeatedly to fill it.  the buffer is realloc()ed as mo
re space is required, allowing the function to return a complete listing in a si
ngle buffer

new function calculate_ea_list_length() calculates the exact length of the FILE_
GET_EA_INFORMATION buffer required to hold all of the names from the directory l
isting

once the FILE_GET_EA_INFORMATION buffer is allocated, it is filled by populate_e
a_list() and cached with nfs41_open_state

handle_getexattr() remains largely unchanged

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Olga Kornievskaia 2012-05-03 10:38:43 -04:00 committed by unknown
parent 7b8715ce8e
commit 17aac16946
3 changed files with 199 additions and 2 deletions

View file

@ -63,6 +63,9 @@ static int create_open_state(
list_init(&state->client_entry);
InitializeCriticalSection(&state->locks.lock);
state->ea.list = INVALID_HANDLE_VALUE;
InitializeCriticalSection(&state->ea.lock);
*state_out = state;
status = NO_ERROR;
out:
@ -83,6 +86,8 @@ static void open_state_free(
free(list_container(entry, nfs41_lock_state, open_entry));
if (state->delegation.state)
nfs41_delegation_deref(state->delegation.state);
if (state->ea.list != INVALID_HANDLE_VALUE)
free(state->ea.list);
free(state);
}