Whamcloud - gitweb
LU-2640 osd: conditional enable transaction debug
[fs/lustre-release.git] / lustre / mdd / mdd_lproc.c
index 4d8e42d..4d64e43 100644 (file)
@@ -303,6 +303,25 @@ static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer,
        return rc != 0 ? rc : count;
 }
 
+static int lprocfs_rd_lfsck_namespace(char *page, char **start, off_t off,
+                                     int count, int *eof, void *data)
+{
+       struct lu_env env;
+       struct mdd_device *mdd = data;
+       int rc;
+
+       LASSERT(mdd != NULL);
+       *eof = 1;
+
+       rc = lu_env_init(&env, LCT_MD_THREAD | LCT_DT_THREAD);
+       if (rc != 0)
+               return rc;
+
+       rc = mdd_lfsck_dump(&env, &mdd->mdd_lfsck, LT_NAMESPACE, page, count);
+       lu_env_fini(&env);
+       return rc;
+}
+
 static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
         { "atime_diff",      lprocfs_rd_atime_diff, lprocfs_wr_atime_diff, 0 },
         { "changelog_mask",  lprocfs_rd_changelog_mask,
@@ -311,6 +330,7 @@ static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
         { "sync_permission", lprocfs_rd_sync_perm, lprocfs_wr_sync_perm, 0 },
        { "lfsck_speed_limit", lprocfs_rd_lfsck_speed_limit,
                               lprocfs_wr_lfsck_speed_limit, 0 },
+       { "lfsck_namespace", lprocfs_rd_lfsck_namespace, 0, 0 },
        { 0 }
 };