Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/ttm: use shmem_read_mapping_page

Soon tmpfs will stop supporting ->readpage and read_mapping_page(): once
"tmpfs: add shmem_read_mapping_page_gfp" has been applied, this patch can
be applied to ease the transition.

ttm_tt_swapin() and ttm_tt_swapout() use shmem_read_mapping_page() in
place of read_mapping_page(), since their swap_space has been created with
shmem_file_setup().

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
3142b651 a39bce7b

+3 -2
+3 -2
drivers/gpu/drm/ttm/ttm_tt.c
··· 31 31 #include <linux/sched.h> 32 32 #include <linux/highmem.h> 33 33 #include <linux/pagemap.h> 34 + #include <linux/shmem_fs.h> 34 35 #include <linux/file.h> 35 36 #include <linux/swap.h> 36 37 #include <linux/slab.h> ··· 485 484 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 486 485 487 486 for (i = 0; i < ttm->num_pages; ++i) { 488 - from_page = read_mapping_page(swap_space, i, NULL); 487 + from_page = shmem_read_mapping_page(swap_space, i); 489 488 if (IS_ERR(from_page)) { 490 489 ret = PTR_ERR(from_page); 491 490 goto out_err; ··· 558 557 from_page = ttm->pages[i]; 559 558 if (unlikely(from_page == NULL)) 560 559 continue; 561 - to_page = read_mapping_page(swap_space, i, NULL); 560 + to_page = shmem_read_mapping_page(swap_space, i); 562 561 if (unlikely(IS_ERR(to_page))) { 563 562 ret = PTR_ERR(to_page); 564 563 goto out_err;