[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>
This commit is contained in:
committed by
Linus Torvalds
parent
6625b861f8
commit
907f2c77d1
@ -70,7 +70,7 @@ struct rchan
|
||||
struct relayfs_inode_info
|
||||
{
|
||||
struct inode vfs_inode;
|
||||
struct rchan_buf *buf;
|
||||
void *data;
|
||||
};
|
||||
|
||||
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,
|
||||
extern struct dentry *relayfs_create_dir(const char *name,
|
||||
struct dentry *parent);
|
||||
extern int relayfs_remove_dir(struct dentry *dentry);
|
||||
extern struct dentry *relayfs_create_file(const char *name,
|
||||
struct dentry *parent,
|
||||
int mode,
|
||||
struct file_operations *fops,
|
||||
void *data);
|
||||
|
||||
/**
|
||||
* relay_write - write data into the channel
|
||||
|
Reference in New Issue
Block a user