summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-27 16:07:56 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-05-07 10:32:18 -0700
commitb7a15f3dbe3f3d009360273b62a633e47a1a65d6 (patch)
treeecc43e8ba8c57ee6f013de1465ea645f71c1093c /fs
parent3f8ab270855b0b461995da5dc48dce9461c85d94 (diff)
downloadlinux-b7a15f3dbe3f3d009360273b62a633e47a1a65d6.tar.gz
linux-b7a15f3dbe3f3d009360273b62a633e47a1a65d6.tar.bz2
linux-b7a15f3dbe3f3d009360273b62a633e47a1a65d6.zip
f2fs: introduce macros for proc entries
This adds macros to be used multiple proc entries. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/super.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 19a85cf83f40..b006de60e99b 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -745,19 +745,22 @@ static int segment_info_seq_show(struct seq_file *seq, void *offset)
return 0;
}
-static int segment_info_open_fs(struct inode *inode, struct file *file)
-{
- return single_open(file, segment_info_seq_show, PDE_DATA(inode));
-}
-
-static const struct file_operations f2fs_seq_segment_info_fops = {
- .owner = THIS_MODULE,
- .open = segment_info_open_fs,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+#define F2FS_PROC_FILE_DEF(_name) \
+static int _name##_open_fs(struct inode *inode, struct file *file) \
+{ \
+ return single_open(file, _name##_seq_show, PDE_DATA(inode)); \
+} \
+ \
+static const struct file_operations f2fs_seq_##_name##_fops = { \
+ .owner = THIS_MODULE, \
+ .open = _name##_open_fs, \
+ .read = seq_read, \
+ .llseek = seq_lseek, \
+ .release = single_release, \
};
+F2FS_PROC_FILE_DEF(segment_info);
+
static void default_options(struct f2fs_sb_info *sbi)
{
/* init some FS parameters */