Whamcloud - gitweb
b=20591 fix race on obd_device::md_stats
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index 46b7059..cad6c92 100644 (file)
@@ -424,6 +424,7 @@ extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
                                  unsigned conf, const char *name,
                                  const char *units);
 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
+extern void lprocfs_free_md_stats(struct obd_device *obddev);
 struct obd_export;
 struct nid_stat;
 extern int lprocfs_add_clear_entry(struct obd_device * obd,
@@ -579,14 +580,27 @@ extern struct rw_semaphore _lprocfs_lock;
 #define LPROCFS_EXIT()            do {  \
         up_read(&_lprocfs_lock);        \
 } while(0)
-#define LPROCFS_ENTRY_AND_CHECK(dp) do {        \
-        typecheck(struct proc_dir_entry *, dp); \
-        LPROCFS_ENTRY();                        \
-        if ((dp)->deleted) {                    \
-                LPROCFS_EXIT();                 \
-                return -ENODEV;                 \
-        }                                       \
-} while(0)
+
+#ifdef HAVE_PROCFS_DELETED
+static inline
+int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
+{
+        LPROCFS_ENTRY();
+        if ((dp)->deleted) {
+                LPROCFS_EXIT();
+                return -ENODEV;
+        }
+        return 0;
+}
+#else
+static inline
+int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
+{
+        LPROCFS_ENTRY();
+        return 0;
+}
+#endif
+
 #define LPROCFS_WRITE_ENTRY()     do {  \
         down_write(&_lprocfs_lock);     \
 } while(0)
@@ -594,6 +608,7 @@ extern struct rw_semaphore _lprocfs_lock;
         up_write(&_lprocfs_lock);       \
 } while(0)
 
+
 /* You must use these macros when you want to refer to
  * the import in a client obd_device for a lprocfs entry */
 #define LPROCFS_CLIMP_CHECK(obd) do {           \
@@ -744,6 +759,8 @@ static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
 { return 0; }
 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
 { return; }
+static inline void lprocfs_free_md_stats(struct obd_device *obddev)
+{ return; }
 
 struct obd_export;
 static inline int lprocfs_add_clear_entry(struct obd_export *exp)