diff options
author | Tom Zanussi <zanussi@us.ibm.com> | 2006-01-08 04:02:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:13:49 -0500 |
commit | 907f2c77d1653ce235e8e1fd6ce5c46005814e78 (patch) | |
tree | dddb1fb14c4be54b066585235c97a36460e8faff /include/linux | |
parent | 6625b861f8f0e429902b8671b3e70792cd99074e (diff) |
[PATCH] relayfs: export relayfs_create_file() with fileops param
This patch adds a mandatory fileops param to relayfs_create_file() and exports
that function so that clients can use it to create files defined by their own
set of file operations, in relayfs. The purpose is to allow relayfs
applications to create their own set of 'control' files alongside their relay
files in relayfs rather than having to create them in /proc or debugfs for
instance. relayfs_create_file() is also used by relay_open_buf() to create
the relay files for a channel. In this case, a pointer to
relayfs_file_operations is passed in, along with a pointer to the buffer
associated with the file.
Signed-off-by: Tom Zanussi <zanussi@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/relayfs_fs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h index fb7e80737325..a122df2d9880 100644 --- a/include/linux/relayfs_fs.h +++ b/include/linux/relayfs_fs.h | |||
@@ -70,7 +70,7 @@ struct rchan | |||
70 | struct relayfs_inode_info | 70 | struct relayfs_inode_info |
71 | { | 71 | { |
72 | struct inode vfs_inode; | 72 | struct inode vfs_inode; |
73 | struct rchan_buf *buf; | 73 | void *data; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode) | 76 | static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode) |
@@ -148,6 +148,11 @@ extern size_t relay_switch_subbuf(struct rchan_buf *buf, | |||
148 | extern struct dentry *relayfs_create_dir(const char *name, | 148 | extern struct dentry *relayfs_create_dir(const char *name, |
149 | struct dentry *parent); | 149 | struct dentry *parent); |
150 | extern int relayfs_remove_dir(struct dentry *dentry); | 150 | extern int relayfs_remove_dir(struct dentry *dentry); |
151 | extern struct dentry *relayfs_create_file(const char *name, | ||
152 | struct dentry *parent, | ||
153 | int mode, | ||
154 | struct file_operations *fops, | ||
155 | void *data); | ||
151 | 156 | ||
152 | /** | 157 | /** |
153 | * relay_write - write data into the channel | 158 | * relay_write - write data into the channel |