diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-09-02 19:12:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-09-02 19:12:30 +0000 |
commit | 43285ac53c73f5c44c432eb522192d335bebfdc2 (patch) | |
tree | 871d8ed3e89861743222eb17a3f2ab7f9b8c481c /sys/dev | |
parent | ee25c0fda93ca39e297a272bb92d0b53fea068bf (diff) |
Initialize the uvm object when we actually need it such that we can
use uvm_obj_init() to initialize the pager ops and initial reference count.
This will help future uvm unlocking diffs.
ok mpi@, jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo_vm.c | 3 |
2 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c index c2abe4a6cae..83bfa2ea2e9 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo.c +++ b/sys/dev/pci/drm/ttm/ttm_bo.c @@ -1167,7 +1167,6 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, } bo->destroy = destroy ? destroy : ttm_bo_default_destroy; - uvm_obj_init(&bo->base.uobj, NULL, 0); kref_init(&bo->kref); INIT_LIST_HEAD(&bo->lru); INIT_LIST_HEAD(&bo->ddestroy); diff --git a/sys/dev/pci/drm/ttm/ttm_bo_vm.c b/sys/dev/pci/drm/ttm/ttm_bo_vm.c index 94beca6e476..cd70004f7b3 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo_vm.c +++ b/sys/dev/pci/drm/ttm/ttm_bo_vm.c @@ -971,8 +971,7 @@ ttm_bo_mmap(struct file *filp, voff_t off, vsize_t size, if (unlikely(ret != 0)) goto out_unref; - bo->base.uobj.pgops = &ttm_bo_vm_ops; - bo->base.uobj.uo_refs++; + uvm_obj_init(&bo->base.uobj, &ttm_bo_vm_ops, 1); return &bo->base.uobj; out_unref: ttm_bo_put(bo); |