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

@ -31,6 +31,9 @@ struct __nfs41_client;
struct __rpc_client;
struct __nfs41_root;
struct _FILE_GET_EA_INFORMATION;
struct _FILE_FULL_EA_INFORMATION;
typedef struct __nfs41_superblock {
nfs41_fsid fsid;
struct list_entry entry; /* position in nfs41_server.superblocks */
@ -152,6 +155,11 @@ typedef struct __nfs41_open_state {
CRITICAL_SECTION lock;
} locks;
struct {
struct _FILE_GET_EA_INFORMATION *list;
CRITICAL_SECTION lock;
} ea;
HANDLE srv_open; /* for data cache invalidation */
} nfs41_open_state;
@ -505,7 +513,6 @@ void nfs41_open_stateid_arg(
/* ea.c */
struct _FILE_FULL_EA_INFORMATION;
int nfs41_ea_set(
IN nfs41_open_state *state,
IN struct _FILE_FULL_EA_INFORMATION *ea);