Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/vnode.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
* The vnode is the focus of all file activity in UNIX. There is a | * The vnode is the focus of all file activity in UNIX. There is a | ||||
* unique vnode allocated for each active file, each current directory, | * unique vnode allocated for each active file, each current directory, | ||||
* each mounted-on file, text file, and the root. | * each mounted-on file, text file, and the root. | ||||
*/ | */ | ||||
/* | /* | ||||
* Vnode types. VNON means no type. | * Vnode types. VNON means no type. | ||||
*/ | */ | ||||
enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, | enum_uint8_decl(vtype) { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, | ||||
kib: Can you reformat these to have one symbol per-line? | |||||
mjgAuthorUnsubmitted Done Inline Actionsi can do it if you insist but i don't see much point mjg: i can do it if you insist but i don't see much point | |||||
kibUnsubmitted Not Done Inline ActionsI do think that one line per symbol improves the code layout and makes future diffs smaller. Also, I think you could do ... VMARKER, VLASTTYPE = VMARKER, }; kib: I do think that one line per symbol improves the code layout and makes future diffs smaller. | |||||
VMARKER }; | VMARKER }; | ||||
#define VLASTTYPE VMARKER | #define VLASTTYPE VMARKER | ||||
enum vstate { VSTATE_UNINITIALIZED, VSTATE_CONSTRUCTED, VSTATE_DESTROYING, | enum_uint8_decl(vstate) { VSTATE_UNINITIALIZED, VSTATE_CONSTRUCTED, VSTATE_DESTROYING, | ||||
VSTATE_DEAD }; | VSTATE_DEAD }; | ||||
#define VLASTSTATE VSTATE_DEAD | #define VLASTSTATE VSTATE_DEAD | ||||
enum vgetstate { VGET_NONE, VGET_HOLDCNT, VGET_USECOUNT }; | enum vgetstate { VGET_NONE, VGET_HOLDCNT, VGET_USECOUNT }; | ||||
/* | /* | ||||
* Each underlying filesystem allocates its own private area and hangs | * Each underlying filesystem allocates its own private area and hangs | ||||
* it from v_data. If non-null, this area is freed in getnewvnode(). | * it from v_data. If non-null, this area is freed in getnewvnode(). | ||||
*/ | */ | ||||
Show All 33 Lines | |||||
#if defined(_KERNEL) || defined(_KVM_VNODE) | #if defined(_KERNEL) || defined(_KVM_VNODE) | ||||
struct vnode { | struct vnode { | ||||
/* | /* | ||||
* Fields which define the identity of the vnode. These fields are | * Fields which define the identity of the vnode. These fields are | ||||
* owned by the filesystem (XXX: and vgone() ?) | * owned by the filesystem (XXX: and vgone() ?) | ||||
*/ | */ | ||||
enum vtype v_type:8; /* u vnode type */ | enum_uint8(vtype) v_type; /* u vnode type */ | ||||
enum vstate v_state:8; /* u vnode state */ | enum_uint8(vstate) v_state; /* u vnode state */ | ||||
arichardsonUnsubmitted Not Done Inline ActionsPlain enum should be fine. arichardson: Plain `enum` should be fine. | |||||
mjgAuthorUnsubmitted Done Inline Actionsplain enum should fail to compile so that it is apparent everywhere what the size is mjg: plain enum should fail to compile so that it is apparent everywhere what the size is | |||||
arichardsonUnsubmitted Not Done Inline ActionsIf the definition is visible the compiler knows the size so plain enum does the right thing. If you prefer it this way to be explicit that's fine by me although I'd limit the change to just the struct definition, in the function signatures it's unnecessary IMO. arichardson: If the definition is visible the compiler knows the size so plain enum does the right thing. If… | |||||
short v_irflag; /* i frequently read flags */ | short v_irflag; /* i frequently read flags */ | ||||
seqc_t v_seqc; /* i modification count */ | seqc_t v_seqc; /* i modification count */ | ||||
uint32_t v_nchash; /* u namecache hash */ | uint32_t v_nchash; /* u namecache hash */ | ||||
u_int v_hash; | u_int v_hash; | ||||
struct vop_vector *v_op; /* u vnode operations vector */ | struct vop_vector *v_op; /* u vnode operations vector */ | ||||
void *v_data; /* u private data for fs */ | void *v_data; /* u private data for fs */ | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 1,083 Lines • Show Last 20 Lines |
Can you reformat these to have one symbol per-line?