Whamcloud - gitweb
b=20591 fix race on obd_device::md_stats
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index 25e4b98..cad6c92 100644 (file)
@@ -150,6 +150,7 @@ struct lprocfs_counter {
         unsigned int           lc_config;
         __s64                  lc_count;
         __s64                  lc_sum;
+        __s64                  lc_sum_irq;
         __s64                  lc_min;
         __s64                  lc_max;
         __s64                  lc_sumsquare;
@@ -423,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,
@@ -578,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)
@@ -593,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 {           \
@@ -697,25 +713,6 @@ extern int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
 extern int lprocfs_quota_wr_qs_factor(struct file *file, const char *buffer,
                                       unsigned long count, void *data);
 
-/** struct for holding changelog data for seq_file processing */
-struct changelog_seq_iter {
-        void *csi_dev;
-        struct llog_ctxt *csi_ctxt;
-        struct llog_handle *csi_llh;
-        __u64 csi_startrec;
-        __u64 csi_endrec;
-        loff_t csi_pos;
-        int csi_wrote;
-        int csi_startcat;
-        int csi_startidx;
-        int csi_fill:1;
-        int csi_done:1;
-};
-int changelog_seq_open(struct inode *inode, struct file *file,
-                       struct changelog_seq_iter **csih);
-int changelog_seq_release(struct inode *inode, struct file *file);
-loff_t changelog_seq_lseek(struct file *file, loff_t offset, int origin);
-
 
 
 #else
@@ -762,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)