From 9a237d9e5b8b36af44a199b6e257fdad20ef6c05 Mon Sep 17 00:00:00 2001 From: cek10006 Date: Sun, 7 Oct 2012 23:25:22 -0400 Subject: [PATCH] get member attributes for dir sm works * same pid is used for regular and collection objects * regular directory object creation (old case) needs to be implemented for comparison --- config.save | 2 +- src/client/sysint/osd.h | 2 +- src/client/sysint/sys-readdirplus.sm | 46 ++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/config.save b/config.save index d00fc38..5e30d8c 100755 --- a/config.save +++ b/config.save @@ -525,7 +525,7 @@ s,@ECHO_C@,,;t t s,@ECHO_N@,-n,;t t s,@ECHO_T@,,;t t s,@LIBS@, -lcrypto -lssl -ldl,;t t -s,@PVFS2_VERSION@,2.8.6-orangefs-2012-10-01-160125,;t t +s,@PVFS2_VERSION@,2.8.6-orangefs-2012-10-03-152301,;t t s,@PVFS2_VERSION_MAJOR@,2,;t t s,@PVFS2_VERSION_MINOR@,8,;t t s,@PVFS2_VERSION_SUB@,6,;t t diff --git a/src/client/sysint/osd.h b/src/client/sysint/osd.h index 38226ec..6a95910 100644 --- a/src/client/sysint/osd.h +++ b/src/client/sysint/osd.h @@ -23,7 +23,7 @@ /* The partitions; one for datafiles, another for metafiles and dir objects. */ #define PVFS_OSD_DATA_PID 0x10000LLU -#define PVFS_OSD_META_PID 0x20000LLU +#define PVFS_OSD_META_PID 0x10000LLU /* Pages for object and directory attributes */ #define PVFS_USEROBJECT_DIR_PG 0x30000 diff --git a/src/client/sysint/sys-readdirplus.sm b/src/client/sysint/sys-readdirplus.sm index 8fa00ee..19f705f 100644 --- a/src/client/sysint/sys-readdirplus.sm +++ b/src/client/sysint/sys-readdirplus.sm @@ -695,16 +695,8 @@ static int readdirplus_fetch_attrs_comp_fn(void *v_p, int i, handle_index, aux_index; if (is_osd) { - for (i = 0; i < sm_p->u.readdirplus.handle_count[index]; i++) { - get_handle_index(sm_p->u.readdirplus.input_handle_array, - sm_p->u.readdirplus.nhandles, - sm_p->u.readdirplus.handles[index][i], - &handle_index, - NULL); - assert(handle_index >= 0); - } - struct osd_command *command = &sm_p->msgarray_op.msgarray[index].osd_command; + struct attribute_list *attr = command->attr; int ret = osd_command_attr_resolve(command); if (ret) { @@ -713,10 +705,40 @@ static int readdirplus_fetch_attrs_comp_fn(void *v_p, return ret; } - if (*(PVFS_ds_type*)command->attr[4].val == PVFS_TYPE_DIRECTORY) { - PINT_copy_osd_dir_attr(&sm_p->u.readdirplus.obj_attr_array[handle_index], command); + gossip_err("cem: %d\n", sm_p->u.readdirplus.handle_count[index]); + if (sm_p->u.readdirplus.handle_count[index] > 1) + { + for (i = 0; i < sm_p->u.readdirplus.handle_count[index]; i++) { + get_handle_index(sm_p->u.readdirplus.input_handle_array, + sm_p->u.readdirplus.nhandles, + ((struct attribute_get_multi_results *)attr[0].val)->oid[((struct attribute_get_multi_results *)attr[0].val)->numoid-(sm_p->u.readdirplus.nhandles-i)], + &handle_index, + NULL); + assert(handle_index >= 0); + gossip_err("handle_index: %d\n", handle_index); + + memcpy(&sm_p->u.readdirplus.obj_attr_array[handle_index].owner, ((struct attribute_get_multi_results *)attr[0].val)->val[((struct attribute_get_multi_results *)attr[0].val)->numoid-(sm_p->u.readdirplus.nhandles-i)], ((struct attribute_get_multi_results *)attr[0].val)->outlen[((struct attribute_get_multi_results *)attr[0].val)->numoid-(sm_p->u.readdirplus.nhandles-i)]); + + memcpy(&sm_p->u.readdirplus.obj_attr_array[handle_index].group, ((struct attribute_get_multi_results *)attr[1].val)->val[((struct attribute_get_multi_results *)attr[1].val)->numoid-(sm_p->u.readdirplus.nhandles-i)], ((struct attribute_get_multi_results *)attr[1].val)->outlen[((struct attribute_get_multi_results *)attr[1].val)->numoid-(sm_p->u.readdirplus.nhandles-i)]); + + memcpy(&sm_p->u.readdirplus.obj_attr_array[handle_index].perms, ((struct attribute_get_multi_results *)attr[2].val)->val[((struct attribute_get_multi_results *)attr[2].val)->numoid-(sm_p->u.readdirplus.nhandles-i)], ((struct attribute_get_multi_results *)attr[2].val)->outlen[((struct attribute_get_multi_results *)attr[2].val)->numoid-(sm_p->u.readdirplus.nhandles-i)]); + + memcpy(&sm_p->u.readdirplus.obj_attr_array[handle_index].objtype, ((struct attribute_get_multi_results *)attr[4].val)->val[((struct attribute_get_multi_results *)attr[4].val)->numoid-(sm_p->u.readdirplus.nhandles-i)], ((struct attribute_get_multi_results *)attr[4].val)->outlen[((struct attribute_get_multi_results *)attr[4].val)->numoid-(sm_p->u.readdirplus.nhandles-i)]); + } } else { - PINT_copy_osd_object_attr(&sm_p->u.readdirplus.obj_attr_array[handle_index], command); + get_handle_index(sm_p->u.readdirplus.input_handle_array, + sm_p->u.readdirplus.nhandles, + sm_p->u.readdirplus.handles[index][0], + &handle_index, + NULL); + gossip_err("handle_index: %d\n", handle_index); + + /* memcpy the attributes from osd_command attr to sm_p attr object */ + if (*(PVFS_ds_type*)command->attr[4].val == PVFS_TYPE_DIRECTORY) { + PINT_copy_osd_dir_attr(&sm_p->u.readdirplus.obj_attr_array[handle_index], command); + } else { + PINT_copy_osd_object_attr(&sm_p->u.readdirplus.obj_attr_array[handle_index], command); + } } osd_command_attr_free(command);