rpc_pipe_fs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. void (*destroy_msg)(struct rpc_pipe_msg *);
  16. };
  17. struct rpc_inode {
  18. struct inode vfs_inode;
  19. void *private;
  20. struct list_head pipe;
  21. struct list_head in_upcall;
  22. struct list_head in_downcall;
  23. int pipelen;
  24. int nreaders;
  25. int nwriters;
  26. int nkern_readwriters;
  27. wait_queue_head_t waitq;
  28. #define RPC_PIPE_WAIT_FOR_OPEN 1
  29. int flags;
  30. struct rpc_pipe_ops *ops;
  31. struct delayed_work queue_timeout;
  32. };
  33. static inline struct rpc_inode *
  34. RPC_I(struct inode *inode)
  35. {
  36. return container_of(inode, struct rpc_inode, vfs_inode);
  37. }
  38. extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
  39. extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
  40. extern int rpc_rmdir(struct dentry *);
  41. extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags);
  42. extern int rpc_unlink(struct dentry *);
  43. extern struct vfsmount *rpc_get_mount(void);
  44. extern void rpc_put_mount(void);
  45. extern int register_rpc_pipefs(void);
  46. extern void unregister_rpc_pipefs(void);
  47. #endif
  48. #endif