Whamcloud - gitweb
LU-8900 mgs: use reference count for fs_db
[fs/lustre-release.git] / lustre / mgs / mgs_internal.h
index 1e81522..7564cfd 100644 (file)
@@ -122,6 +122,7 @@ struct fs_db {
        struct mutex      fsdb_mutex;
        void             *fsdb_ost_index_map;   /* bitmap of used indicies */
        void             *fsdb_mdt_index_map;   /* bitmap of used indicies */
+       atomic_t          fsdb_ref;
        int               fsdb_mdt_count;
        char             *fsdb_clilov;  /* COMPAT_146 client lov name */
        char             *fsdb_clilmv;
@@ -185,14 +186,13 @@ struct mgs_object {
 
 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,
-                       struct fs_db *fsdb);
-int mgs_params_fsdb_setup(const struct lu_env *env, struct mgs_device *mgs,
-                         struct fs_db *fsdb);
+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, char *fsname);
+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,
@@ -204,7 +204,7 @@ int mgs_replace_nids(const struct lu_env *env, struct mgs_device *mgs,
 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,
-                  char *fsname);
+                  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,