From: nathan Date: Fri, 11 Nov 2005 20:02:29 +0000 (+0000) Subject: Branch b1_4_mountconf X-Git-Tag: v1_8_0_110~486^4~138 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=9df27563527479f23eade414d3ef4db6a07beb85;p=fs%2Flustre-release.git Branch b1_4_mountconf b=8008 fix broken mgc compile rename some MGS_ constants to MGMT_ for easier distinguishing from MDS_ --- diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index b6ca8b3..e0b193e 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -215,10 +215,10 @@ static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags) #define OBD_CONNECT_RDONLY 0x1ULL #define OBD_CONNECT_SRVLOCK 0x10ULL /* server takes locks for client */ -#define MGS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY) #define MDS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY) #define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK) #define ECHO_CONNECT_SUPPORTED (0) +#define MGMT_CONNECT_SUPPORTED (0) /* This structure is used for both request and reply. * @@ -938,16 +938,36 @@ struct ptlbd_rsp { extern void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r); + /* - * Opcodes for management/monitoring node. + * Opcodes for mountconf (mgs and mgc) */ typedef enum { MGMT_CONNECT = 250, MGMT_DISCONNECT, MGMT_EXCEPTION, /* node died, etc. */ + MGMT_OST_ADD, + MGMT_OST_DEL, MGMT_LAST_OPC -} mgmt_cmd_t; -#define MGMT_FIRST_OPC MGMT_CONNECT +} mgs_cmd_t; + +struct mgmt_ost_info { + struct list_head moi_list; + char moi_ostname[64]; + char moi_nodename[64]; + char moi_ostuuid[64]; + __u64 moi_nid; /* lnet_nid_t */ + __u32 moi_stripe_index; +}; + +extern void lustre_swab_mgmt_ost_info(struct mgmt_ost_info *oinfo); + +struct mgmt_mds_info { + __u64 mmi_nid; +}; + +extern void lustre_swab_mgmt_mds_info(struct mgmt_mds_info *oinfo); + /* * Opcodes for multiple servers. @@ -1180,16 +1200,4 @@ typedef enum { QUOTA_DQREL = 602, } quota_cmd_t; -/*mount-conf*/ - -/* - * Opcodes for management/monitoring node. - */ -typedef enum { - MGS_CONNECT = 700, - MGS_DISCONNECT, - MGS_LAST_OPC -} mgs_cmd_t; -#define MGS_FIRSTOPC MGS_CONNECT, - #endif diff --git a/lustre/include/linux/lustre_mgs.h b/lustre/include/linux/lustre_mgs.h index c16697f..508a27d 100644 --- a/lustre/include/linux/lustre_mgs.h +++ b/lustre/include/linux/lustre_mgs.h @@ -69,16 +69,6 @@ struct mgc_op_data { __u64 obj_version; }; -struct ost_info { - struct list_head osi_list; - char osi_ostname[64]; - char osi_nodename[64]; - char osi_ostuuid[64]; - lnet_nid_t osi_nid; - __u32 osi_nal; - __u32 osi_stripe_index; -}; - struct system_db { __u64 version; char fsname[64]; diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 16fbf26..79f5a22 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -211,7 +211,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) } else if (!strcmp(name, LUSTRE_MGC_NAME)) { rq_portal = MGC_REQUEST_PORTAL; rp_portal = MGC_REPLY_PORTAL; - connect_op = MGS_CONNECT; + connect_op = MGMT_CONNECT; is_mgc++; } else { CERROR("unknown client OBD type \"%s\", can't setup\n", diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 848c78f..d3ebba9 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -44,23 +44,23 @@ #include #include #include -//#include +#include #include "mgc_internal.h" -int mgc_ost_add(struct obd_export *exp, struct ost_info *oinfo, - struct mds_info *minfo) +int mgc_ost_add(struct obd_export *exp, struct mgmt_ost_info *oinfo, + struct mgmt_mds_info *minfo) { struct ptlrpc_request *req; - struct ost_info *req_oinfo; + struct mgmt_ost_info *req_oinfo; int size = sizeof(*req_oinfo); int rep_size[2] = { sizeof(*oinfo), sizeof(*minfo)}; int rc; ENTRY; - req = ptlrpc_prep_req(class_exp2cliimp(exp), - MGS_OST_ADD, 1, &size, NULL); + req = ptlrpc_prep_req(class_exp2cliimp(exp), MGMT_OST_ADD, + 1, &size, NULL); if (!req) RETURN(rc = -ENOMEM); @@ -71,18 +71,18 @@ int mgc_ost_add(struct obd_export *exp, struct ost_info *oinfo, rc = ptlrpc_queue_wait(req); if (!rc) { - struct ost_info *rep_oinfo; - struct mds_info *rep_minfo; + struct mgmt_ost_info *rep_oinfo; + struct mgmt_mds_info *rep_minfo; rep_oinfo = lustre_swab_repbuf(req, 0, sizeof(*rep_oinfo), - lustre_swab_ost_info); + lustre_swab_mgmt_ost_info); rep_minfo = lustre_swab_repbuf(req, 1, sizeof(*rep_minfo), - lustre_swab_mds_info); - if (rep_oinfo->osi_stripe_index == -1) { + lustre_swab_mgmt_mds_info); + if (rep_oinfo->moi_stripe_index == -1) { CERROR ("Register failed\n"); GOTO (out, rc = -EINVAL); } CERROR("register OK.(index = %d)\n", - rep_oinfo->osi_stripe_index); + rep_oinfo->moi_stripe_index); memcpy(oinfo, rep_oinfo, sizeof(*oinfo)); memcpy(minfo, rep_minfo, sizeof(*minfo)); } @@ -94,15 +94,15 @@ out: } EXPORT_SYMBOL(mgc_ost_add); -int mgc_ost_del(struct obd_export *exp, struct ost_info *oinfo) +int mgc_ost_del(struct obd_export *exp, struct mgmt_ost_info *oinfo) { struct ptlrpc_request *req; - struct ost_info *req_oinfo; + struct mgmt_ost_info *req_oinfo; int size = sizeof(*req_oinfo); int rc; ENTRY; - req = ptlrpc_prep_req(class_exp2cliimp(exp), MGS_OST_DEL, + req = ptlrpc_prep_req(class_exp2cliimp(exp), MGMT_OST_DEL, 1, &size, NULL); if (!req) RETURN(rc = -ENOMEM); @@ -113,7 +113,7 @@ int mgc_ost_del(struct obd_export *exp, struct ost_info *oinfo) rc = ptlrpc_queue_wait(req); if (!rc) CERROR("unregister OK.(old index = %d)\n", - oinfo->osi_stripe_index); + oinfo->moi_stripe_index); else { CERROR ("Unregister failed\n"); GOTO (out, rc = -EINVAL); diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 03a22bc..c525114 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -76,7 +76,7 @@ static int mgs_connect(struct lustre_handle *conn, struct obd_device *obd, med = &exp->exp_mgs_data; if (data != NULL) { - data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED; + data->ocd_connect_flags &= MGMT_CONNECT_SUPPORTED; exp->exp_connect_flags = data->ocd_connect_flags; } @@ -354,7 +354,7 @@ int mgs_handle(struct ptlrpc_request *req) LASSERT(current->journal_info == NULL); /* XXX identical to MDS */ - if (req->rq_reqmsg->opc != MGS_CONNECT) { + if (req->rq_reqmsg->opc != MGMT_CONNECT) { struct mgs_export_data *med; int abort_recovery; @@ -394,7 +394,7 @@ int mgs_handle(struct ptlrpc_request *req) } switch (req->rq_reqmsg->opc) { - case MGS_CONNECT: + case MGMT_CONNECT: DEBUG_REQ(D_INODE, req, "connect"); OBD_FAIL_RETURN(OBD_FAIL_MGS_CONNECT_NET, 0); rc = target_handle_connect(req, mgs_handle); @@ -405,7 +405,7 @@ int mgs_handle(struct ptlrpc_request *req) } break; - case MGS_DISCONNECT: + case MGMT_DISCONNECT: DEBUG_REQ(D_INODE, req, "disconnect"); OBD_FAIL_RETURN(OBD_FAIL_MGS_DISCONNECT_NET, 0); rc = target_handle_disconnect(req); @@ -472,7 +472,7 @@ int mgs_handle(struct ptlrpc_request *req) LASSERT(current->journal_info == NULL); /* If we're DISCONNECTing, the mgs_export_data is already freed */ - if (!rc && req->rq_reqmsg->opc != MGS_DISCONNECT) { + if (!rc && req->rq_reqmsg->opc != MGMT_DISCONNECT) { struct mgs_export_data *med = &req->rq_export->exp_mgs_data; req->rq_repmsg->last_xid = le64_to_cpu(med->med_mcd->mcd_last_xid); diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 6eaef93..b0afd3d 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -391,14 +391,15 @@ static int mgs_write_mds_llog(struct obd_device *obd, char* name) char osc_name[64]; char index[16]; char *setup_argv[2]; - struct ost_info *oinfo = list_entry(tmp, struct ost_info, - osi_list); + struct mgmt_ost_info *oinfo; - sprintf(ost_node_uuid, "%s_UUID", oinfo->osi_nodename); + oinfo = list_entry(tmp, struct mgmt_ost_info, moi_list); + + sprintf(ost_node_uuid, "%s_UUID", oinfo->moi_nodename); sprintf(osc_name,"OSC_%s_%s_%s", - db->mds_nodename, oinfo->osi_ostname, db->mds_name); + db->mds_nodename, oinfo->moi_ostname, db->mds_name); - rc = record_add_uuid(obd, llh, oinfo->osi_nid, ost_node_uuid); + rc = record_add_uuid(obd, llh, oinfo->moi_nid, ost_node_uuid); if (rc) { CERROR("failed to record log(add_uuid) %s: %d\n", name, rc); @@ -412,7 +413,7 @@ static int mgs_write_mds_llog(struct obd_device *obd, char* name) RETURN(rc); } - setup_argv[0] = oinfo->osi_ostuuid; + setup_argv[0] = oinfo->moi_ostuuid; setup_argv[1] = ost_node_uuid; rc = record_setup(obd, llh, osc_name, 2, setup_argv); if (rc) { @@ -421,9 +422,9 @@ static int mgs_write_mds_llog(struct obd_device *obd, char* name) RETURN(rc); } - sprintf(index, "%d", oinfo->osi_stripe_index); + sprintf(index, "%d", oinfo->moi_stripe_index); rc = record_lov_modify_tgts(obd, llh, lov_name, "add", - oinfo->osi_ostuuid, index, "1"); + oinfo->moi_ostuuid, index, "1"); if (rc) { CERROR("failed to record log(lov_modify_tgts) %s: %d\n", name, rc); @@ -505,14 +506,15 @@ static int mgs_write_client_llog(struct obd_device *obd, char* name) char ost_node_uuid[64]; char osc_name[64]; char index[16]; - struct ost_info *oinfo = list_entry(tmp, struct ost_info, - osi_list); + struct mgmt_ost_info *oinfo; + + oinfo = list_entry(tmp, struct mgmt_ost_info, moi_list); - sprintf(ost_node_uuid, "%s_UUID", oinfo->osi_nodename); + sprintf(ost_node_uuid, "%s_UUID", oinfo->moi_nodename); sprintf(osc_name, "OSC_%s_%s_MNT_client", - db->mds_nodename, oinfo->osi_ostname); + db->mds_nodename, oinfo->moi_ostname); - rc = record_add_uuid(obd, llh, oinfo->osi_nid, ost_node_uuid); + rc = record_add_uuid(obd, llh, oinfo->moi_nid, ost_node_uuid); if (rc) { CERROR("failed to record log(add_uuid) %s: %d\n", name, rc); @@ -526,7 +528,7 @@ static int mgs_write_client_llog(struct obd_device *obd, char* name) RETURN(rc); } - setup_argv[0] = oinfo->osi_ostuuid; + setup_argv[0] = oinfo->moi_ostuuid; setup_argv[1] = ost_node_uuid; rc = record_setup(obd, llh, osc_name, 2, setup_argv); if (rc) { @@ -535,9 +537,9 @@ static int mgs_write_client_llog(struct obd_device *obd, char* name) RETURN(rc); } - sprintf(index, "%d", oinfo->osi_stripe_index); + sprintf(index, "%d", oinfo->moi_stripe_index); rc = record_lov_modify_tgts(obd, llh, lov_name, "add", - oinfo->osi_ostuuid, index, "1"); + oinfo->moi_ostuuid, index, "1"); if (rc) { CERROR("failed to record log(lov_modify_tgts) %s: %d\n", name, rc); diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index b51c01f..d2d0ae5 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -556,16 +556,15 @@ void lustre_swab_mds_body (struct mds_body *b) __swab32s (&b->padding_4); } -void lustre_swab_ost_info(struct ost_info *oinfo) +void lustre_swab_mgmt_ost_info(struct mgmt_ost_info *oinfo) { - __swab64s(&oinfo->osi_nid); - __swab32s(&oinfo->osi_nal); - __swab32s(&oinfo->osi_stripe_index); + __swab64s(&oinfo->moi_nid); + __swab32s(&oinfo->moi_stripe_index); } -void lustre_swab_mds_info(struct mds_info *minfo) +void lustre_swab_mgmt_mds_info(struct mgmt_mds_info *minfo) { - __swab64s(&minfo->mds_nid); + __swab64s(&minfo->mmi_nid); } static void lustre_swab_obd_dqinfo (struct obd_dqinfo *i) @@ -1041,6 +1040,10 @@ void lustre_assert_wire_constants(void) (long long)MGMT_DISCONNECT); LASSERTF(MGMT_EXCEPTION == 252, " found %lld\n", (long long)MGMT_EXCEPTION); + LASSERTF(MGMT_OST_ADD == 253, " found %lld\n", + (long long)MGMT_OST_ADD); + LASSERTF(MGMT_OST_DEL == 254, " found %lld\n", + (long long)MGMT_OST_DEL); LASSERTF(OBD_PING == 400, " found %lld\n", (long long)OBD_PING); LASSERTF(OBD_LOG_CANCEL == 401, " found %lld\n", diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index a0c2421..ff1c66f 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -186,8 +186,8 @@ EXPORT_SYMBOL(lustre_swab_ptlbd_op); EXPORT_SYMBOL(lustre_swab_ptlbd_niob); EXPORT_SYMBOL(lustre_swab_ptlbd_rsp); EXPORT_SYMBOL(lustre_swab_qdata); -EXPORT_SYMBOL(lustre_swab_ost_info); -EXPORT_SYMBOL(lustre_swab_mds_info); +EXPORT_SYMBOL(lustre_swab_mgmt_ost_info); +EXPORT_SYMBOL(lustre_swab_mgmt_mds_info); /* recover.c */ EXPORT_SYMBOL(ptlrpc_run_recovery_over_upcall); diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index e92bba4..1057ced 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -120,7 +120,7 @@ update_mtab_entry(char *spec, char *mtpt, char *type, char *opts, } /* Get rid of symbolic hostnames for tcp */ -#define MAXNIDSTR 256 +#define MAXNIDSTR 1024 static char *convert_hostnames(char *s1) { char *converted, *s2, *c; diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 08a4721..e3cdd69 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -930,6 +930,8 @@ main(int argc, char **argv) CHECK_VALUE(MGMT_CONNECT); CHECK_VALUE(MGMT_DISCONNECT); CHECK_VALUE(MGMT_EXCEPTION); + CHECK_VALUE(MGMT_OST_ADD); + CHECK_VALUE(MGMT_OST_DEL); CHECK_VALUE(OBD_PING); CHECK_VALUE(OBD_LOG_CANCEL); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index a6dab8e..b96ef7d 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -14,12 +14,12 @@ void lustre_assert_wire_constants(void); int main() { - lustre_assert_wire_constants(); + lustre_assert_wire_constants(); - if (ret == 0) - printf("wire constants OK\n"); + if (ret == 0) + printf("wire constants OK\n"); - return ret; + return ret; } void lustre_assert_wire_constants(void) @@ -204,6 +204,10 @@ void lustre_assert_wire_constants(void) (long long)MGMT_DISCONNECT); LASSERTF(MGMT_EXCEPTION == 252, " found %lld\n", (long long)MGMT_EXCEPTION); + LASSERTF(MGMT_OST_ADD == 253, " found %lld\n", + (long long)MGMT_OST_ADD); + LASSERTF(MGMT_OST_DEL == 254, " found %lld\n", + (long long)MGMT_OST_DEL); LASSERTF(OBD_PING == 400, " found %lld\n", (long long)OBD_PING); LASSERTF(OBD_LOG_CANCEL == 401, " found %lld\n",