Commit b7a15f3d authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: introduce macros for proc entries

This adds macros to be used multiple proc entries.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3f8ab270
...@@ -745,19 +745,22 @@ static int segment_info_seq_show(struct seq_file *seq, void *offset) ...@@ -745,19 +745,22 @@ static int segment_info_seq_show(struct seq_file *seq, void *offset)
return 0; return 0;
} }
static int segment_info_open_fs(struct inode *inode, struct file *file) #define F2FS_PROC_FILE_DEF(_name) \
{ static int _name##_open_fs(struct inode *inode, struct file *file) \
return single_open(file, segment_info_seq_show, PDE_DATA(inode)); { \
} return single_open(file, _name##_seq_show, PDE_DATA(inode)); \
} \
static const struct file_operations f2fs_seq_segment_info_fops = { \
.owner = THIS_MODULE, static const struct file_operations f2fs_seq_##_name##_fops = { \
.open = segment_info_open_fs, .owner = THIS_MODULE, \
.read = seq_read, .open = _name##_open_fs, \
.llseek = seq_lseek, .read = seq_read, \
.release = single_release, .llseek = seq_lseek, \
.release = single_release, \
}; };
F2FS_PROC_FILE_DEF(segment_info);
static void default_options(struct f2fs_sb_info *sbi) static void default_options(struct f2fs_sb_info *sbi)
{ {
/* init some FS parameters */ /* init some FS parameters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment