Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/file.h
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | struct fadvise_info { | ||||
int fa_advice; /* (f) FADV_* type. */ | int fa_advice; /* (f) FADV_* type. */ | ||||
off_t fa_start; /* (f) Region start. */ | off_t fa_start; /* (f) Region start. */ | ||||
off_t fa_end; /* (f) Region end. */ | off_t fa_end; /* (f) Region end. */ | ||||
}; | }; | ||||
struct file { | struct file { | ||||
void *f_data; /* file descriptor specific data */ | void *f_data; /* file descriptor specific data */ | ||||
struct fileops *f_ops; /* File operations */ | struct fileops *f_ops; /* File operations */ | ||||
struct ucred *f_cred; /* associated credentials. */ | struct credwrap *f_credwrap; /* associated credentials. */ | ||||
struct vnode *f_vnode; /* NULL or applicable vnode */ | struct vnode *f_vnode; /* NULL or applicable vnode */ | ||||
short f_type; /* descriptor type */ | short f_type; /* descriptor type */ | ||||
short f_vnread_flags; /* (f) Sleep lock for f_offset */ | short f_vnread_flags; /* (f) Sleep lock for f_offset */ | ||||
volatile u_int f_flag; /* see fcntl.h */ | volatile u_int f_flag; /* see fcntl.h */ | ||||
volatile u_int f_count; /* reference count */ | volatile u_int f_count; /* reference count */ | ||||
/* | /* | ||||
* DTYPE_VNODE specific fields. | * DTYPE_VNODE specific fields. | ||||
*/ | */ | ||||
Show All 14 Lines | struct file { | ||||
/* | /* | ||||
* Mandatory Access control information. | * Mandatory Access control information. | ||||
*/ | */ | ||||
void *f_label; /* Place-holder for MAC label. */ | void *f_label; /* Place-holder for MAC label. */ | ||||
}; | }; | ||||
#define f_cdevpriv f_vnun.fvn_cdevpriv | #define f_cdevpriv f_vnun.fvn_cdevpriv | ||||
#define f_advice f_vnun.fvn_advice | #define f_advice f_vnun.fvn_advice | ||||
#define f_cred f_credwrap->crw_ucred | |||||
kib: Just curious, the additional indirection for f_cred access does not have a visible cost ? | |||||
#define FOFFSET_LOCKED 0x1 | #define FOFFSET_LOCKED 0x1 | ||||
#define FOFFSET_LOCK_WAITING 0x2 | #define FOFFSET_LOCK_WAITING 0x2 | ||||
#endif /* _KERNEL || _WANT_FILE */ | #endif /* _KERNEL || _WANT_FILE */ | ||||
/* | /* | ||||
* Userland version of struct file, for sysctl | * Userland version of struct file, for sysctl | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |
Just curious, the additional indirection for f_cred access does not have a visible cost ?