Keep hashed user tokens, with the following changes:
[platform/upstream/libdrm.git] / linux-core / drm_vm.c
index 93037bd..19866dc 100644 (file)
@@ -70,8 +70,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
        if (!dev->agp || !dev->agp->cant_use_aperture)
                goto vm_nopage_error;
 
-        if (drm_ht_find_item(&dev->map_hash, (VM_OFFSET(vma) - DRM_MAP_HASH_OFFSET) >> PAGE_SHIFT,  
-                             &hash)) 
+        if (drm_ht_find_item(&dev->map_hash, VM_OFFSET(vma), &hash)) 
                 goto vm_nopage_error;
 
         r_list = drm_hash_entry(hash, drm_map_list_t, hash);
@@ -575,8 +574,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
            )
                return drm_mmap_dma(filp, vma);
 
-        if (drm_ht_find_item(&dev->map_hash, (VM_OFFSET(vma) - DRM_MAP_HASH_OFFSET) >> PAGE_SHIFT,
-                             &hash)) {
+        if (drm_ht_find_item(&dev->map_hash, VM_OFFSET(vma), &hash)) {
                 DRM_ERROR("Could not find map\n");
                return -EINVAL;
         }