coda_psdev.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef __CODA_PSDEV_H
  2. #define __CODA_PSDEV_H
  3. #include <linux/magic.h>
  4. #define CODA_PSDEV_MAJOR 67
  5. #define MAX_CODADEVS 5 /* how many do we allow */
  6. #ifdef __KERNEL__
  7. struct kstatfs;
  8. /* communication pending/processing queues */
  9. struct venus_comm {
  10. u_long vc_seq;
  11. wait_queue_head_t vc_waitq; /* Venus wait queue */
  12. struct list_head vc_pending;
  13. struct list_head vc_processing;
  14. int vc_inuse;
  15. struct super_block *vc_sb;
  16. };
  17. static inline struct venus_comm *coda_vcp(struct super_block *sb)
  18. {
  19. return (struct venus_comm *)((sb)->s_fs_info);
  20. }
  21. /* upcalls */
  22. int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
  23. int venus_getattr(struct super_block *sb, struct CodaFid *fid,
  24. struct coda_vattr *attr);
  25. int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
  26. int venus_lookup(struct super_block *sb, struct CodaFid *fid,
  27. const char *name, int length, int *type,
  28. struct CodaFid *resfid);
  29. int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
  30. vuid_t uid);
  31. int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
  32. struct file **f);
  33. int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
  34. const char *name, int length,
  35. struct CodaFid *newfid, struct coda_vattr *attrs);
  36. int venus_create(struct super_block *sb, struct CodaFid *dirfid,
  37. const char *name, int length, int excl, int mode,
  38. struct CodaFid *newfid, struct coda_vattr *attrs) ;
  39. int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
  40. const char *name, int length);
  41. int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
  42. const char *name, int length);
  43. int venus_readlink(struct super_block *sb, struct CodaFid *fid,
  44. char *buffer, int *length);
  45. int venus_rename(struct super_block *, struct CodaFid *new_fid,
  46. struct CodaFid *old_fid, size_t old_length,
  47. size_t new_length, const char *old_name,
  48. const char *new_name);
  49. int venus_link(struct super_block *sb, struct CodaFid *fid,
  50. struct CodaFid *dirfid, const char *name, int len );
  51. int venus_symlink(struct super_block *sb, struct CodaFid *fid,
  52. const char *name, int len, const char *symname, int symlen);
  53. int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
  54. int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
  55. unsigned int cmd, struct PioctlData *data);
  56. int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
  57. int venus_fsync(struct super_block *sb, struct CodaFid *fid);
  58. int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
  59. /*
  60. * Statistics
  61. */
  62. extern struct venus_comm coda_comms[];
  63. #endif /* __KERNEL__ */
  64. /* messages between coda filesystem in kernel and Venus */
  65. struct upc_req {
  66. struct list_head uc_chain;
  67. caddr_t uc_data;
  68. u_short uc_flags;
  69. u_short uc_inSize; /* Size is at most 5000 bytes */
  70. u_short uc_outSize;
  71. u_short uc_opcode; /* copied from data to save lookup */
  72. int uc_unique;
  73. wait_queue_head_t uc_sleep; /* process' wait queue */
  74. };
  75. #define REQ_ASYNC 0x1
  76. #define REQ_READ 0x2
  77. #define REQ_WRITE 0x4
  78. #define REQ_ABORT 0x8
  79. #endif