4 /* This is the filp table. It is an intermediary between file descriptors and
5 * inodes. A slot is free if filp_count == 0.
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
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
;
34 #define FILP_CLOSED 0 /* filp_mode: associated device closed/gone */
36 #define FSF_UPDATE 001 /* The driver should be informed about new
39 #define FSF_BUSY 002 /* Select operation sent to driver but no
42 #define FSF_RD_BLOCK 010 /* Read request is blocking, the driver should
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