Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/tmpfs/tmpfs_subr.c
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | tmpfs_node_dtor(void *mem, int size, void *arg) | ||||||||||
struct tmpfs_node *node; | struct tmpfs_node *node; | ||||||||||
node = mem; | node = mem; | ||||||||||
node->tn_type = VNON; | node->tn_type = VNON; | ||||||||||
} | } | ||||||||||
static int | static int | ||||||||||
tmpfs_node_init(void *mem, int size, int flags) | tmpfs_node_init(void *mem, int size, int flags) | ||||||||||
{ | { | ||||||||||
markjUnsubmitted Not Done Inline Actions
markj: | |||||||||||
struct tmpfs_node *node; | struct tmpfs_node *node; | ||||||||||
node = mem; | node = mem; | ||||||||||
node->tn_id = 0; | node->tn_id = 0; | ||||||||||
Not Done Inline Actions
markj: | |||||||||||
Done Inline Actionsfixed locally mjg: fixed locally | |||||||||||
mtx_init(&node->tn_interlock, "tmpfsni", NULL, MTX_DEF); | mtx_init(&node->tn_interlock, "tmpfsni", NULL, MTX_DEF); | ||||||||||
node->tn_gen = arc4random(); | node->tn_gen = arc4random(); | ||||||||||
return (0); | return (0); | ||||||||||
} | } | ||||||||||
static void | static void | ||||||||||
tmpfs_node_fini(void *mem, int size) | tmpfs_node_fini(void *mem, int size) | ||||||||||
{ | { | ||||||||||
Show All 12 Lines | tmpfs_subr_init(void) | ||||||||||
VFS_SMR_ZONE_SET(tmpfs_node_pool); | VFS_SMR_ZONE_SET(tmpfs_node_pool); | ||||||||||
} | } | ||||||||||
void | void | ||||||||||
tmpfs_subr_uninit(void) | tmpfs_subr_uninit(void) | ||||||||||
{ | { | ||||||||||
uma_zdestroy(tmpfs_node_pool); | uma_zdestroy(tmpfs_node_pool); | ||||||||||
} | } | ||||||||||
Done Inline ActionsI don't know if this assert is of any use, cargo culted this bit from the original swap pager. mjg: I don't know if this assert is of any use, cargo culted this bit from the original swap pager. | |||||||||||
Not Done Inline ActionsIt does make sense, but perhaps replace the word 'Splittable' with 'tmpfs vm' kib: It does make sense, but perhaps replace the word 'Splittable' with 'tmpfs vm' | |||||||||||
static int | static int | ||||||||||
sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) | sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) | ||||||||||
{ | { | ||||||||||
int error; | int error; | ||||||||||
long pages, bytes; | long pages, bytes; | ||||||||||
pages = *(long *)arg1; | pages = *(long *)arg1; | ||||||||||
bytes = pages * PAGE_SIZE; | bytes = pages * PAGE_SIZE; | ||||||||||
▲ Show 20 Lines • Show All 431 Lines • ▼ Show 20 Lines | |||||||||||
{ | { | ||||||||||
ASSERT_VOP_ELOCKED(vp, "tmpfs_destroy_vobject"); | ASSERT_VOP_ELOCKED(vp, "tmpfs_destroy_vobject"); | ||||||||||
if (vp->v_type != VREG || obj == NULL) | if (vp->v_type != VREG || obj == NULL) | ||||||||||
return; | return; | ||||||||||
VM_OBJECT_WLOCK(obj); | VM_OBJECT_WLOCK(obj); | ||||||||||
VI_LOCK(vp); | VI_LOCK(vp); | ||||||||||
VNASSERT((obj->flags & OBJ_TMPFS_VREF) == 0, vp, | |||||||||||
("referenced vnode when it should not be")); | |||||||||||
vm_object_clear_flag(obj, OBJ_TMPFS); | vm_object_clear_flag(obj, OBJ_TMPFS); | ||||||||||
obj->un_pager.swp.swp_tmpfs = NULL; | obj->un_pager.swp.swp_tmpfs = NULL; | ||||||||||
if (vp->v_writecount < 0) | if (vp->v_writecount < 0) | ||||||||||
vp->v_writecount = 0; | vp->v_writecount = 0; | ||||||||||
VI_UNLOCK(vp); | VI_UNLOCK(vp); | ||||||||||
VM_OBJECT_WUNLOCK(obj); | VM_OBJECT_WUNLOCK(obj); | ||||||||||
Not Done Inline ActionsThere should be a blank line after the last line of the text where the multi-line comment applies. kib: There should be a blank line after the last line of the text where the multi-line comment… | |||||||||||
} | } | ||||||||||
/* | /* | ||||||||||
* Need to clear v_object for insmntque failure. | * Need to clear v_object for insmntque failure. | ||||||||||
*/ | */ | ||||||||||
static void | static void | ||||||||||
tmpfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) | tmpfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) | ||||||||||
{ | { | ||||||||||
▲ Show 20 Lines • Show All 1,396 Lines • Show Last 20 Lines |