rpc_pipe_fs.h 1.2 KB

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