Whamcloud - gitweb
- remove non-needed check
[fs/lustre-release.git] / lustre / llite / lproc_llite.c
index 8354c32..6e630a6 100644 (file)
@@ -414,6 +414,31 @@ static int ll_wr_gns_tick(struct file *file, const char *buffer,
         return count;
 }
 
+static int ll_rd_gns_enabled(char *page, char **start, off_t off,
+                             int count, int *eof, void *data)
+{
+        struct super_block *sb = (struct super_block *)data;
+        struct ll_sb_info *sbi = ll_s2sbi(sb);
+        
+        return snprintf(page, count, "%d\n",
+                        atomic_read(&sbi->ll_gns_enabled));
+}
+
+static int ll_wr_gns_enabled(struct file *file, const char *buffer,
+                             unsigned long count, void *data)
+{
+        struct super_block *sb = (struct super_block *)data;
+        struct ll_sb_info *sbi = ll_s2sbi(sb);
+        int val, rc;
+
+        rc = lprocfs_write_helper(buffer, count, &val);
+        if (rc)
+                return rc;
+
+        atomic_set(&sbi->ll_gns_enabled, (val != 0 ? 1 : 0));
+        return count;
+}
+
 static struct lprocfs_vars lprocfs_obd_vars[] = {
         { "uuid",         ll_rd_sb_uuid,          0, 0 },
         //{ "mntpt_path",   ll_rd_path,             0, 0 },
@@ -439,6 +464,9 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { "gns_tick", ll_rd_gns_tick,
           ll_wr_gns_tick, 0 },
         
+        { "gns_enabled", ll_rd_gns_enabled,
+          ll_wr_gns_enabled, 0 },
+        
         { "gns_object_name", ll_rd_gns_object_name,
           ll_wr_gns_object_name, 0 },