linux/include/linux/sunrpc/rpc_pipe_fs.h
<<
>>
Prefs
   1#ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
   2#define _LINUX_SUNRPC_RPC_PIPE_FS_H
   3
   4#ifdef __KERNEL__
   5
   6#include <linux/workqueue.h>
   7
   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 *);
  20        int (*open_pipe)(struct inode *);
  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;
  29        struct list_head in_downcall;
  30        int pipelen;
  31        int nreaders;
  32        int nwriters;
  33        int nkern_readwriters;
  34        wait_queue_head_t waitq;
  35#define RPC_PIPE_WAIT_FOR_OPEN  1
  36        int flags;
  37        struct delayed_work queue_timeout;
  38        const struct rpc_pipe_ops *ops;
  39};
  40
  41static inline struct rpc_inode *
  42RPC_I(struct inode *inode)
  43{
  44        return container_of(inode, struct rpc_inode, vfs_inode);
  45}
  46
  47extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
  48                                       char __user *, size_t);
  49extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
  50
  51struct rpc_clnt;
  52extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
  53extern int rpc_remove_client_dir(struct dentry *);
  54
  55struct cache_detail;
  56extern struct dentry *rpc_create_cache_dir(struct dentry *,
  57                                           struct qstr *,
  58                                           mode_t umode,
  59                                           struct cache_detail *);
  60extern void rpc_remove_cache_dir(struct dentry *);
  61
  62extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *,
  63                                 const struct rpc_pipe_ops *, int flags);
  64extern int rpc_unlink(struct dentry *);
  65extern struct vfsmount *rpc_get_mount(void);
  66extern void rpc_put_mount(void);
  67extern int register_rpc_pipefs(void);
  68extern void unregister_rpc_pipefs(void);
  69
  70#endif
  71#endif
  72