libceph: simplify our debugfs attr macro
authorIlya Dryomov <idryomov@gmail.com>
Wed, 25 Mar 2015 18:15:17 +0000 (21:15 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Apr 2015 15:55:39 +0000 (18:55 +0300)
No need to do single_open()'s job ourselves.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
include/linux/ceph/debugfs.h

index 1df086d7882d9a3c5eeaf132835d01161fcd4b8b..29cf897cc5cd3cafe2ed69a415fb0713d90704b2 100644 (file)
@@ -7,13 +7,7 @@
 #define CEPH_DEFINE_SHOW_FUNC(name)                                    \
 static int name##_open(struct inode *inode, struct file *file)         \
 {                                                                      \
-       struct seq_file *sf;                                            \
-       int ret;                                                        \
-                                                                       \
-       ret = single_open(file, name, NULL);                            \
-       sf = file->private_data;                                        \
-       sf->private = inode->i_private;                                 \
-       return ret;                                                     \
+       return single_open(file, name, inode->i_private);               \
 }                                                                      \
                                                                        \
 static const struct file_operations name##_fops = {                    \