Whamcloud - gitweb
Branch: b_new_cmd
[fs/lustre-release.git] / lustre / obdfilter / lproc_obdfilter.c
index 0bd3a80..5cd3e6b 100644 (file)
@@ -134,6 +134,67 @@ int lprocfs_filter_wr_readcache(struct file *file, const char *buffer,
         return count;
 }
 
+int lprocfs_filter_rd_capa_stat(char *page, char **start, off_t off, int count,
+                                int *eof, void *data)
+{
+        struct obd_device *obd = data;
+        int rc;
+
+        rc = snprintf(page, count, "%d\n",
+                      obd->u.filter.fo_capa_stat);
+        return rc;
+}
+
+int lprocfs_filter_wr_capa_stat(struct file *file, const char *buffer,
+                                unsigned long count, void *data)
+{
+        struct obd_device *obd = data;
+        int val;
+        int rc;
+
+        rc = lprocfs_write_helper(buffer, count, &val);
+        if (rc)
+                return rc;
+
+        obd->u.filter.fo_capa_stat = val;
+        return count;
+}
+
+static
+int lprocfs_filter_rd_blacklist(char *page, char **start, off_t off, int count,
+                                int *eof, void *data)
+{
+        int rc;
+
+        rc = blacklist_display(page, count);
+        *eof = 1;
+        return rc;
+}
+
+static
+int lprocfs_filter_wr_blacklist(struct file *file, const char *buffer,
+                                unsigned long count, void *data)
+{
+        int add;
+        uid_t uid = -1;
+
+        if (count < 2)
+                return count;
+        if (buffer[0] == '+')
+                add = 1;
+        else if (buffer[0] == '-')
+                add = 0;
+        else
+                return count;
+
+        sscanf(buffer + 1, "%u", &uid);
+        if (add)
+                blacklist_add(uid);
+        else
+                blacklist_del(uid);
+        return count;
+}
+
 static struct lprocfs_vars lprocfs_obd_vars[] = {
         { "uuid",         lprocfs_rd_uuid,          0, 0 },
         { "blocksize",    lprocfs_rd_blksize,       0, 0 },
@@ -153,6 +214,11 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { "readcache_max_filesize",
                           lprocfs_filter_rd_readcache,
                           lprocfs_filter_wr_readcache, 0 },
+        { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 },
+        { "capa",         lprocfs_filter_rd_capa_stat,
+                          lprocfs_filter_wr_capa_stat, 0 },
+        { "blacklist",    lprocfs_filter_rd_blacklist,
+                          lprocfs_filter_wr_blacklist, 0 },
         { 0 }
 };
 
@@ -239,7 +305,7 @@ static int filter_brw_stats_seq_show(struct seq_file *seq, void *v)
 
         /* this sampling races with updates */
 
-        seq_printf(seq, "snapshot_time:         %lu:%lu (secs:usecs)\n",
+        seq_printf(seq, "snapshot_time:         %lu.%lu (secs.usecs)\n",
                    now.tv_sec, now.tv_usec);
 
         seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");