coda_psdev.h 3.2 KB

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