sysfs, kernfs: move sysfs_open_file to include/linux/kernfs.h
authorTejun Heo <tj@kernel.org>
Thu, 28 Nov 2013 19:54:20 +0000 (14:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Nov 2013 01:35:05 +0000 (17:35 -0800)
sysfs_open_file will be used as the primary handle for kernfs methods.
Move its definition from fs/sysfs/file.c to include/linux/kernfs.h and
mark the public and private fields.

This is pure relocation.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/file.c
include/linux/kernfs.h

index a43df04c81f9fa171ee3a9bf808eb010d5484059..acba5835577e64bfddb64bc693d94658d7d0e10c 100644 (file)
@@ -47,17 +47,6 @@ struct sysfs_open_dirent {
        struct list_head        files; /* goes through sysfs_open_file.list */
 };
 
-struct sysfs_open_file {
-       struct sysfs_dirent     *sd;
-       struct file             *file;
-       struct mutex            mutex;
-       int                     event;
-       struct list_head        list;
-
-       bool                    mmapped;
-       const struct vm_operations_struct *vm_ops;
-};
-
 static bool sysfs_is_bin(struct sysfs_dirent *sd)
 {
        return sysfs_type(sd) == SYSFS_KOBJ_BIN_ATTR;
index e8b73d4a08d211590aaca4f36c13339368ae486f..b923052c29d0c7b419cf31b71846a468b9d109ea 100644 (file)
@@ -9,12 +9,30 @@
 
 #include <linux/kernel.h>
 #include <linux/err.h>
+#include <linux/list.h>
+#include <linux/mutex.h>
 
 struct file;
 struct iattr;
+struct seq_file;
+struct vm_area_struct;
 
 struct sysfs_dirent;
 
+struct sysfs_open_file {
+       /* published fields */
+       struct sysfs_dirent     *sd;
+       struct file             *file;
+
+       /* private fields, do not use outside kernfs proper */
+       struct mutex            mutex;
+       int                     event;
+       struct list_head        list;
+
+       bool                    mmapped;
+       const struct vm_operations_struct *vm_ops;
+};
+
 #ifdef CONFIG_SYSFS
 
 struct sysfs_dirent *kernfs_create_dir_ns(struct sysfs_dirent *parent,