From ad8175919e2bcc1bc0f47591cd22a8e6b19c89f0 Mon Sep 17 00:00:00 2001 From: lincent Date: Tue, 2 Aug 2005 10:20:55 +0000 Subject: [PATCH] new head file for mgc/mgs --- lustre/include/linux/lustre_export.h | 22 ++++++++++++++++++++++ lustre/include/linux/lustre_idl.h | 18 ++++++++++++++++++ lustre/include/linux/obd.h | 27 +++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/lustre/include/linux/lustre_export.h b/lustre/include/linux/lustre_export.h index 012f3c8..027e692 100644 --- a/lustre/include/linux/lustre_export.h +++ b/lustre/include/linux/lustre_export.h @@ -8,6 +8,26 @@ #include #include +/*export struct for mount-conf */ +/*FIXME: some attributes Mixed now*/ +/* Data stored per client in the last_rcvd file. In le32 order. */ +struct mgs_client_data { + __u8 mcd_uuid[40]; /* client UUID */ + __u64 mcd_last_transno; /* last completed transaction ID */ + __u64 mcd_last_xid; /* xid for the last transaction */ + __u32 mcd_last_result; /* result from last RPC */ + __u32 mcd_last_data; /* per-op data (disposition for open &c.) */ + __u8 mcd_padding[MDS_LR_CLIENT_SIZE - 64]; +}; + +struct mgs_export_data { + struct list_head med_open_head; + spinlock_t med_open_lock; /* lock med_open_head, mfd_list*/ + struct mgs_client_data *med_mcd; + loff_t med_lr_off; + int med_lr_idx; +}; + struct mds_client_data; struct mds_export_data { @@ -72,12 +92,14 @@ struct obd_export { exp_replay_needed:1, exp_libclient:1; /* liblustre client? */ union { + struct mgs_export_data eu_mgs_data; struct mds_export_data eu_mds_data; struct filter_export_data eu_filter_data; struct ec_export_data eu_ec_data; } u; }; +#define exp_mgs_data u.eu_mgs_data #define exp_mds_data u.eu_mds_data #define exp_lov_data u.eu_lov_data #define exp_filter_data u.eu_filter_data diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 9e676ab..b0cb0ed 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -92,6 +92,11 @@ #define MGMT_REPLY_PORTAL 25 #define MGMT_CLI_REQUEST_PORTAL 26 #define MGMT_CLI_REPLY_PORTAL 27 +//#define MGC_REQUEST_PORTAL 28 +#define MGC_REPLY_PORTAL 29 +#define MGS_REQUEST_PORTAL 30 +//#define MGS_REPLY_PORTAL 31 + #define SVC_KILLED 1 #define SVC_EVENT 2 @@ -203,6 +208,7 @@ static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags) #define OBD_CONNECT_RDONLY 0x1 +#define MGS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY) #define MDS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY) #define OST_CONNECT_SUPPORTED (0) #define ECHO_CONNECT_SUPPORTED (0) @@ -1160,4 +1166,16 @@ 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/obd.h b/lustre/include/linux/obd.h index 87bfcba..ece6e98 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -302,6 +302,31 @@ struct client_obd { int cl_qchk_stat; /* quotacheck stat of the peer */ }; +struct mgs_server_data; + +/*a light client obd for mount-conf */ +struct mgc_obd { + struct obd_import *cl_import; + struct semaphore cl_sem; + int cl_conn_count; + struct mgc_rpc_lock *cl_rpc_lock; +} + +struct mgs_obd { + struct ptlrpc_service *mgs_service; + struct vfsmount *mgs_vfsmnt; + struct super_block *mgs_sb; + struct file *mgs_rcvd_filp; + spinlock_t mgs_transno_lock; + __u64 mgs_last_transno; + struct mgs_server_data *mgs_server_data; + struct dentry *mgs_configs_dir; + struct llog_handle *mgs_cfg_llh; + char *mgs_profile; + unsigned long *mgs_client_bitmap; + struct semaphore mgs_orphan_recovery_sem; +}; + /* Like a client, with some hangers-on. Keep mc_client_obd first so that we * can reuse the various client setup/connect functions. */ struct mgmtcli_obd { @@ -565,6 +590,8 @@ struct obd_device { struct cache_obd cobd; struct ptlbd_obd ptlbd; struct mgmtcli_obd mgmtcli; + struct mgc_obd mgc; + struct mgs_obd mgs; } u; /* Fields used by LProcFS */ unsigned int obd_cntr_base; -- 1.8.3.1