Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / minix / vfsif.h @ 13

History | View | Annotate | Download (2.42 KB)

1 13 up20180614
#ifndef __MINIX_VFSIF_H
2
#define __MINIX_VFSIF_H
3
4
#include <sys/types.h>
5
#include <limits.h>
6
7
/* VFS/FS flags */
8
#define REQ_RDONLY                001        /* FS is mounted read-only */
9
#define REQ_ISROOT                002        /* FS is root file system */
10
11
#define PATH_NOFLAGS                000
12
#define PATH_RET_SYMLINK        010        /* Return a symlink object (i.e.
13
                                         * do not continue with the contents
14
                                         * of the symlink if it is the last
15
                                         * component in a path). */
16
#define PATH_GET_UCRED                020        /* Request provides a grant ID in m9_l1
17
                                         * and struct ucred size in m9_s4 (as
18
                                         * opposed to a REQ_UID). */
19
20
#define RES_NOFLAGS                000
21
#define RES_THREADED                001        /* FS supports multithreading */
22
#define RES_HASPEEK                002        /* FS implements REQ_PEEK/REQ_BPEEK */
23
#define RES_64BIT                004        /* FS can handle 64-bit file sizes */
24
25
/* VFS/FS error messages */
26
#define EENTERMOUNT              (-301)
27
#define ELEAVEMOUNT              (-302)
28
#define ESYMLINK                 (-303)
29
30
/* VFS/FS types */
31
32
/* User credential structure */
33
typedef struct {
34
        uid_t vu_uid;
35
        gid_t vu_gid;
36
        int vu_ngroups;
37
        gid_t vu_sgroups[NGROUPS_MAX];
38
} vfs_ucred_t;
39
40
/* Request numbers */
41
#define REQ_GETNODE        (FS_BASE + 1)        /* Should be removed */
42
#define REQ_PUTNODE        (FS_BASE + 2)
43
#define REQ_SLINK        (FS_BASE + 3)
44
#define REQ_FTRUNC        (FS_BASE + 4)
45
#define REQ_CHOWN        (FS_BASE + 5)
46
#define REQ_CHMOD        (FS_BASE + 6)
47
#define REQ_INHIBREAD        (FS_BASE + 7)
48
#define REQ_STAT        (FS_BASE + 8)
49
#define REQ_UTIME        (FS_BASE + 9)
50
#define REQ_STATVFS        (FS_BASE + 10)
51
#define REQ_BREAD        (FS_BASE + 11)
52
#define REQ_BWRITE        (FS_BASE + 12)
53
#define REQ_UNLINK        (FS_BASE + 13)
54
#define REQ_RMDIR        (FS_BASE + 14)
55
#define REQ_UNMOUNT        (FS_BASE + 15)
56
#define REQ_SYNC        (FS_BASE + 16)
57
#define REQ_NEW_DRIVER        (FS_BASE + 17)
58
#define REQ_FLUSH        (FS_BASE + 18)
59
#define REQ_READ        (FS_BASE + 19)
60
#define REQ_WRITE        (FS_BASE + 20)
61
#define REQ_MKNOD        (FS_BASE + 21)
62
#define REQ_MKDIR        (FS_BASE + 22)
63
#define REQ_CREATE        (FS_BASE + 23)
64
#define REQ_LINK        (FS_BASE + 24)
65
#define REQ_RENAME        (FS_BASE + 25)
66
#define REQ_LOOKUP        (FS_BASE + 26)
67
#define REQ_MOUNTPOINT        (FS_BASE + 27)
68
#define REQ_READSUPER        (FS_BASE + 28)
69
#define REQ_NEWNODE        (FS_BASE + 29)
70
#define REQ_RDLINK        (FS_BASE + 30)
71
#define REQ_GETDENTS        (FS_BASE + 31)
72
#define REQ_PEEK        (FS_BASE + 32)
73
#define REQ_BPEEK        (FS_BASE + 33)
74
75
#define NREQS                            34
76
77
#define IS_FS_RQ(type) (((type) & ~0xff) == FS_BASE)
78
79
#define TRNS_GET_ID(t)                ((t) & 0xFFFF)
80
#define TRNS_ADD_ID(t,id)        (((t) << 16) | ((id) & 0xFFFF))
81
#define TRNS_DEL_ID(t)                ((short)((t) >> 16))
82
83
#endif