rpc_pipe_fs.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
  2. #define _LINUX_SUNRPC_RPC_PIPE_FS_H
  3. #ifdef __KERNEL__
  4. struct rpc_pipe_msg {
  5. struct list_head list;
  6. void *data;
  7. size_t len;
  8. size_t copied;
  9. int errno;
  10. };
  11. struct rpc_pipe_ops {
  12. ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t);
  13. ssize_t (*downcall)(struct file *, const char __user *, size_t);
  14. void (*release_pipe)(struct inode *);
  15. int (*open_pipe)(struct inode *);
  16. void (*destroy_msg)(struct rpc_pipe_msg *);
  17. };
  18. struct rpc_inode {
  19. struct inode vfs_inode;
  20. void *private;
  21. struct list_head pipe;
  22. struct list_head in_upcall;
  23. struct list_head in_downcall;
  24. int pipelen;
  25. int nreaders;
  26. int nwriters;
  27. int nkern_readwriters;
  28. wait_queue_head_t waitq;
  29. #define RPC_PIPE_WAIT_FOR_OPEN 1
  30. int flags;
  31. struct delayed_work queue_timeout;
  32. const struct rpc_pipe_ops *ops;
  33. };
  34. static inline struct rpc_inode *
  35. RPC_I(struct inode *inode)
  36. {
  37. return container_of(inode, struct rpc_inode, vfs_inode);
  38. }
  39. extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
  40. struct rpc_clnt;
  41. extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
  42. extern int rpc_remove_client_dir(struct dentry *);
  43. struct cache_detail;
  44. extern struct dentry *rpc_create_cache_dir(struct dentry *,
  45. struct qstr *,
  46. mode_t umode,
  47. struct cache_detail *);
  48. extern void rpc_remove_cache_dir(struct dentry *);
  49. extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *,
  50. const struct rpc_pipe_ops *, int flags);
  51. extern int rpc_unlink(struct dentry *);
  52. extern struct vfsmount *rpc_get_mount(void);
  53. extern void rpc_put_mount(void);
  54. extern int register_rpc_pipefs(void);
  55. extern void unregister_rpc_pipefs(void);
  56. #endif
  57. #endif