Whamcloud - gitweb
Remove global atomic counter for MDS opens, it just slows things down.
[fs/lustre-release.git] / lustre / mds / lproc_mds.c
index 52225be..b7f519e 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/obd.h>
 #include <linux/obd_class.h>
 #include <linux/lprocfs_status.h>
+#include "mds_internal.h"
 
 #ifndef LPROCFS
 struct lprocfs_vars lprocfs_mds_obd_vars[]  = { {0} };
@@ -49,17 +50,6 @@ static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
         return snprintf(page, count, "%s\n",obd->u.mds.mds_vfsmnt->mnt_devname);
 }
 
-static int lprocfs_mds_rd_filesopen(char *page, char **start, off_t off,
-                                    int count, int *eof, void *data)
-{
-        struct obd_device *obd = data;
-        LASSERT(obd != NULL);
-        *eof = 1;
-
-        return snprintf(page, count, "%d\n",
-                        atomic_read(&obd->u.mds.mds_open_count));
-}
-
 static int lprocfs_mds_rd_recovery_status(char *page, char **start, off_t off,
                                           int count, int *eof, void *data)
 {
@@ -153,6 +143,15 @@ static int lprocfs_mds_wr_evict_client(struct file *file, const char *buffer,
         return count;
 }
 
+static int lprocfs_mds_wr_config_update(struct file *file, const char *buffer,
+                                        unsigned long count, void *data)
+{
+        struct obd_device *obd = data;
+        ENTRY;
+
+        RETURN(mds_lov_update_config(obd, 0));
+}
+
 struct lprocfs_vars lprocfs_mds_obd_vars[] = {
         { "uuid",         lprocfs_rd_uuid,        0, 0 },
         { "blocksize",    lprocfs_rd_blksize,     0, 0 },
@@ -162,10 +161,10 @@ struct lprocfs_vars lprocfs_mds_obd_vars[] = {
         { "fstype",       lprocfs_rd_fstype,      0, 0 },
         { "filestotal",   lprocfs_rd_filestotal,  0, 0 },
         { "filesfree",    lprocfs_rd_filesfree,   0, 0 },
-        { "filesopen",    lprocfs_mds_rd_filesopen,   0, 0 },
         { "mntdev",       lprocfs_mds_rd_mntdev,  0, 0 },
         { "recovery_status", lprocfs_mds_rd_recovery_status, 0, 0 },
         { "evict_client", 0, lprocfs_mds_wr_evict_client, 0 },
+        { "config_update", 0, lprocfs_mds_wr_config_update, 0 },
         { "num_exports",  lprocfs_rd_num_exports, 0, 0 },
         { 0 }
 };
@@ -186,5 +185,12 @@ struct lprocfs_vars lprocfs_mdt_module_vars[] = {
 };
 
 #endif
-LPROCFS_INIT_VARS(mds, lprocfs_mds_module_vars, lprocfs_mds_obd_vars);
-LPROCFS_INIT_VARS(mdt, lprocfs_mdt_module_vars, lprocfs_mdt_obd_vars);
+
+struct lprocfs_static_vars lprocfs_array_vars[] = { {lprocfs_mds_module_vars,
+                                                     lprocfs_mds_obd_vars},
+                                                    {lprocfs_mdt_module_vars,
+                                                     lprocfs_mdt_obd_vars}};
+
+LPROCFS_INIT_MULTI_VARS(lprocfs_array_vars,
+                        (sizeof(lprocfs_array_vars) /
+                         sizeof(struct lprocfs_static_vars)))