4 #define CODA_PSDEV_MAJOR 67
5 #define MAX_CODADEVS 5 /* how many do we allow */
7 #define CODA_SUPER_MAGIC 0x73757245
11 struct venus_comm * sbi_vcomm;
12 struct super_block *sbi_sb;
13 struct list_head sbi_cihead;
14 struct semaphore sbi_iget4_mutex;
17 /* communication pending/processing queues */
20 wait_queue_head_t vc_waitq; /* Venus wait queue */
21 struct list_head vc_pending;
22 struct list_head vc_processing;
24 struct super_block *vc_sb;
28 static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
30 return ((struct coda_sb_info *)((sb)->u.generic_sbp));
35 int venus_rootfid(struct super_block *sb, ViceFid *fidp);
36 int venus_getattr(struct super_block *sb, struct ViceFid *fid,
37 struct coda_vattr *attr);
38 int venus_setattr(struct super_block *, struct ViceFid *,
40 int venus_lookup(struct super_block *sb, struct ViceFid *fid,
41 const char *name, int length, int *type,
42 struct ViceFid *resfid);
43 int venus_store(struct super_block *sb, struct ViceFid *fid, int flags,
45 int venus_release(struct super_block *sb, struct ViceFid *fid, int flags);
46 int venus_close(struct super_block *sb, struct ViceFid *fid, int flags,
48 int venus_open(struct super_block *sb, struct ViceFid *fid,
49 int flags, struct file **f);
50 int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
51 const char *name, int length,
52 struct ViceFid *newfid, struct coda_vattr *attrs);
53 int venus_create(struct super_block *sb, struct ViceFid *dirfid,
54 const char *name, int length, int excl, int mode, int rdev,
55 struct ViceFid *newfid, struct coda_vattr *attrs) ;
56 int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid,
57 const char *name, int length);
58 int venus_remove(struct super_block *sb, struct ViceFid *dirfid,
59 const char *name, int length);
60 int venus_readlink(struct super_block *sb, struct ViceFid *fid,
61 char *buffer, int *length);
62 int venus_rename(struct super_block *, struct ViceFid *new_fid,
63 struct ViceFid *old_fid, size_t old_length,
64 size_t new_length, const char *old_name,
65 const char *new_name);
66 int venus_link(struct super_block *sb, struct ViceFid *fid,
67 struct ViceFid *dirfid, const char *name, int len );
68 int venus_symlink(struct super_block *sb, struct ViceFid *fid,
69 const char *name, int len, const char *symname, int symlen);
70 int venus_access(struct super_block *sb, struct ViceFid *fid, int mask);
71 int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
72 unsigned int cmd, struct PioctlData *data);
73 int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
74 int venus_fsync(struct super_block *sb, struct ViceFid *fid);
75 int venus_statfs(struct super_block *sb, struct statfs *sfs);
78 /* messages between coda filesystem in kernel and Venus */
80 extern unsigned long coda_timeout;
82 struct list_head uc_chain;
85 u_short uc_inSize; /* Size is at most 5000 bytes */
87 u_short uc_opcode; /* copied from data to save lookup */
89 wait_queue_head_t uc_sleep; /* process' wait queue */
90 unsigned long uc_posttime;
102 struct coda_upcallstats {
103 int ncalls; /* client requests */
104 int nbadcalls; /* upcall failures */
105 int reqs[CODA_NCALLS]; /* count of each request */
108 extern struct coda_upcallstats coda_callstats;
109 extern struct venus_comm coda_comms[];
111 static inline void clstats(int opcode)
113 coda_callstats.ncalls++;
114 if ( (0 <= opcode) && (opcode <= CODA_NCALLS) )
115 coda_callstats.reqs[opcode]++;
117 printk("clstats called with bad opcode %d\n", opcode);
120 static inline void badclstats(void)
122 coda_callstats.nbadcalls++;