SUNRPC: pipefs per-net operations helper introduced
[deliverable/linux.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
4dceef96
BF
6#include <linux/workqueue.h>
7
1da177e4
LT
8struct rpc_pipe_msg {
9 struct list_head list;
10 void *data;
11 size_t len;
12 size_t copied;
13 int errno;
14};
15
16struct rpc_pipe_ops {
17 ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t);
18 ssize_t (*downcall)(struct file *, const char __user *, size_t);
19 void (*release_pipe)(struct inode *);
c3810608 20 int (*open_pipe)(struct inode *);
1da177e4
LT
21 void (*destroy_msg)(struct rpc_pipe_msg *);
22};
23
24struct rpc_inode {
25 struct inode vfs_inode;
26 void *private;
27 struct list_head pipe;
28 struct list_head in_upcall;
6e84c7b6 29 struct list_head in_downcall;
1da177e4
LT
30 int pipelen;
31 int nreaders;
32 int nwriters;
33 wait_queue_head_t waitq;
34#define RPC_PIPE_WAIT_FOR_OPEN 1
35 int flags;
52bad64d 36 struct delayed_work queue_timeout;
b693ba4a 37 const struct rpc_pipe_ops *ops;
1da177e4
LT
38};
39
40static inline struct rpc_inode *
41RPC_I(struct inode *inode)
42{
43 return container_of(inode, struct rpc_inode, vfs_inode);
44}
45
2d00131a
SK
46extern int rpc_pipefs_notifier_register(struct notifier_block *);
47extern void rpc_pipefs_notifier_unregister(struct notifier_block *);
48
49enum {
50 RPC_PIPEFS_MOUNT,
51 RPC_PIPEFS_UMOUNT,
52};
53
432eb1a5
SK
54extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb,
55 const unsigned char *dir_name);
c21a588f
SK
56extern void rpc_pipefs_init_net(struct net *net);
57extern struct super_block *rpc_get_sb_net(const struct net *net);
58extern void rpc_put_sb_net(const struct net *net);
432eb1a5 59
c1225158
PT
60extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
61 char __user *, size_t);
1da177e4
LT
62extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
63
458adb8b 64struct rpc_clnt;
23ac6581 65extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
458adb8b 66extern int rpc_remove_client_dir(struct dentry *);
8854e82d
TM
67
68struct cache_detail;
69extern struct dentry *rpc_create_cache_dir(struct dentry *,
70 struct qstr *,
64f1426f 71 umode_t umode,
8854e82d
TM
72 struct cache_detail *);
73extern void rpc_remove_cache_dir(struct dentry *);
74
b693ba4a
TM
75extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *,
76 const struct rpc_pipe_ops *, int flags);
5d67476f 77extern int rpc_unlink(struct dentry *);
54281548
TM
78extern struct vfsmount *rpc_get_mount(void);
79extern void rpc_put_mount(void);
7531d692
TM
80extern int register_rpc_pipefs(void);
81extern void unregister_rpc_pipefs(void);
1da177e4
LT
82
83#endif
84#endif
This page took 1.083955 seconds and 5 git commands to generate.