Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H |
| 2 | #define _LINUX_SUNRPC_RPC_PIPE_FS_H |
| 3 | |
| 4 | #ifdef __KERNEL__ |
| 5 | |
| 6 | struct rpc_pipe_msg { |
| 7 | struct list_head list; |
| 8 | void *data; |
| 9 | size_t len; |
| 10 | size_t copied; |
| 11 | int errno; |
| 12 | }; |
| 13 | |
| 14 | struct rpc_pipe_ops { |
| 15 | ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t); |
| 16 | ssize_t (*downcall)(struct file *, const char __user *, size_t); |
| 17 | void (*release_pipe)(struct inode *); |
| 18 | void (*destroy_msg)(struct rpc_pipe_msg *); |
| 19 | }; |
| 20 | |
| 21 | struct rpc_inode { |
| 22 | struct inode vfs_inode; |
| 23 | void *private; |
| 24 | struct list_head pipe; |
| 25 | struct list_head in_upcall; |
Trond Myklebust | 6e84c7b | 2007-06-07 15:31:36 -0400 | [diff] [blame] | 26 | struct list_head in_downcall; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | int pipelen; |
| 28 | int nreaders; |
| 29 | int nwriters; |
Trond Myklebust | 03a1256 | 2007-06-08 14:14:53 -0400 | [diff] [blame] | 30 | int nkern_readwriters; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | wait_queue_head_t waitq; |
| 32 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
| 33 | int flags; |
| 34 | struct rpc_pipe_ops *ops; |
David Howells | 52bad64 | 2006-11-22 14:54:01 +0000 | [diff] [blame] | 35 | struct delayed_work queue_timeout; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | static inline struct rpc_inode * |
| 39 | RPC_I(struct inode *inode) |
| 40 | { |
| 41 | return container_of(inode, struct rpc_inode, vfs_inode); |
| 42 | } |
| 43 | |
| 44 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); |
| 45 | |
| 46 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); |
Trond Myklebust | dff02cc | 2006-07-31 14:17:18 -0700 | [diff] [blame] | 47 | extern int rpc_rmdir(struct dentry *); |
Trond Myklebust | 158998b | 2006-08-24 01:03:17 -0400 | [diff] [blame] | 48 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags); |
Trond Myklebust | 5d67476 | 2006-07-31 14:11:48 -0700 | [diff] [blame] | 49 | extern int rpc_unlink(struct dentry *); |
Trond Myklebust | 5428154 | 2006-03-20 13:44:49 -0500 | [diff] [blame] | 50 | extern struct vfsmount *rpc_get_mount(void); |
| 51 | extern void rpc_put_mount(void); |
Trond Myklebust | 7531d69 | 2007-05-14 17:21:26 -0400 | [diff] [blame] | 52 | extern int register_rpc_pipefs(void); |
| 53 | extern void unregister_rpc_pipefs(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
| 55 | #endif |
| 56 | #endif |