SUNRPC: Move procfs-specific stuff out of the generic sunrpc cache code
[linux-2.6-block.git] / include / linux / sunrpc / rpc_pipe_fs.h
CommitLineData
1da177e4
LT
1#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 *);
c3810608 18 int (*open_pipe)(struct inode *);
1da177e4
LT
19 void (*destroy_msg)(struct rpc_pipe_msg *);
20};
21
22struct rpc_inode {
23 struct inode vfs_inode;
24 void *private;
25 struct list_head pipe;
26 struct list_head in_upcall;
6e84c7b6 27 struct list_head in_downcall;
1da177e4
LT
28 int pipelen;
29 int nreaders;
30 int nwriters;
03a1256f 31 int nkern_readwriters;
1da177e4
LT
32 wait_queue_head_t waitq;
33#define RPC_PIPE_WAIT_FOR_OPEN 1
34 int flags;
52bad64d 35 struct delayed_work queue_timeout;
b693ba4a 36 const struct rpc_pipe_ops *ops;
1da177e4
LT
37};
38
39static inline struct rpc_inode *
40RPC_I(struct inode *inode)
41{
42 return container_of(inode, struct rpc_inode, vfs_inode);
43}
44
45extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
46
458adb8b 47struct rpc_clnt;
23ac6581 48extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
458adb8b 49extern int rpc_remove_client_dir(struct dentry *);
b693ba4a
TM
50extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *,
51 const struct rpc_pipe_ops *, int flags);
5d67476f 52extern int rpc_unlink(struct dentry *);
54281548
TM
53extern struct vfsmount *rpc_get_mount(void);
54extern void rpc_put_mount(void);
7531d692
TM
55extern int register_rpc_pipefs(void);
56extern void unregister_rpc_pipefs(void);
1da177e4
LT
57
58#endif
59#endif