import / small alignment of many arm includes
[minix3.git] / servers / vfs / file.h
blobefbe80d97584ba3f3dde7c48e883862fb24b8f11
1 #ifndef __VFS_FILE_H__
2 #define __VFS_FILE_H__
4 /* This is the filp table. It is an intermediary between file descriptors and
5 * inodes. A slot is free if filp_count == 0.
6 */
8 EXTERN struct filp {
9 mode_t filp_mode; /* RW bits, telling how file is opened */
10 int filp_flags; /* flags from open and fcntl */
11 int filp_count; /* how many file descriptors share this slot?*/
12 struct vnode *filp_vno; /* vnode belonging to this file */
13 off_t filp_pos; /* file position */
14 mutex_t filp_lock; /* lock to gain exclusive access */
15 struct fproc *filp_softlock; /* if not NULL; this filp didn't lock the
16 * vnode. Another filp already holds a lock
17 * for this thread */
18 struct fproc *filp_ioctl_fp; /* if not NULL, this filp is locked by the
19 * process for a currently ongoing IOCTL call
22 /* the following fields are for select() and are owned by the generic
23 * select() code (i.e., fd-type-specific select() code can't touch these).
24 * These fields may be changed without holding the filp lock.
26 int filp_selectors; /* select()ing processes blocking on this fd */
27 int filp_select_ops; /* interested in these SEL_* operations */
28 int filp_select_flags; /* Select flags for the filp */
30 /* following are for fd-type-specific select() */
31 int filp_pipe_select_ops;
32 } filp[NR_FILPS];
34 #define FILP_CLOSED 0 /* filp_mode: associated device closed/gone */
36 #define FSF_UPDATE 001 /* The driver should be informed about new
37 * state.
39 #define FSF_BUSY 002 /* Select operation sent to driver but no
40 * reply yet.
42 #define FSF_RD_BLOCK 010 /* Read request is blocking, the driver should
43 * keep state.
45 #define FSF_WR_BLOCK 020 /* Write request is blocking */
46 #define FSF_ERR_BLOCK 040 /* Exception request is blocking */
47 #define FSF_BLOCKED 070
48 #endif