Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/tmpfs/tmpfs_vnops.c
Show First 20 Lines • Show All 1,277 Lines • ▼ Show 20 Lines | tmpfs_inactive(struct vop_inactive_args *v) | ||||
node = VP_TO_TMPFS_NODE(vp); | node = VP_TO_TMPFS_NODE(vp); | ||||
if (node->tn_links == 0) | if (node->tn_links == 0) | ||||
vrecycle(vp); | vrecycle(vp); | ||||
else | else | ||||
tmpfs_check_mtime(vp); | tmpfs_check_mtime(vp); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | |||||
tmpfs_need_inactive(struct vop_need_inactive_args *ap) | |||||
{ | |||||
struct vnode *vp; | |||||
struct tmpfs_node *node; | |||||
struct vm_object *obj; | |||||
vp = ap->a_vp; | |||||
node = VP_TO_TMPFS_NODE(vp); | |||||
if (node->tn_links == 0) | |||||
goto need; | |||||
if (vp->v_type == VREG) { | |||||
obj = vp->v_object; | |||||
if ((obj->flags & OBJ_TMPFS_DIRTY) != 0) | |||||
goto need; | |||||
} | |||||
return (0); | |||||
need: | |||||
return (1); | |||||
} | |||||
int | int | ||||
tmpfs_reclaim(struct vop_reclaim_args *v) | tmpfs_reclaim(struct vop_reclaim_args *v) | ||||
{ | { | ||||
struct vnode *vp = v->a_vp; | struct vnode *vp = v->a_vp; | ||||
struct tmpfs_mount *tmp; | struct tmpfs_mount *tmp; | ||||
struct tmpfs_node *node; | struct tmpfs_node *node; | ||||
▲ Show 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | struct vop_vector tmpfs_vnodeop_entries = { | ||||
.vop_link = tmpfs_link, | .vop_link = tmpfs_link, | ||||
.vop_rename = tmpfs_rename, | .vop_rename = tmpfs_rename, | ||||
.vop_mkdir = tmpfs_mkdir, | .vop_mkdir = tmpfs_mkdir, | ||||
.vop_rmdir = tmpfs_rmdir, | .vop_rmdir = tmpfs_rmdir, | ||||
.vop_symlink = tmpfs_symlink, | .vop_symlink = tmpfs_symlink, | ||||
.vop_readdir = tmpfs_readdir, | .vop_readdir = tmpfs_readdir, | ||||
.vop_readlink = tmpfs_readlink, | .vop_readlink = tmpfs_readlink, | ||||
.vop_inactive = tmpfs_inactive, | .vop_inactive = tmpfs_inactive, | ||||
.vop_need_inactive = tmpfs_need_inactive, | |||||
.vop_reclaim = tmpfs_reclaim, | .vop_reclaim = tmpfs_reclaim, | ||||
.vop_print = tmpfs_print, | .vop_print = tmpfs_print, | ||||
.vop_pathconf = tmpfs_pathconf, | .vop_pathconf = tmpfs_pathconf, | ||||
.vop_vptofh = tmpfs_vptofh, | .vop_vptofh = tmpfs_vptofh, | ||||
.vop_whiteout = tmpfs_whiteout, | .vop_whiteout = tmpfs_whiteout, | ||||
.vop_bmap = VOP_EOPNOTSUPP, | .vop_bmap = VOP_EOPNOTSUPP, | ||||
.vop_vptocnp = tmpfs_vptocnp, | .vop_vptocnp = tmpfs_vptocnp, | ||||
}; | }; | ||||
/* | /* | ||||
* Same vector for mounts which do not use namecache. | * Same vector for mounts which do not use namecache. | ||||
*/ | */ | ||||
struct vop_vector tmpfs_vnodeop_nonc_entries = { | struct vop_vector tmpfs_vnodeop_nonc_entries = { | ||||
.vop_default = &tmpfs_vnodeop_entries, | .vop_default = &tmpfs_vnodeop_entries, | ||||
.vop_lookup = tmpfs_lookup, | .vop_lookup = tmpfs_lookup, | ||||
}; | }; |