lkml.org 
[lkml]   [2013]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/39] sysfs, kernfs: move sysfs_open_file to include/linux/kernfs.h
Date
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>
---
fs/sysfs/file.c | 11 -----------
include/linux/kernfs.h | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 7f0b38b..beaac92 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -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;
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 345773f..f140d9a 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -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,
--
1.8.3.1


\
 
 \ /
  Last update: 2013-11-03 11:21    [W:0.122 / U:2.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site