mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-07 09:20:11 +00:00
- Use vm_object_reference_locked() directly from
vm_object_reference(). This is intended to get rid of vget() consumers who don't wish to acquire a lock. This is functionally the same as calling vref(). vm_object_reference_locked() already uses vref. Discussed with: alc
This commit is contained in:
parent
5c643ed000
commit
52481a9a9d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177704
@ -364,22 +364,11 @@ vm_object_allocate(objtype_t type, vm_pindex_t size)
|
||||
void
|
||||
vm_object_reference(vm_object_t object)
|
||||
{
|
||||
struct vnode *vp;
|
||||
|
||||
if (object == NULL)
|
||||
return;
|
||||
VM_OBJECT_LOCK(object);
|
||||
object->ref_count++;
|
||||
if (object->type == OBJT_VNODE) {
|
||||
int vfslocked;
|
||||
|
||||
vp = object->handle;
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
|
||||
vget(vp, LK_RETRY, curthread);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
} else
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
vm_object_reference_locked(object);
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -395,8 +384,6 @@ vm_object_reference_locked(vm_object_t object)
|
||||
struct vnode *vp;
|
||||
|
||||
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
|
||||
KASSERT((object->flags & OBJ_DEAD) == 0,
|
||||
("vm_object_reference_locked: dead object referenced"));
|
||||
object->ref_count++;
|
||||
if (object->type == OBJT_VNODE) {
|
||||
vp = object->handle;
|
||||
|
Loading…
Reference in New Issue
Block a user