]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/ext4.h
ext4: Combine proc file handling into a single set of functions
[linux-2.6-omap-h63xx.git] / fs / ext4 / ext4.h
index b9c9371d8164b640faf57a78c15263d695eeb14d..163c44527dde35cba8ee861daf766ca0ca03b823 100644 (file)
@@ -957,6 +957,22 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
 
 extern struct proc_dir_entry *ext4_proc_root;
 
+#ifdef CONFIG_PROC_FS
+extern const struct file_operations ext4_ui_proc_fops;
+
+#define        EXT4_PROC_HANDLER(name, var)                                    \
+do {                                                                   \
+       proc = proc_create_data(name, mode, sbi->s_proc,                \
+                               &ext4_ui_proc_fops, &sbi->s_##var);     \
+       if (proc == NULL) {                                             \
+               printk(KERN_ERR "EXT4-fs: can't create %s\n", name);    \
+               goto err_out;                                           \
+       }                                                               \
+} while (0)
+#else
+#define EXT4_PROC_HANDLER(name, var)
+#endif
+
 /*
  * Function prototypes
  */