coda_psdev.h 3.3 KB

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