4 #define CODA_PSDEV_MAJOR 67
5 #define MAX_CODADEVS 5 /* how many do we allow */
7 extern struct venus_comm coda_upc_comm
;
8 extern struct coda_sb_info coda_super_info
;
9 #define CODA_SUPER_MAGIC 0x73757245
13 struct inode
* sbi_psdev
; /* /dev/cfs? Venus/kernel device */
14 struct inode
* sbi_ctlcp
; /* control magic file */
16 struct venus_comm
* sbi_vcomm
;
17 struct inode
* sbi_root
;
18 struct super_block
*sbi_sb
;
19 struct list_head sbi_cchead
;
20 struct list_head sbi_volroothead
;
23 /* communication pending/processing queues */
26 wait_queue_head_t vc_waitq
; /* Venus wait queue */
27 struct list_head vc_pending
;
28 struct list_head vc_processing
;
30 pid_t vc_pid
; /* Venus pid */
34 static inline struct coda_sb_info
*coda_sbp(struct super_block
*sb
)
36 return ((struct coda_sb_info
*)((sb
)->u
.generic_sbp
));
41 extern void coda_psdev_detach(int unit
);
42 extern int init_coda_psdev(void);
46 int venus_rootfid(struct super_block
*sb
, ViceFid
*fidp
);
47 int venus_getattr(struct super_block
*sb
, struct ViceFid
*fid
,
48 struct coda_vattr
*attr
);
49 int venus_setattr(struct super_block
*, struct ViceFid
*,
51 int venus_lookup(struct super_block
*sb
, struct ViceFid
*fid
,
52 const char *name
, int length
, int *type
,
53 struct ViceFid
*resfid
);
54 int venus_release(struct super_block
*sb
, struct ViceFid
*fid
, int flags
,
56 int venus_open(struct super_block
*sb
, struct ViceFid
*fid
,
57 int flags
, ino_t
*ino
, dev_t
*dev
);
58 int venus_mkdir(struct super_block
*sb
, struct ViceFid
*dirfid
,
59 const char *name
, int length
,
60 struct ViceFid
*newfid
, struct coda_vattr
*attrs
);
61 int venus_create(struct super_block
*sb
, struct ViceFid
*dirfid
,
62 const char *name
, int length
, int excl
, int mode
, int rdev
,
63 struct ViceFid
*newfid
, struct coda_vattr
*attrs
) ;
64 int venus_rmdir(struct super_block
*sb
, struct ViceFid
*dirfid
,
65 const char *name
, int length
);
66 int venus_remove(struct super_block
*sb
, struct ViceFid
*dirfid
,
67 const char *name
, int length
);
68 int venus_readlink(struct super_block
*sb
, struct ViceFid
*fid
,
69 char *buffer
, int *length
);
70 int venus_rename(struct super_block
*, struct ViceFid
*new_fid
,
71 struct ViceFid
*old_fid
, size_t old_length
,
72 size_t new_length
, const char *old_name
,
73 const char *new_name
);
74 int venus_link(struct super_block
*sb
, struct ViceFid
*fid
,
75 struct ViceFid
*dirfid
, const char *name
, int len
);
76 int venus_symlink(struct super_block
*sb
, struct ViceFid
*fid
,
77 const char *name
, int len
, const char *symname
, int symlen
);
78 int venus_access(struct super_block
*sb
, struct ViceFid
*fid
, int mask
);
79 int venus_pioctl(struct super_block
*sb
, struct ViceFid
*fid
,
80 unsigned int cmd
, struct PioctlData
*data
);
81 int coda_downcall(int opcode
, union outputArgs
*out
, struct super_block
*sb
);
82 int venus_fsync(struct super_block
*sb
, struct ViceFid
*fid
);
85 /* messages between coda filesystem in kernel and Venus */
87 extern unsigned long coda_timeout
;
89 struct list_head uc_chain
;
92 u_short uc_inSize
; /* Size is at most 5000 bytes */
94 u_short uc_opcode
; /* copied from data to save lookup */
96 wait_queue_head_t uc_sleep
; /* process' wait queue */
97 unsigned long uc_posttime
;
100 #define REQ_ASYNC 0x1
102 #define REQ_WRITE 0x4
108 struct coda_upcallstats
{
109 int ncalls
; /* client requests */
110 int nbadcalls
; /* upcall failures */
111 int reqs
[CODA_NCALLS
]; /* count of each request */
114 extern struct coda_upcallstats coda_callstats
;
116 static inline void clstats(int opcode
)
118 coda_callstats
.ncalls
++;
119 if ( (0 <= opcode
) && (opcode
<= CODA_NCALLS
) )
120 coda_callstats
.reqs
[opcode
]++;
122 printk("clstats called with bad opcode %d\n", opcode
);
125 static inline void badclstats(void)
127 coda_callstats
.nbadcalls
++;