-/* mgs_llog.c */
-int class_dentry_readdir(struct obd_device *obd, struct dentry *dir,
- struct vfsmount *inmnt,
- cfs_list_t *dentry_list);
-
-int mgs_init_fsdb_list(struct obd_device *obd);
-int mgs_cleanup_fsdb_list(struct obd_device *obd);
-int mgs_find_or_make_fsdb(struct obd_device *obd, char *name,
- struct fs_db **dbh);
-struct fs_db *mgs_find_fsdb(struct obd_device *obd, char *fsname);
-int mgs_get_fsdb_srpc_from_llog(struct obd_device *obd, struct fs_db *fsdb);
-int mgs_check_index(struct obd_device *obd, struct mgs_target_info *mti);
-int mgs_check_failnid(struct obd_device *obd, struct mgs_target_info *mti);
-int mgs_write_log_target(struct obd_device *obd, struct mgs_target_info *mti,
- struct fs_db *fsdb);
-int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti,
- struct fs_db *fsdb);
-int mgs_erase_log(struct obd_device *obd, char *name);
-int mgs_erase_logs(struct obd_device *obd, char *fsname);
-int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname);
-
-int mgs_pool_cmd(struct obd_device *obd, enum lcfg_command_type cmd,
- char *poolname, char *fsname, char *ostname);
+struct mgs_device {
+ struct dt_device mgs_dt_dev;
+ struct ptlrpc_service *mgs_service;
+ struct dt_device *mgs_bottom;
+ struct obd_export *mgs_bottom_exp;
+ struct dt_object *mgs_configs_dir;
+ struct dt_object *mgs_nidtbl_dir;
+ struct list_head mgs_fs_db_list;
+ spinlock_t mgs_lock; /* covers mgs_fs_db_list */
+ struct proc_dir_entry *mgs_proc_live;
+ struct proc_dir_entry *mgs_proc_osd;
+ struct proc_dir_entry *mgs_proc_fstype;
+ struct proc_dir_entry *mgs_proc_mntdev;
+ cfs_time_t mgs_start_time;
+ struct obd_device *mgs_obd;
+ struct local_oid_storage *mgs_los;
+ struct mutex mgs_mutex;
+ struct mutex mgs_health_mutex;
+ struct rw_semaphore mgs_barrier_rwsem;
+ struct lu_target mgs_lut;
+};
+
+/* this is a top object */
+struct mgs_object {
+ struct lu_object_header mgo_header;
+ struct dt_object mgo_obj;
+ int mgo_no_attrs;
+ int mgo_reserved;
+};
+
+int mgs_init_fsdb_list(struct mgs_device *mgs);
+int mgs_cleanup_fsdb_list(struct mgs_device *mgs);
+int mgs__mgs_fsdb_setup(const struct lu_env *env, struct mgs_device *mgs);
+int mgs_params_fsdb_setup(const struct lu_env *env, struct mgs_device *mgs);
+int mgs_params_fsdb_cleanup(const struct lu_env *env, struct mgs_device *mgs);
+int mgs_find_or_make_fsdb(const struct lu_env *env, struct mgs_device *mgs,
+ char *name, struct fs_db **dbh);
+struct fs_db *mgs_find_fsdb(struct mgs_device *mgs, const char *fsname);
+void mgs_put_fsdb(struct mgs_device *mgs, struct fs_db *fsdb);
+int mgs_get_fsdb_srpc_from_llog(const struct lu_env *env,
+ struct mgs_device *mgs, struct fs_db *fsdb);
+int mgs_check_index(const struct lu_env *env, struct mgs_device *mgs,
+ struct mgs_target_info *mti);
+int mgs_write_log_target(const struct lu_env *env, struct mgs_device *mgs,
+ struct mgs_target_info *mti, struct fs_db *fsdb);
+int mgs_replace_nids(const struct lu_env *env, struct mgs_device *mgs,
+ char *devname, char *nids);
+int mgs_erase_log(const struct lu_env *env, struct mgs_device *mgs,
+ char *name);
+int mgs_erase_logs(const struct lu_env *env, struct mgs_device *mgs,
+ const char *fsname);
+int mgs_setparam(const struct lu_env *env, struct mgs_device *mgs,
+ struct lustre_cfg *lcfg, char *fsname);
+int mgs_list_logs(const struct lu_env *env, struct mgs_device *mgs,
+ struct obd_ioctl_data *data);
+int mgs_pool_cmd(const struct lu_env *env, struct mgs_device *mgs,
+ enum lcfg_command_type cmd, char *poolname, char *fsname,
+ char *ostname);
+int mgs_nodemap_cmd(const struct lu_env *env, struct mgs_device *mgs,
+ enum lcfg_command_type cmd, const char *nodemap_name,
+ char *param);