Date: Thu, 16 Jan 2014 16:28:20 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r260779 - stable/10/sys/dev/drm2/ttm Message-ID: <201401161628.s0GGSKWb083006@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Thu Jan 16 16:28:19 2014 New Revision: 260779 URL: http://svnweb.freebsd.org/changeset/base/260779 Log: MFC r259612: ttm_bo_vm_lookup_rb: actually make use of the red-black tree Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Jan 16 16:15:56 2014 (r260778) +++ stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Jan 16 16:28:19 2014 (r260779) @@ -76,13 +76,16 @@ static struct ttm_buffer_object *ttm_bo_ struct ttm_buffer_object *bo; struct ttm_buffer_object *best_bo = NULL; - RB_FOREACH(bo, ttm_bo_device_buffer_objects, &bdev->addr_space_rb) { + bo = RB_ROOT(&bdev->addr_space_rb); + while (bo != NULL) { cur_offset = bo->vm_node->start; if (page_start >= cur_offset) { best_bo = bo; if (page_start == cur_offset) break; - } + bo = RB_RIGHT(bo, vm_rb); + } else + bo = RB_LEFT(bo, vm_rb); } if (unlikely(best_bo == NULL))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401161628.s0GGSKWb083006>