rpc_pipe_fs.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. wait_queue_head_t waitq;
  27. #define RPC_PIPE_WAIT_FOR_OPEN 1
  28. int flags;
  29. struct rpc_pipe_ops *ops;
  30. struct delayed_work queue_timeout;
  31. };
  32. static inline struct rpc_inode *
  33. RPC_I(struct inode *inode)
  34. {
  35. return container_of(inode, struct rpc_inode, vfs_inode);
  36. }
  37. extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
  38. extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
  39. extern int rpc_rmdir(struct dentry *);
  40. extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags);
  41. extern int rpc_unlink(struct dentry *);
  42. extern struct vfsmount *rpc_get_mount(void);
  43. extern void rpc_put_mount(void);
  44. extern int register_rpc_pipefs(void);
  45. extern void unregister_rpc_pipefs(void);
  46. #endif
  47. #endif