coda_psdev.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. struct kstatfs;
  9. /* communication pending/processing queues */
  10. struct venus_comm {
  11. u_long vc_seq;
  12. wait_queue_head_t vc_waitq; /* Venus wait queue */
  13. struct list_head vc_pending;
  14. struct list_head vc_processing;
  15. int vc_inuse;
  16. struct super_block *vc_sb;
  17. struct backing_dev_info bdi;
  18. };
  19. static inline struct venus_comm *coda_vcp(struct super_block *sb)
  20. {
  21. return (struct venus_comm *)((sb)->s_fs_info);
  22. }
  23. /* upcalls */
  24. int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
  25. int venus_getattr(struct super_block *sb, struct CodaFid *fid,
  26. struct coda_vattr *attr);
  27. int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
  28. int venus_lookup(struct super_block *sb, struct CodaFid *fid,
  29. const char *name, int length, int *type,
  30. struct CodaFid *resfid);
  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. /*
  62. * Statistics
  63. */
  64. extern struct venus_comm coda_comms[];
  65. #endif /* __KERNEL__ */
  66. /* messages between coda filesystem in kernel and Venus */
  67. struct upc_req {
  68. struct list_head uc_chain;
  69. caddr_t uc_data;
  70. u_short uc_flags;
  71. u_short uc_inSize; /* Size is at most 5000 bytes */
  72. u_short uc_outSize;
  73. u_short uc_opcode; /* copied from data to save lookup */
  74. int uc_unique;
  75. wait_queue_head_t uc_sleep; /* process' wait queue */
  76. };
  77. #define CODA_REQ_ASYNC 0x1
  78. #define CODA_REQ_READ 0x2
  79. #define CODA_REQ_WRITE 0x4
  80. #define CODA_REQ_ABORT 0x8
  81. #endif