coda_psdev.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_close(struct super_block *sb, struct CodaFid *fid, int flags,
  29. vuid_t uid);
  30. int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
  31. struct file **f);
  32. int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
  33. const char *name, int length,
  34. struct CodaFid *newfid, struct coda_vattr *attrs);
  35. int venus_create(struct super_block *sb, struct CodaFid *dirfid,
  36. const char *name, int length, int excl, int mode,
  37. struct CodaFid *newfid, struct coda_vattr *attrs) ;
  38. int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
  39. const char *name, int length);
  40. int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
  41. const char *name, int length);
  42. int venus_readlink(struct super_block *sb, struct CodaFid *fid,
  43. char *buffer, int *length);
  44. int venus_rename(struct super_block *, struct CodaFid *new_fid,
  45. struct CodaFid *old_fid, size_t old_length,
  46. size_t new_length, const char *old_name,
  47. const char *new_name);
  48. int venus_link(struct super_block *sb, struct CodaFid *fid,
  49. struct CodaFid *dirfid, const char *name, int len );
  50. int venus_symlink(struct super_block *sb, struct CodaFid *fid,
  51. const char *name, int len, const char *symname, int symlen);
  52. int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
  53. int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
  54. unsigned int cmd, struct PioctlData *data);
  55. int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
  56. int venus_fsync(struct super_block *sb, struct CodaFid *fid);
  57. int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
  58. /* messages between coda filesystem in kernel and Venus */
  59. struct upc_req {
  60. struct list_head uc_chain;
  61. caddr_t uc_data;
  62. u_short uc_flags;
  63. u_short uc_inSize; /* Size is at most 5000 bytes */
  64. u_short uc_outSize;
  65. u_short uc_opcode; /* copied from data to save lookup */
  66. int uc_unique;
  67. wait_queue_head_t uc_sleep; /* process' wait queue */
  68. };
  69. #define REQ_ASYNC 0x1
  70. #define REQ_READ 0x2
  71. #define REQ_WRITE 0x4
  72. #define REQ_ABORT 0x8
  73. /*
  74. * Statistics
  75. */
  76. extern struct venus_comm coda_comms[];
  77. #endif