From 280d279dfd7ae9b6d7287ab2d9815fa533734029 Mon Sep 17 00:00:00 2001 From: lincent Date: Mon, 28 Nov 2005 17:51:04 +0000 Subject: [PATCH] llog producing --- lustre/include/linux/lustre_disk.h | 2 +- lustre/include/linux/lustre_idl.h | 11 +++++++---- lustre/include/linux/lustre_mgs.h | 25 ++----------------------- lustre/include/linux/obd.h | 4 ++-- lustre/include/linux/obd_support.h | 2 +- lustre/mgs/mgs_handler.c | 19 +++++++++++++------ lustre/ptlrpc/pack_generic.c | 4 ++-- lustre/utils/wirecheck.c | 2 +- lustre/utils/wiretest.c | 4 ++-- 9 files changed, 31 insertions(+), 42 deletions(-) diff --git a/lustre/include/linux/lustre_disk.h b/lustre/include/linux/lustre_disk.h index 75a9f47..76232cb 100644 --- a/lustre/include/linux/lustre_disk.h +++ b/lustre/include/linux/lustre_disk.h @@ -38,7 +38,7 @@ Used before the setup llog can be read. */ #define MOUNT_CONFIGS_DIR "CONFIGS" #define MOUNT_DATA_FILE MOUNT_CONFIGS_DIR"/mountdata" -#define SYSTEM_DB_FILE "SYSTEM_DB" +#define INDEX_BITMAP_FILE "IB" #define LDD_MAGIC 0xbabb0001 diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index cb31eaa..20f13a1 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -934,17 +934,20 @@ typedef enum { MGMT_CONNECT = 250, MGMT_DISCONNECT, MGMT_EXCEPTION, /* node died, etc. */ - MGMT_REGISTER, /* first connect. */ + MGMT_FIRST_CONNECT, /* first connect. */ + MGMT_MDS_ADD, MGMT_OST_ADD, MGMT_OST_DEL, MGMT_LAST_OPC } mgs_cmd_t; +#define NAME_MAXLEN 64 +#define UUID_MAXLEN NAME_MAXLEN + 5 struct mgmt_ost_info { struct list_head moi_list; - char moi_ostname[64]; - char moi_nodename[64]; - char moi_ostuuid[64]; + char moi_ostname[NAME_MAXLEN]; + char moi_nodename[NAME_MAXLEN]; + char moi_ostuuid[UUID_MAXLEN]; __u64 moi_nid; /* lnet_nid_t */ __u32 moi_stripe_index; }; diff --git a/lustre/include/linux/lustre_mgs.h b/lustre/include/linux/lustre_mgs.h index b109ae2..4c55963 100644 --- a/lustre/include/linux/lustre_mgs.h +++ b/lustre/include/linux/lustre_mgs.h @@ -71,22 +71,11 @@ struct mgc_op_data { struct system_db { char fsname[64]; - char mds_name[64]; - char mds_uuid[64]; - char mds_nodename[64]; - lnet_nid_t mds_nid; - struct lov_desc lovdesc; - int ost_number; + struct list_head db_list; + void* index_map; struct list_head ost_infos; }; -struct llog_verion_desc{ - struct list_head lvd_list; - __u64 lvd_version; - int lvd_ref; - struct llog_log_hdr *lvd_log_hdr; -}; - struct mgc_open_llog { struct list_head mol_list; __u64 mol_step; @@ -94,16 +83,6 @@ struct mgc_open_llog { char mol_fsname[40]; }; -struct mgs_open_llog { - struct list_head mol_list; - char mol_fsname[40]; - struct llog_handle *mol_cfg_llh; - struct dentry *mol_dentry; - spinlock_t mol_lock; - int mol_refs; - struct system_db *mol_system_db; -}; - int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt); int mgs_fs_cleanup(struct obd_device *obddev); diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 813f17c..75bf846 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -344,9 +344,9 @@ struct mgs_obd { struct vfsmount *mgs_vfsmnt; struct super_block *mgs_sb; struct dentry *mgs_configs_dir; - spinlock_t mgs_open_llogs_lock; - struct list_head mgs_open_llogs; struct llog_handle *mgs_cfg_llh; + spinlock_t mgs_system_db_lock; + struct list_head mgs_system_db_list; }; struct mds_obd { diff --git a/lustre/include/linux/obd_support.h b/lustre/include/linux/obd_support.h index b32b6a1..f245de1 100644 --- a/lustre/include/linux/obd_support.h +++ b/lustre/include/linux/obd_support.h @@ -170,7 +170,7 @@ extern wait_queue_head_t obd_race_waitq; #define OBD_FAIL_MGMT 0x900 -#define OBD_FAIL_MGMT_REGISTER 0x901 +#define OBD_FAIL_MGMT_FIRST_CONNECT 0x901 #define OBD_FAIL_MGMT_CONNECT_NET 0x117 #define OBD_FAIL_MGMT_DISCONNECT_NET 0x11a #define OBD_FAIL_MGMT_ALL_REPLY_NET 0x122 diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 68f1182..4f465b4 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -189,8 +189,6 @@ static int mgs_setup(struct obd_device *obd, obd_count len, void *buf) GOTO(err_ns, rc); } - INIT_LIST_HEAD(&mgs->mgs_open_llogs); - rc = llog_start_commit_thread(); if (rc < 0) GOTO(err_fs, rc); @@ -377,14 +375,23 @@ int mgs_handle(struct ptlrpc_request *req) OBD_FAIL_RETURN(OBD_FAIL_OBD_LOG_CANCEL_NET, 0); rc = -ENOTSUPP; /* la la la */ break; - case MGMT_REGISTER: - CDEBUG(D_INODE, "mds/(maybe new filesystem) register\n"); - OBD_FAIL_RETURN(OBD_FAIL_MGMT_REGISTER, 0); - rc = mgs_mds_register(req); + case MGMT_FIRST_CONNECT: + CDEBUG(D_INODE, "server connect at first time\n"); + OBD_FAIL_RETURN(OBD_FAIL_MGMT_FIRST_CONNECT, 0); + rc = mgmt_handle_first_connect(req); + break; case MGMT_OST_ADD: CDEBUG(D_INODE, "ost add\n"); + rc = mgmt_handle_ost_add(req); + break; case MGMT_OST_DEL: CDEBUG(D_INODE, "ost del\n"); + rc = mgmt_handle_ost_del(req); + break; + case MGMT_MDS_ADD: + CDEBUG(D_INODE, "mds add\n"); + rc = mgmt_handle_mds_add(req); + break; case LLOG_ORIGIN_HANDLE_CREATE: DEBUG_REQ(D_INODE, req, "llog_init"); OBD_FAIL_RETURN(OBD_FAIL_OBD_LOGD_NET, 0); diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index d886424..0f67951 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1026,8 +1026,8 @@ void lustre_assert_wire_constants(void) (long long)MGMT_DISCONNECT); LASSERTF(MGMT_EXCEPTION == 252, " found %lld\n", (long long)MGMT_EXCEPTION); - LASSERTF(MGMT_REGISTER == 253, " found %lld\n", - (long long)MGMT_REGISTER); + LASSERTF(MGMT_FIRST_CONNECT == 253, " found %lld\n", + (long long)MGMT_FIRST_CONNECT); LASSERTF(MGMT_OST_ADD == 254, " found %lld\n", (long long)MGMT_OST_ADD); LASSERTF(MGMT_OST_DEL == 255, " found %lld\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index b548e98..ee4a850 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -928,7 +928,7 @@ main(int argc, char **argv) CHECK_VALUE(MGMT_CONNECT); CHECK_VALUE(MGMT_DISCONNECT); CHECK_VALUE(MGMT_EXCEPTION); - CHECK_VALUE(MGMT_REGISTER); + CHECK_VALUE(MGMT_FIRST_CONNECT); CHECK_VALUE(MGMT_OST_ADD); CHECK_VALUE(MGMT_OST_DEL); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 193049a..c4814ff 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -196,8 +196,8 @@ void lustre_assert_wire_constants(void) (long long)MGMT_DISCONNECT); LASSERTF(MGMT_EXCEPTION == 252, " found %lld\n", (long long)MGMT_EXCEPTION); - LASSERTF(MGMT_REGISTER == 253, " found %lld\n", - (long long)MGMT_REGISTER); + LASSERTF(MGMT_FIRST_CONNECT == 253, " found %lld\n", + (long long)MGMT_FIRST_CONNECT); LASSERTF(MGMT_OST_ADD == 254, " found %lld\n", (long long)MGMT_OST_ADD); LASSERTF(MGMT_OST_DEL == 255, " found %lld\n", -- 1.8.3.1