Skip to content

Commit

Permalink
get member attributes for dir sm works
Browse files Browse the repository at this point in the history
* same pid is used for regular and collection objects
* regular directory object creation (old case) needs to be implemented for comparison
  • Loading branch information
cek10006 committed Oct 8, 2012
1 parent aaba35a commit 9a237d9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config.save
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/client/sysint/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 34 additions & 12 deletions src/client/sysint/sys-readdirplus.sm
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 9a237d9

Please sign in to comment.