00001 /* This is the filp table. It is an intermediary between file descriptors and 00002 * inodes. A slot is free if filp_count == 0. 00003 */ 00004 00005 EXTERN struct filp { 00006 mode_t filp_mode; /* RW bits, telling how file is opened */ 00007 int filp_flags; /* flags from open and fcntl */ 00008 int filp_state; /* state for crash recovery */ 00009 int filp_count; /* how many file descriptors share this slot?*/ 00010 /* struct inode *filp_ino;*/ /* pointer to the inode */ 00011 00012 struct vnode *filp_vno; 00013 00014 u64_t filp_pos; /* file position */ 00015 00016 /* the following fields are for select() and are owned by the generic 00017 * select() code (i.e., fd-type-specific select() code can't touch these). 00018 */ 00019 int filp_selectors; /* select()ing processes blocking on this fd */ 00020 int filp_select_ops; /* interested in these SEL_* operations */ 00021 int filp_select_flags; /* Select flags for the filp */ 00022 00023 /* following are for fd-type-specific select() */ 00024 int filp_pipe_select_ops; 00025 } filp[NR_FILPS]; 00026 00027 #define FILP_CLOSED 0 /* filp_mode: associated device closed */ 00028 00029 #define FS_NORMAL 0 /* file descriptor can be used normally */ 00030 #define FS_NEEDS_REOPEN 1 /* file descriptor needs to be re-opened */ 00031 00032 #define FSF_UPDATE 1 /* The driver should be informed about new 00033 * state. 00034 */ 00035 #define FSF_BUSY 2 /* Select operation sent to driver but no 00036 * reply yet. 00037 */ 00038 #define FSF_BLOCK 4 /* Request is blocking, the driver should 00039 * keep state. 00040 */ 00041 00042 #define NIL_FILP (struct filp *) 0 /* indicates absence of a filp slot */
1.5.8