#ifndef __CODA_PSDEV_H
|
#ifndef __CODA_PSDEV_H
|
#define __CODA_PSDEV_H
|
#define __CODA_PSDEV_H
|
|
|
#define CODA_PSDEV_MAJOR 67
|
#define CODA_PSDEV_MAJOR 67
|
#define MAX_CODADEVS 5 /* how many do we allow */
|
#define MAX_CODADEVS 5 /* how many do we allow */
|
|
|
#define CODA_SUPER_MAGIC 0x73757245
|
#define CODA_SUPER_MAGIC 0x73757245
|
|
|
struct coda_sb_info
|
struct coda_sb_info
|
{
|
{
|
struct venus_comm * sbi_vcomm;
|
struct venus_comm * sbi_vcomm;
|
struct super_block *sbi_sb;
|
struct super_block *sbi_sb;
|
struct list_head sbi_cihead;
|
struct list_head sbi_cihead;
|
struct semaphore sbi_iget4_mutex;
|
struct semaphore sbi_iget4_mutex;
|
};
|
};
|
|
|
/* communication pending/processing queues */
|
/* communication pending/processing queues */
|
struct venus_comm {
|
struct venus_comm {
|
u_long vc_seq;
|
u_long vc_seq;
|
wait_queue_head_t vc_waitq; /* Venus wait queue */
|
wait_queue_head_t vc_waitq; /* Venus wait queue */
|
struct list_head vc_pending;
|
struct list_head vc_pending;
|
struct list_head vc_processing;
|
struct list_head vc_processing;
|
int vc_inuse;
|
int vc_inuse;
|
struct super_block *vc_sb;
|
struct super_block *vc_sb;
|
};
|
};
|
|
|
|
|
static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
|
static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
|
{
|
{
|
return ((struct coda_sb_info *)((sb)->u.generic_sbp));
|
return ((struct coda_sb_info *)((sb)->u.generic_sbp));
|
}
|
}
|
|
|
|
|
/* upcalls */
|
/* upcalls */
|
int venus_rootfid(struct super_block *sb, ViceFid *fidp);
|
int venus_rootfid(struct super_block *sb, ViceFid *fidp);
|
int venus_getattr(struct super_block *sb, struct ViceFid *fid,
|
int venus_getattr(struct super_block *sb, struct ViceFid *fid,
|
struct coda_vattr *attr);
|
struct coda_vattr *attr);
|
int venus_setattr(struct super_block *, struct ViceFid *,
|
int venus_setattr(struct super_block *, struct ViceFid *,
|
struct coda_vattr *);
|
struct coda_vattr *);
|
int venus_lookup(struct super_block *sb, struct ViceFid *fid,
|
int venus_lookup(struct super_block *sb, struct ViceFid *fid,
|
const char *name, int length, int *type,
|
const char *name, int length, int *type,
|
struct ViceFid *resfid);
|
struct ViceFid *resfid);
|
int venus_store(struct super_block *sb, struct ViceFid *fid, int flags,
|
int venus_store(struct super_block *sb, struct ViceFid *fid, int flags,
|
struct coda_cred *);
|
struct coda_cred *);
|
int venus_release(struct super_block *sb, struct ViceFid *fid, int flags);
|
int venus_release(struct super_block *sb, struct ViceFid *fid, int flags);
|
int venus_close(struct super_block *sb, struct ViceFid *fid, int flags,
|
int venus_close(struct super_block *sb, struct ViceFid *fid, int flags,
|
struct coda_cred *);
|
struct coda_cred *);
|
int venus_open(struct super_block *sb, struct ViceFid *fid,
|
int venus_open(struct super_block *sb, struct ViceFid *fid,
|
int flags, struct file **f);
|
int flags, struct file **f);
|
int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
|
int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
|
const char *name, int length,
|
const char *name, int length,
|
struct ViceFid *newfid, struct coda_vattr *attrs);
|
struct ViceFid *newfid, struct coda_vattr *attrs);
|
int venus_create(struct super_block *sb, struct ViceFid *dirfid,
|
int venus_create(struct super_block *sb, struct ViceFid *dirfid,
|
const char *name, int length, int excl, int mode, int rdev,
|
const char *name, int length, int excl, int mode, int rdev,
|
struct ViceFid *newfid, struct coda_vattr *attrs) ;
|
struct ViceFid *newfid, struct coda_vattr *attrs) ;
|
int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid,
|
int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid,
|
const char *name, int length);
|
const char *name, int length);
|
int venus_remove(struct super_block *sb, struct ViceFid *dirfid,
|
int venus_remove(struct super_block *sb, struct ViceFid *dirfid,
|
const char *name, int length);
|
const char *name, int length);
|
int venus_readlink(struct super_block *sb, struct ViceFid *fid,
|
int venus_readlink(struct super_block *sb, struct ViceFid *fid,
|
char *buffer, int *length);
|
char *buffer, int *length);
|
int venus_rename(struct super_block *, struct ViceFid *new_fid,
|
int venus_rename(struct super_block *, struct ViceFid *new_fid,
|
struct ViceFid *old_fid, size_t old_length,
|
struct ViceFid *old_fid, size_t old_length,
|
size_t new_length, const char *old_name,
|
size_t new_length, const char *old_name,
|
const char *new_name);
|
const char *new_name);
|
int venus_link(struct super_block *sb, struct ViceFid *fid,
|
int venus_link(struct super_block *sb, struct ViceFid *fid,
|
struct ViceFid *dirfid, const char *name, int len );
|
struct ViceFid *dirfid, const char *name, int len );
|
int venus_symlink(struct super_block *sb, struct ViceFid *fid,
|
int venus_symlink(struct super_block *sb, struct ViceFid *fid,
|
const char *name, int len, const char *symname, int symlen);
|
const char *name, int len, const char *symname, int symlen);
|
int venus_access(struct super_block *sb, struct ViceFid *fid, int mask);
|
int venus_access(struct super_block *sb, struct ViceFid *fid, int mask);
|
int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
|
int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
|
unsigned int cmd, struct PioctlData *data);
|
unsigned int cmd, struct PioctlData *data);
|
int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
|
int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
|
int venus_fsync(struct super_block *sb, struct ViceFid *fid);
|
int venus_fsync(struct super_block *sb, struct ViceFid *fid);
|
int venus_statfs(struct super_block *sb, struct statfs *sfs);
|
int venus_statfs(struct super_block *sb, struct statfs *sfs);
|
|
|
|
|
/* messages between coda filesystem in kernel and Venus */
|
/* messages between coda filesystem in kernel and Venus */
|
extern int coda_hard;
|
extern int coda_hard;
|
extern unsigned long coda_timeout;
|
extern unsigned long coda_timeout;
|
struct upc_req {
|
struct upc_req {
|
struct list_head uc_chain;
|
struct list_head uc_chain;
|
caddr_t uc_data;
|
caddr_t uc_data;
|
u_short uc_flags;
|
u_short uc_flags;
|
u_short uc_inSize; /* Size is at most 5000 bytes */
|
u_short uc_inSize; /* Size is at most 5000 bytes */
|
u_short uc_outSize;
|
u_short uc_outSize;
|
u_short uc_opcode; /* copied from data to save lookup */
|
u_short uc_opcode; /* copied from data to save lookup */
|
int uc_unique;
|
int uc_unique;
|
wait_queue_head_t uc_sleep; /* process' wait queue */
|
wait_queue_head_t uc_sleep; /* process' wait queue */
|
unsigned long uc_posttime;
|
unsigned long uc_posttime;
|
};
|
};
|
|
|
#define REQ_ASYNC 0x1
|
#define REQ_ASYNC 0x1
|
#define REQ_READ 0x2
|
#define REQ_READ 0x2
|
#define REQ_WRITE 0x4
|
#define REQ_WRITE 0x4
|
#define REQ_ABORT 0x8
|
#define REQ_ABORT 0x8
|
|
|
|
|
/*
|
/*
|
* Statistics
|
* Statistics
|
*/
|
*/
|
struct coda_upcallstats {
|
struct coda_upcallstats {
|
int ncalls; /* client requests */
|
int ncalls; /* client requests */
|
int nbadcalls; /* upcall failures */
|
int nbadcalls; /* upcall failures */
|
int reqs[CODA_NCALLS]; /* count of each request */
|
int reqs[CODA_NCALLS]; /* count of each request */
|
} ;
|
} ;
|
|
|
extern struct coda_upcallstats coda_callstats;
|
extern struct coda_upcallstats coda_callstats;
|
extern struct venus_comm coda_comms[];
|
extern struct venus_comm coda_comms[];
|
|
|
static inline void clstats(int opcode)
|
static inline void clstats(int opcode)
|
{
|
{
|
coda_callstats.ncalls++;
|
coda_callstats.ncalls++;
|
if ( (0 <= opcode) && (opcode <= CODA_NCALLS) )
|
if ( (0 <= opcode) && (opcode <= CODA_NCALLS) )
|
coda_callstats.reqs[opcode]++;
|
coda_callstats.reqs[opcode]++;
|
else
|
else
|
printk("clstats called with bad opcode %d\n", opcode);
|
printk("clstats called with bad opcode %d\n", opcode);
|
}
|
}
|
|
|
static inline void badclstats(void)
|
static inline void badclstats(void)
|
{
|
{
|
coda_callstats.nbadcalls++;
|
coda_callstats.nbadcalls++;
|
}
|
}
|
|
|
#endif
|
#endif
|
|
|