Date: Thu, 23 Feb 2017 13:14:29 +0000 (UTC) From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314138 - head/sys/dev/xen/gntdev Message-ID: <201702231314.v1NDETCl069347@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Thu Feb 23 13:14:28 2017 New Revision: 314138 URL: https://svnweb.freebsd.org/changeset/base/314138 Log: xen/gndev: use UOFF_TO_IDX instead of OFF_TO_IDX The Xen grant table device treats the mmap offset parameter as an unsigned type, and as so it must use the newly introduced UOFF_TO_IDX. Sponsored by: Citrix Systems R&D MFC after: 2 weeks X-MFC-with: r313690 Modified: head/sys/dev/xen/gntdev/gntdev.c Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Thu Feb 23 09:55:55 2017 (r314137) +++ head/sys/dev/xen/gntdev/gntdev.c Thu Feb 23 13:14:28 2017 (r314138) @@ -796,8 +796,8 @@ gntdev_gmap_pg_fault(vm_object_t object, relative_offset = offset - gmap->file_index; - pidx = OFF_TO_IDX(offset); - ridx = OFF_TO_IDX(relative_offset); + pidx = UOFF_TO_IDX(offset); + ridx = UOFF_TO_IDX(relative_offset); if (ridx >= gmap->count || gmap->grant_map_ops[ridx].status != GNTST_okay) return (VM_PAGER_FAIL); @@ -1067,7 +1067,7 @@ mmap_gref(struct per_user_data *priv_use break; vm_page_insert(gref->page, mem_obj, - OFF_TO_IDX(gref->file_index)); + UOFF_TO_IDX(gref->file_index)); count--; } @@ -1207,7 +1207,7 @@ gntdev_mmap_single(struct cdev *cdev, vm if (error != 0) return (EINVAL); - count = OFF_TO_IDX(size); + count = UOFF_TO_IDX(size); gref_start = gntdev_find_grefs(priv_user, *offset, count); if (gref_start) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702231314.v1NDETCl069347>