Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_object.c
Show First 20 Lines • Show All 2,300 Lines • ▼ Show 20 Lines | next_page: | ||||
/* Release the accumulated object locks. */ | /* Release the accumulated object locks. */ | ||||
for (tobject = object; locked_depth >= 1; locked_depth--) { | for (tobject = object; locked_depth >= 1; locked_depth--) { | ||||
t1object = tobject->backing_object; | t1object = tobject->backing_object; | ||||
VM_OBJECT_RUNLOCK(tobject); | VM_OBJECT_RUNLOCK(tobject); | ||||
tobject = t1object; | tobject = t1object; | ||||
} | } | ||||
} | } | ||||
/* | |||||
* Return the vnode for the given object, or NULL if none exists. | |||||
* For tmpfs objects, the function may return NULL if there is | |||||
* no vnode allocated at the time of the call. | |||||
*/ | |||||
struct vnode * | struct vnode * | ||||
vm_object_vnode(vm_object_t object) | vm_object_vnode(vm_object_t object) | ||||
{ | { | ||||
struct vnode *vp; | |||||
VM_OBJECT_ASSERT_LOCKED(object); | VM_OBJECT_ASSERT_LOCKED(object); | ||||
if (object->type == OBJT_VNODE) | if (object->type == OBJT_VNODE) { | ||||
return (object->handle); | vp = object->handle; | ||||
if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0) | KASSERT(vp != NULL, ("%s: OBJT_VNODE has no vnode", __func__)); | ||||
return (object->un_pager.swp.swp_tmpfs); | } else if (object->type == OBJT_SWAP && | ||||
return (NULL); | (object->flags & OBJ_TMPFS) != 0) { | ||||
vp = object->un_pager.swp.swp_tmpfs; | |||||
KASSERT(vp != NULL, ("%s: OBJT_TMPFS has no vnode", __func__)); | |||||
} else { | |||||
vp = NULL; | |||||
} | |||||
return (vp); | |||||
} | } | ||||
static int | static int | ||||
sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) | sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct kinfo_vmobject *kvo; | struct kinfo_vmobject *kvo; | ||||
char *fullpath, *freepath; | char *fullpath, *freepath; | ||||
struct vnode *vp; | struct vnode *vp; | ||||
▲ Show 20 Lines • Show All 369 Lines • Show Last 20 Lines |