Whamcloud - gitweb
LU-39 ASSERTION(atomic_read(&client_stat->nid_exp_ref_count) == 0)
[fs/lustre-release.git] / lustre / mgs / mgs_internal.h
index 8ae2d68..ae3c424 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -50,7 +50,7 @@
 /* mgs_llog.c */
 int class_dentry_readdir(struct obd_device *obd, struct dentry *dir,
                          struct vfsmount *inmnt,
-                         struct list_head *dentry_list);
+                         cfs_list_t *dentry_list);
 
 #define MGSSELF_NAME    "_mgs"
 
@@ -61,31 +61,35 @@ struct mgs_tgt_srpc_conf {
 };
 
 #define INDEX_MAP_SIZE  8192     /* covers indicies to FFFF */
-#define FSDB_LOG_EMPTY  0x0001  /* missing client log */
-#define FSDB_OLDLOG14   0x0002  /* log starts in old (1.4) style */
+
+#define FSDB_LOG_EMPTY          (0)  /* missing client log */
+#define FSDB_OLDLOG14           (1)  /* log starts in old (1.4) style */
+#define FSDB_REVOKING_LOCK      (2)  /* DLM lock is being revoked */
+#define FSDB_MGS_SELF           (3)  /* for '_mgs', used by sptlrpc */
+#define FSDB_OSCNAME18          (4)  /* old 1.8 style OSC naming */
+#define FSDB_UDESC              (5)  /* sptlrpc user desc, will be obsolete */
 
 
 struct fs_db {
         char              fsdb_name[9];
-        struct list_head  fsdb_list;           /* list of databases */
-        struct semaphore  fsdb_sem;
+        cfs_list_t        fsdb_list;           /* list of databases */
+        cfs_semaphore_t   fsdb_sem;
         void             *fsdb_ost_index_map;  /* bitmap of used indicies */
         void             *fsdb_mdt_index_map;  /* bitmap of used indicies */
+        int               fsdb_mdt_count;
         /* COMPAT_146 these items must be recorded out of the old client log */
-        char             *fsdb_clilov;         /* COMPAT_146 client lov name */
+        char             *fsdb_clilov;       /* COMPAT_146 client lov name */
         char             *fsdb_clilmv;
-        char             *fsdb_mdtlov;         /* COMPAT_146 mds lov name */
+        char             *fsdb_mdtlov;       /* COMPAT_146 mds lov name */
         char             *fsdb_mdtlmv;
-        char             *fsdb_mdc;            /* COMPAT_146 mdc name */
+        char             *fsdb_mdc;          /* COMPAT_146 mdc name */
         /* end COMPAT_146 */
-        __u32             fsdb_flags;
+        unsigned long     fsdb_flags;
         __u32             fsdb_gen;
 
         /* in-memory copy of the srpc rules, guarded by fsdb_sem */
         struct sptlrpc_rule_set   fsdb_srpc_gen;
         struct mgs_tgt_srpc_conf *fsdb_srpc_tgt;
-        unsigned int              fsdb_fl_udesc:1,
-                                  fsdb_fl_mgsself:1;
 };
 
 int mgs_init_fsdb_list(struct obd_device *obd);
@@ -95,8 +99,10 @@ int mgs_find_or_make_fsdb(struct obd_device *obd, char *name,
 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);
-int mgs_upgrade_sv_14(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);
@@ -104,9 +110,12 @@ 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);
 
+/* mgs_handler.c */
+void mgs_revoke_lock(struct obd_device *obd, struct fs_db *fsdb);
+
 /* mgs_fs.c */
-int mgs_client_add(struct obd_device *obd, struct obd_export *exp,
-                   void *localdata);
+int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
+                          void *localdata);
 int mgs_client_free(struct obd_export *exp);
 int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt);
 int mgs_fs_cleanup(struct obd_device *obddev);