iso9660fs: initialize buffer cache
[minix.git] / include / minix / vfsif.h
blob60446eb42070fb940e1d4bfcd27a5a34dd9da797
1 #ifndef __MINIX_VFSIF_H
2 #define __MINIX_VFSIF_H
4 #include <sys/types.h>
5 #include <limits.h>
7 /* VFS/FS request fields */
8 #define REQ_ACTIME m9_l2
9 #define REQ_COUNT m9_l2
10 #define REQ_DEV m9_l5
11 #define REQ_DEV2 m9_l1
12 #define REQ_DIR_INO m9_l3
13 #define REQ_FLAGS m9_s3
14 #define REQ_GID m9_s1
15 #define REQ_GRANT m9_l2
16 #define REQ_GRANT2 m9_l1
17 #define REQ_GRANT3 m9_l3
18 #define REQ_INODE_NR m9_l1
19 #define REQ_MEM_SIZE m9_l5
20 #define REQ_MODE m9_s3
21 #define REQ_MODTIME m9_l3
22 #define REQ_NBYTES m9_l5
23 #define REQ_PATH_LEN m9_s2
24 #define REQ_PATH_SIZE m9_l5
25 #define REQ_REN_GRANT_NEW m9_l1
26 #define REQ_REN_GRANT_OLD m9_l2
27 #define REQ_REN_LEN_NEW m9_s2
28 #define REQ_REN_LEN_OLD m9_s1
29 #define REQ_REN_NEW_DIR m9_l4
30 #define REQ_REN_OLD_DIR m9_l3
31 #define REQ_ROOT_INO m9_l4
32 #define REQ_SEEK_POS_HI m9_l3
33 #define REQ_SEEK_POS_LO m9_l4
34 #define REQ_TRC_END_HI m9_l4
35 #define REQ_TRC_END_LO m9_l5
36 #define REQ_TRC_START_HI m9_l2
37 #define REQ_TRC_START_LO m9_l3
38 #define REQ_UCRED_SIZE m9_s4
39 #define REQ_UID m9_s4
42 /* VFS/FS reply fields */
43 #define RES_DEV m9_l4
44 #define RES_GID m9_s1
45 #define RES_INODE_NR m9_l1
46 #define RES_FILE_SIZE_HI m9_l2
47 #define RES_FILE_SIZE_LO m9_l3
48 #define RES_MODE m9_s2
49 #define RES_NBYTES m9_l5
50 #define RES_OFFSET m9_s2
51 #define RES_SEEK_POS_HI m9_l3
52 #define RES_SEEK_POS_LO m9_l4
53 #define RES_SYMLOOP m9_s3
54 #define RES_UID m9_s4
55 #define RES_CONREQS m9_s3
57 /* VFS/FS flags */
58 #define REQ_RDONLY 001
59 #define REQ_ISROOT 002
60 #define PATH_NOFLAGS 000
61 #define PATH_RET_SYMLINK 010 /* Return a symlink object (i.e.
62 * do not continue with the contents
63 * of the symlink if it is the last
64 * component in a path). */
65 #define PATH_GET_UCRED 020 /* Request provides a grant ID in m9_l1
66 * and struct ucred size in m9_s4 (as
67 * opposed to a REQ_UID). */
69 /* VFS/FS error messages */
70 #define EENTERMOUNT (-301)
71 #define ELEAVEMOUNT (-302)
72 #define ESYMLINK (-303)
74 /* VFS/FS types */
76 /* User credential structure */
77 typedef struct {
78 uid_t vu_uid;
79 gid_t vu_gid;
80 int vu_ngroups;
81 gid_t vu_sgroups[NGROUPS_MAX];
82 } vfs_ucred_t;
84 #define NGROUPS_MAX_OLD 8
85 /* User credential structure before increasing
86 * uid_t and gid_t u8_t */
87 typedef struct {
88 short vu_uid;
89 char vu_gid;
90 int vu_ngroups;
91 char vu_sgroups[NGROUPS_MAX_OLD];
92 } vfs_ucred_old_t;
94 /* Request numbers */
95 #define REQ_GETNODE (VFS_BASE + 1) /* Should be removed */
96 #define REQ_PUTNODE (VFS_BASE + 2)
97 #define REQ_SLINK (VFS_BASE + 3)
98 #define REQ_FTRUNC (VFS_BASE + 4)
99 #define REQ_CHOWN (VFS_BASE + 5)
100 #define REQ_CHMOD (VFS_BASE + 6)
101 #define REQ_INHIBREAD (VFS_BASE + 7)
102 #define REQ_STAT (VFS_BASE + 8)
103 #define REQ_UTIME (VFS_BASE + 9)
104 #define REQ_FSTATFS (VFS_BASE + 10)
105 #define REQ_BREAD (VFS_BASE + 11)
106 #define REQ_BWRITE (VFS_BASE + 12)
107 #define REQ_UNLINK (VFS_BASE + 13)
108 #define REQ_RMDIR (VFS_BASE + 14)
109 #define REQ_UNMOUNT (VFS_BASE + 15)
110 #define REQ_SYNC (VFS_BASE + 16)
111 #define REQ_NEW_DRIVER (VFS_BASE + 17)
112 #define REQ_FLUSH (VFS_BASE + 18)
113 #define REQ_READ (VFS_BASE + 19)
114 #define REQ_WRITE (VFS_BASE + 20)
115 #define REQ_MKNOD (VFS_BASE + 21)
116 #define REQ_MKDIR (VFS_BASE + 22)
117 #define REQ_CREATE (VFS_BASE + 23)
118 #define REQ_LINK (VFS_BASE + 24)
119 #define REQ_RENAME (VFS_BASE + 25)
120 #define REQ_LOOKUP (VFS_BASE + 26)
121 #define REQ_MOUNTPOINT (VFS_BASE + 27)
122 #define REQ_READSUPER (VFS_BASE + 28)
123 #define REQ_NEWNODE (VFS_BASE + 29)
124 #define REQ_RDLINK (VFS_BASE + 30)
125 #define REQ_GETDENTS (VFS_BASE + 31)
126 #define REQ_STATVFS (VFS_BASE + 32)
128 #define NREQS 33
130 #define IS_VFS_RQ(type) (((type) & ~0xff) == VFS_BASE)
132 #define TRNS_GET_ID(t) ((t) & 0xFFFF)
133 #define TRNS_ADD_ID(t,id) (((t) << 16) | ((id) & 0xFFFF))
134 #define TRNS_DEL_ID(t) ((short)((t) >> 16))
136 #define PFS_BASE (VFS_BASE + 100)
138 #define PFS_REQ_CHECK_PERMS (PFS_BASE + 1)
139 #define PFS_REQ_VERIFY_FD (PFS_BASE + 2)
140 #define PFS_REQ_SET_FILP (PFS_BASE + 3)
141 #define PFS_REQ_COPY_FILP (PFS_BASE + 4)
142 #define PFS_REQ_PUT_FILP (PFS_BASE + 5)
143 #define PFS_REQ_CANCEL_FD (PFS_BASE + 6)
145 #define PFS_NREQS 7
147 #define IS_PFS_VFS_RQ(type) (type >= PFS_BASE && \
148 type < (PFS_BASE + PFS_NREQS))
150 #endif