blob: a2eb9b4a9de32ef2f5ef2b7605b88ace1dfc316e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
2#define _LINUX_SUNRPC_RPC_PIPE_FS_H
3
4#ifdef __KERNEL__
5
6struct rpc_pipe_msg {
7 struct list_head list;
8 void *data;
9 size_t len;
10 size_t copied;
11 int errno;
12};
13
14struct 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
21struct rpc_inode {
22 struct inode vfs_inode;
23 void *private;
24 struct list_head pipe;
25 struct list_head in_upcall;
26 int pipelen;
27 int nreaders;
28 int nwriters;
29 wait_queue_head_t waitq;
30#define RPC_PIPE_WAIT_FOR_OPEN 1
31 int flags;
32 struct rpc_pipe_ops *ops;
33 struct work_struct queue_timeout;
34};
35
36static inline struct rpc_inode *
37RPC_I(struct inode *inode)
38{
39 return container_of(inode, struct rpc_inode, vfs_inode);
40}
41
42extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
43
44extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
Trond Myklebustdff02cc2006-07-31 14:17:18 -070045extern int rpc_rmdir(struct dentry *);
Trond Myklebust158998b2006-08-24 01:03:17 -040046extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags);
Trond Myklebust5d674762006-07-31 14:11:48 -070047extern int rpc_unlink(struct dentry *);
Trond Myklebust54281542006-03-20 13:44:49 -050048extern struct vfsmount *rpc_get_mount(void);
49extern void rpc_put_mount(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51#endif
52#endif