0001
0002 #ifndef __CODA_PSDEV_H
0003 #define __CODA_PSDEV_H
0004
0005 #include <linux/backing-dev.h>
0006 #include <linux/magic.h>
0007 #include <linux/mutex.h>
0008
0009 #define CODA_PSDEV_MAJOR 67
0010 #define MAX_CODADEVS 5
0011
0012 struct kstatfs;
0013
0014
0015 struct upc_req {
0016 struct list_head uc_chain;
0017 caddr_t uc_data;
0018 u_short uc_flags;
0019 u_short uc_inSize;
0020 u_short uc_outSize;
0021 u_short uc_opcode;
0022 int uc_unique;
0023 wait_queue_head_t uc_sleep;
0024 };
0025
0026 #define CODA_REQ_ASYNC 0x1
0027 #define CODA_REQ_READ 0x2
0028 #define CODA_REQ_WRITE 0x4
0029 #define CODA_REQ_ABORT 0x8
0030
0031
0032 struct venus_comm {
0033 u_long vc_seq;
0034 wait_queue_head_t vc_waitq;
0035 struct list_head vc_pending;
0036 struct list_head vc_processing;
0037 int vc_inuse;
0038 struct super_block *vc_sb;
0039 struct mutex vc_mutex;
0040 };
0041
0042 static inline struct venus_comm *coda_vcp(struct super_block *sb)
0043 {
0044 return (struct venus_comm *)((sb)->s_fs_info);
0045 }
0046
0047
0048 int venus_rootfid(struct super_block *sb, struct CodaFid *fidp);
0049 int venus_getattr(struct super_block *sb, struct CodaFid *fid,
0050 struct coda_vattr *attr);
0051 int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
0052 int venus_lookup(struct super_block *sb, struct CodaFid *fid,
0053 const char *name, int length, int *type,
0054 struct CodaFid *resfid);
0055 int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
0056 kuid_t uid);
0057 int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
0058 struct file **f);
0059 int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
0060 const char *name, int length,
0061 struct CodaFid *newfid, struct coda_vattr *attrs);
0062 int venus_create(struct super_block *sb, struct CodaFid *dirfid,
0063 const char *name, int length, int excl, int mode,
0064 struct CodaFid *newfid, struct coda_vattr *attrs);
0065 int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
0066 const char *name, int length);
0067 int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
0068 const char *name, int length);
0069 int venus_readlink(struct super_block *sb, struct CodaFid *fid,
0070 char *buffer, int *length);
0071 int venus_rename(struct super_block *sb, struct CodaFid *new_fid,
0072 struct CodaFid *old_fid, size_t old_length,
0073 size_t new_length, const char *old_name,
0074 const char *new_name);
0075 int venus_link(struct super_block *sb, struct CodaFid *fid,
0076 struct CodaFid *dirfid, const char *name, int len );
0077 int venus_symlink(struct super_block *sb, struct CodaFid *fid,
0078 const char *name, int len, const char *symname, int symlen);
0079 int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
0080 int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
0081 unsigned int cmd, struct PioctlData *data);
0082 int coda_downcall(struct venus_comm *vcp, int opcode, union outputArgs *out,
0083 size_t nbytes);
0084 int venus_fsync(struct super_block *sb, struct CodaFid *fid);
0085 int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
0086 int venus_access_intent(struct super_block *sb, struct CodaFid *fid,
0087 bool *access_intent_supported,
0088 size_t count, loff_t ppos, int type);
0089
0090
0091
0092
0093
0094 extern struct venus_comm coda_comms[];
0095 #endif