2005-04-17 00:20:36 +02:00
|
|
|
#ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
|
|
|
|
#define _LINUX_SUNRPC_RPC_PIPE_FS_H
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
2009-08-20 23:08:39 +02:00
|
|
|
#include <linux/workqueue.h>
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
struct rpc_pipe_msg {
|
|
|
|
struct list_head list;
|
|
|
|
void *data;
|
|
|
|
size_t len;
|
|
|
|
size_t copied;
|
|
|
|
int errno;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rpc_pipe_ops {
|
|
|
|
ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t);
|
|
|
|
ssize_t (*downcall)(struct file *, const char __user *, size_t);
|
|
|
|
void (*release_pipe)(struct inode *);
|
2008-12-23 22:08:32 +01:00
|
|
|
int (*open_pipe)(struct inode *);
|
2005-04-17 00:20:36 +02:00
|
|
|
void (*destroy_msg)(struct rpc_pipe_msg *);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rpc_inode {
|
|
|
|
struct inode vfs_inode;
|
|
|
|
void *private;
|
|
|
|
struct list_head pipe;
|
|
|
|
struct list_head in_upcall;
|
2007-06-07 21:31:36 +02:00
|
|
|
struct list_head in_downcall;
|
2005-04-17 00:20:36 +02:00
|
|
|
int pipelen;
|
|
|
|
int nreaders;
|
|
|
|
int nwriters;
|
2007-06-08 20:14:53 +02:00
|
|
|
int nkern_readwriters;
|
2005-04-17 00:20:36 +02:00
|
|
|
wait_queue_head_t waitq;
|
|
|
|
#define RPC_PIPE_WAIT_FOR_OPEN 1
|
|
|
|
int flags;
|
2006-11-22 15:54:01 +01:00
|
|
|
struct delayed_work queue_timeout;
|
2009-08-09 21:14:15 +02:00
|
|
|
const struct rpc_pipe_ops *ops;
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct rpc_inode *
|
|
|
|
RPC_I(struct inode *inode)
|
|
|
|
{
|
|
|
|
return container_of(inode, struct rpc_inode, vfs_inode);
|
|
|
|
}
|
|
|
|
|
2011-09-23 03:50:10 +02:00
|
|
|
extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
|
|
|
|
char __user *, size_t);
|
2005-04-17 00:20:36 +02:00
|
|
|
extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
|
|
|
|
|
2009-08-09 21:14:22 +02:00
|
|
|
struct rpc_clnt;
|
2009-08-09 21:14:25 +02:00
|
|
|
extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
|
2009-08-09 21:14:22 +02:00
|
|
|
extern int rpc_remove_client_dir(struct dentry *);
|
2009-08-09 21:14:30 +02:00
|
|
|
|
|
|
|
struct cache_detail;
|
|
|
|
extern struct dentry *rpc_create_cache_dir(struct dentry *,
|
|
|
|
struct qstr *,
|
2011-07-25 06:35:13 +02:00
|
|
|
umode_t umode,
|
2009-08-09 21:14:30 +02:00
|
|
|
struct cache_detail *);
|
|
|
|
extern void rpc_remove_cache_dir(struct dentry *);
|
|
|
|
|
2009-08-09 21:14:15 +02:00
|
|
|
extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *,
|
|
|
|
const struct rpc_pipe_ops *, int flags);
|
2006-07-31 23:11:48 +02:00
|
|
|
extern int rpc_unlink(struct dentry *);
|
2006-03-20 19:44:49 +01:00
|
|
|
extern struct vfsmount *rpc_get_mount(void);
|
|
|
|
extern void rpc_put_mount(void);
|
2007-05-14 23:21:26 +02:00
|
|
|
extern int register_rpc_pipefs(void);
|
|
|
|
extern void unregister_rpc_pipefs(void);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|