Skip to content

Commit

Permalink
get_member_attr is all set except for a few minor things, such as the…
Browse files Browse the repository at this point in the history
… oid comparison in sys_readdirplus.sm and creating a new collection whenever a new directory is created

git-svn-id: svn+ssh://137.99.13.219/srv/svn/ofsproject/ofsproject/2.8.4-stock/osd_branch@52 dfcdf660-53a5-499b-8775-f9b82cf2d3b9
  • Loading branch information
cek10006 committed Nov 11, 2011
1 parent a73feac commit ce4e019
Show file tree
Hide file tree
Showing 13 changed files with 644 additions and 369 deletions.
3 changes: 0 additions & 3 deletions src/client/sysint/client-state-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,6 @@ extern struct PINT_state_machine_s pvfs2_client_datafile_getattr_sizes_sm;
extern struct PINT_state_machine_s pvfs2_client_setattr_sm;
extern struct PINT_state_machine_s pvfs2_client_io_sm;
extern struct PINT_state_machine_s pvfs2_client_osd_io_sm;
extern struct PINT_state_machine_s pvfs2_client_osd_dirops_sm;
extern struct PINT_state_machine_s pvfs2_client_osd_dirops_attr1_sm;
extern struct PINT_state_machine_s pvfs2_client_osd_dirops_attr4_sm;
extern struct PINT_state_machine_s pvfs2_client_small_io_sm;
extern struct PINT_state_machine_s pvfs2_client_flush_sm;
extern struct PINT_state_machine_s pvfs2_client_sysint_readdir_sm;
Expand Down
2 changes: 1 addition & 1 deletion src/client/sysint/mgmt-noop.sm
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ static PINT_sm_action mgmt_noop_setup_msgpair(
js_p->error_code = OSD_MSGPAIR;
} else {
PINT_SERVREQ_MGMT_NOOP_FILL(sm_p->msgarray_op.msgpair.req, *sm_p->cred_p, sm_p->hints);
PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
js_p->error_code = 0;
}

PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
return SM_ACTION_COMPLETE;
}

Expand Down
3 changes: 1 addition & 2 deletions src/client/sysint/module.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ CLIENT_SMCGEN := \
$(DIR)/mgmt-create-dirent.c \
$(DIR)/mgmt-get-dirdata-handle.c \
$(DIR)/osdsm.c \
$(DIR)/sys-osd-io.c \
$(DIR)/sys-osd-dir.c
$(DIR)/sys-osd-io.c

# track generated .c files that need to be removed during dist clean, etc.
SMCGEN += $(CLIENT_SMCGEN)
Expand Down
6 changes: 4 additions & 2 deletions src/client/sysint/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ void osd_find_scsi_addresses(PVFS_fs_id fs_id, int32_t *num_osd,
goto out;
}
for (j = 0; j < num_drives; j++) {
if (strcmp(drives[j].hostname,
hmap->alias_mapping->host_alias) == 0) {
/*if (strcmp(drives[j].targetname,
hmap->alias_mapping->host_alias) == 0) {*/
if (strcmp(drives[j].targetname,
"beaf10") == 0) {
if (num >= max_addrs) {
num = 0;
goto out;
Expand Down
24 changes: 20 additions & 4 deletions src/client/sysint/osdsm.sm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "pint-util.h"
#include "server-config-mgr.h"
#include "pvfs2-internal.h"
#include "osd-util/osd-util.h"

enum
{
Expand Down Expand Up @@ -75,6 +76,12 @@ nested machine pvfs2_osd_msgpairarray_sm
{
run osd_msgpairarray_all_complete;
MSGPAIRS_RETRY => post_retry;
default => done;
}

state done
{
run osd_msgpairarray_done;
default => return;
}
}
Expand All @@ -83,7 +90,8 @@ nested machine pvfs2_osd_msgpairarray_sm

static int osd_msgpairarray_init(struct PINT_smcb *smcb, job_status_s *js_p)
{
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM);

int i = 0;
PINT_sm_msgpair_state *msg_p = NULL;

Expand Down Expand Up @@ -127,7 +135,7 @@ static int osd_msgpairarray_init(struct PINT_smcb *smcb, job_status_s *js_p)
*/
static int osd_msgpairarray_post(struct PINT_smcb *smcb, job_status_s *js_p)
{
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM);
int ret = -PVFS_EINVAL, i;
PVFS_msg_tag_t session_tag;
PINT_sm_msgpair_state *msg_p;
Expand Down Expand Up @@ -213,7 +221,7 @@ static int osd_msgpairarray_post_retry(struct PINT_smcb *smcb,
static int osd_msgpairarray_one_complete(struct PINT_smcb *smcb,
job_status_s *js_p)
{
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM);
PINT_sm_msgpair_state *msg_p;

gossip_debug(GOSSIP_MSGPAIR_DEBUG, "%s: sm %p tag %lld count %d\n",
Expand Down Expand Up @@ -242,7 +250,7 @@ static int osd_msgpairarray_one_complete(struct PINT_smcb *smcb,
static int osd_msgpairarray_all_complete(struct PINT_smcb *smcb,
job_status_s *js_p)
{
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM);
int i;

js_p->error_code = 0;
Expand Down Expand Up @@ -285,6 +293,14 @@ static int osd_msgpairarray_all_complete(struct PINT_smcb *smcb,
return SM_ACTION_COMPLETE;
}

static int osd_msgpairarray_done(
struct PINT_smcb *smcb, job_status_s *js_p)
{
int task_id, error_code, remaining;
PINT_sm_pop_frame(smcb, &task_id, &error_code, &remaining);
return SM_ACTION_COMPLETE;
}

/*
* vim: ts=8 sts=4 sw=4 expandtab ft=c
*/
26 changes: 18 additions & 8 deletions src/client/sysint/remove.sm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ extern job_context_id pint_client_sm_context;
enum
{
REMOVE_MUST_REMOVE_DATAFILES = 1,
OSD_MSGPAIR = 2001
OSD_MSGPAIR = 2001,
OSD_MDFILE_MSGPAIR = 2002
};

#define HANDLE_REMOVE_ERROR(state) \
Expand Down Expand Up @@ -94,6 +95,7 @@ nested machine pvfs2_client_remove_helper_sm
state object_remove_setup_msgpair
{
run remove_object_remove_setup_msgpair;
OSD_MDFILE_MSGPAIR => remove_helper_cleanup;
OSD_MSGPAIR => object_remove_xfer_osd_msgpair;
success => object_remove_xfer_msgpair;
default => object_remove_failure;
Expand Down Expand Up @@ -131,7 +133,6 @@ nested machine pvfs2_client_remove_helper_sm
static PINT_sm_action remove_getattr_init(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("remove_getattr_init\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
PINT_SM_GETATTR_STATE_FILL(
sm_p->getattr,
Expand All @@ -145,7 +146,6 @@ static PINT_sm_action remove_getattr_init(
static PINT_sm_action remove_getattr_analyze_results(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("remove_getattr_analyze_results\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
PVFS_object_attr *attr = NULL;
attr = &sm_p->getattr.attr;
Expand Down Expand Up @@ -189,7 +189,6 @@ static PINT_sm_action remove_getattr_analyze_results(
static PINT_sm_action remove_datafile_remove_setup_msgpair(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("remove_datafile_remove_setup_msgpair\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
PVFS_object_attr *attr = NULL;
int ret = -PVFS_EINVAL;
Expand Down Expand Up @@ -247,22 +246,30 @@ static PINT_sm_action remove_datafile_remove_setup_msgpair(
attr->u.meta.dfile_count,
attr->u.meta.dfile_array,
sm_p->hints);
PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
}

PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
return SM_ACTION_COMPLETE;
}

static PINT_sm_action remove_object_remove_setup_msgpair(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("remove_object_remove_setup_msgpair\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
int ret = -PVFS_EINVAL;
PINT_sm_msgpair_state *msg_p = NULL;

int is_osd_md = fsid_is_osd_md(sm_p->object_ref.fs_id);

gossip_debug(GOSSIP_CLIENT_DEBUG,
"remove state: object_remove_setup_msgpair\n");

if (is_osd_md) {
/* no mdfile to remove */
js_p->error_code = OSD_MDFILE_MSGPAIR;
return SM_ACTION_COMPLETE;
}

PINT_msgpair_init(&sm_p->msgarray_op);
msg_p = &sm_p->msgarray_op.msgpair;

Expand Down Expand Up @@ -304,12 +311,12 @@ static PINT_sm_action remove_object_remove_setup_msgpair(
sm_p->object_ref.handle,
sm_p->hints);
js_p->error_code = 0;
PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
}

msg_p->retry_flag = PVFS_MSGPAIR_RETRY;
msg_p->comp_fn = NULL;

PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
return SM_ACTION_COMPLETE;
}

Expand Down Expand Up @@ -348,7 +355,6 @@ static PINT_sm_action remove_object_remove_failure(
static PINT_sm_action remove_helper_cleanup(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("remove_helper_cleanup\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
gossip_debug(GOSSIP_CLIENT_DEBUG, "remove state: helper cleanup\n");

Expand All @@ -358,6 +364,10 @@ static PINT_sm_action remove_helper_cleanup(

PINT_msgpairarray_destroy(&sm_p->msgarray_op);

/* came directly from object_remove_setup_msgpair, no error to check */
if (js_p->error_code == OSD_MDFILE_MSGPAIR)
js_p->error_code = 0;

if (js_p->error_code)
{
char buf[64] = {0};
Expand Down
Loading

0 comments on commit ce4e019

Please sign in to comment.