Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index 084e6d1..4ff1b1e 100644 (file)
@@ -149,7 +149,9 @@ struct mdt_device {
                                    mo_mds_capa   :1,
                                    mo_oss_capa   :1;
         } mdt_opts;
-
+        /* mdt state flags */
+        __u32                      mdt_fl_cfglog:1,
+                                   mdt_fl_synced:1;
         /* lock to pretect epoch and write count */
         spinlock_t                 mdt_ioepoch_lock;
         __u64                      mdt_ioepoch;
@@ -659,12 +661,11 @@ extern struct lu_context_key       mdt_thread_key;
 static inline void mdt_fail_write(const struct lu_env *env,
                                   struct dt_device *dd, int id)
 {
-        if (OBD_FAIL_CHECK(id)) {
+        if (OBD_FAIL_CHECK_ORSET(id, OBD_FAIL_ONCE)) {
                 CERROR(LUSTRE_MDT_NAME": obd_fail_loc=%x, fail write ops\n",
                        id);
                 dd->dd_ops->dt_ro(env, dd);
                 /* We set FAIL_ONCE because we never "un-fail" a device */
-                obd_fail_loc |= OBD_FAILED | OBD_FAIL_ONCE;
         }
 }
 
@@ -693,32 +694,6 @@ static inline int mdt_check_resent(struct mdt_thread_info *info,
         RETURN(0);
 }
 
-#define MDT_FAIL_CHECK(id)                                              \
-({                                                                      \
-        if (unlikely(OBD_FAIL_CHECK(id)))                               \
-                CERROR(LUSTRE_MDT_NAME": " #id " test failed\n");      \
-        OBD_FAIL_CHECK(id);                                             \
-})
-
-#define MDT_FAIL_CHECK_ONCE(id)                                              \
-({      int _ret_ = 0;                                                       \
-        if (unlikely(OBD_FAIL_CHECK(id))) {                                  \
-                CERROR(LUSTRE_MDT_NAME": *** obd_fail_loc=%x ***\n", id);    \
-                obd_fail_loc |= OBD_FAILED;                                  \
-                if ((id) & OBD_FAIL_ONCE)                                    \
-                        obd_fail_loc |= OBD_FAIL_ONCE;                       \
-                _ret_ = 1;                                                   \
-        }                                                                    \
-        _ret_;                                                               \
-})
-
-#define MDT_FAIL_RETURN(id, ret)                                             \
-do {                                                                         \
-        if (unlikely(MDT_FAIL_CHECK_ONCE(id))) {                             \
-                RETURN(ret);                                                 \
-        }                                                                    \
-} while(0)
-
 struct md_ucred *mdt_ucred(const struct mdt_thread_info *info);
 
 static inline int is_identity_get_disabled(struct upcall_cache *cache)
@@ -796,6 +771,7 @@ static inline struct lu_name *mdt_name_copy(struct lu_name *tlname,
 }
 
 /* lprocfs stuff */
+void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars);
 int mdt_procfs_init(struct mdt_device *mdt, const char *name);
 int mdt_procfs_fini(struct mdt_device *mdt);