diff options
author | Tom Zanussi <zanussi@us.ibm.com> | 2006-01-08 04:02:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:13:50 -0500 |
commit | 08c541a7ade230883c48225f4ea406a0117e7c2f (patch) | |
tree | 23288deb876a8bdd07569d1eb8eacd38585c2932 /include/linux/relayfs_fs.h | |
parent | 925ac8a2b637466ba0ad8dfaf7b49aa9a362502f (diff) |
[PATCH] relayfs: add support for relay files in other filesystems
This patch adds a couple of callback functions that allow a client to hook
into relay_open()/close() and supply the files that will be used to represent
the channel buffers; the default implementation if no callbacks are defined is
to create the files in relayfs. This is to support the creation and use of
relay files in other filesystems such as debugfs, as implied by the fact that
relayfs_file_operations are exported.
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/relayfs_fs.h')
-rw-r--r-- | include/linux/relayfs_fs.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h index 8200ecbe6e0f..8c2177105857 100644 --- a/include/linux/relayfs_fs.h +++ b/include/linux/relayfs_fs.h | |||
@@ -110,6 +110,40 @@ struct rchan_callbacks | |||
110 | */ | 110 | */ |
111 | void (*buf_unmapped)(struct rchan_buf *buf, | 111 | void (*buf_unmapped)(struct rchan_buf *buf, |
112 | struct file *filp); | 112 | struct file *filp); |
113 | /* | ||
114 | * create_buf_file - create file to represent a relayfs channel buffer | ||
115 | * @filename: the name of the file to create | ||
116 | * @parent: the parent of the file to create | ||
117 | * @mode: the mode of the file to create | ||
118 | * @buf: the channel buffer | ||
119 | * | ||
120 | * Called during relay_open(), once for each per-cpu buffer, | ||
121 | * to allow the client to create a file to be used to | ||
122 | * represent the corresponding channel buffer. If the file is | ||
123 | * created outside of relayfs, the parent must also exist in | ||
124 | * that filesystem. | ||
125 | * | ||
126 | * The callback should return the dentry of the file created | ||
127 | * to represent the relay buffer. | ||
128 | * | ||
129 | * See Documentation/filesystems/relayfs.txt for more info. | ||
130 | */ | ||
131 | struct dentry *(*create_buf_file)(const char *filename, | ||
132 | struct dentry *parent, | ||
133 | int mode, | ||
134 | struct rchan_buf *buf); | ||
135 | |||
136 | /* | ||
137 | * remove_buf_file - remove file representing a relayfs channel buffer | ||
138 | * @dentry: the dentry of the file to remove | ||
139 | * | ||
140 | * Called during relay_close(), once for each per-cpu buffer, | ||
141 | * to allow the client to remove a file used to represent a | ||
142 | * channel buffer. | ||
143 | * | ||
144 | * The callback should return 0 if successful, negative if not. | ||
145 | */ | ||
146 | int (*remove_buf_file)(struct dentry *dentry); | ||
113 | }; | 147 | }; |
114 | 148 | ||
115 | /* | 149 | /* |