diff options
author | Hugh Dickins <hughd@google.com> | 2011-06-27 19:18:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-27 21:00:13 -0400 |
commit | 3142b651ad2232cf0e375c291ee4b893c8559df5 (patch) | |
tree | ec8038ccadc92cbceee37e084c77f73fb61d1d53 /drivers/gpu | |
parent | a39bce7bf60e728cb33b6b0415c3f44e7f1a102b (diff) |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 90e23e0bfadb..58c271ebc0f7 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
32 | #include <linux/highmem.h> | 32 | #include <linux/highmem.h> |
33 | #include <linux/pagemap.h> | 33 | #include <linux/pagemap.h> |
34 | #include <linux/shmem_fs.h> | ||
34 | #include <linux/file.h> | 35 | #include <linux/file.h> |
35 | #include <linux/swap.h> | 36 | #include <linux/swap.h> |
36 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
@@ -484,7 +485,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm) | |||
484 | swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; | 485 | swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; |
485 | 486 | ||
486 | for (i = 0; i < ttm->num_pages; ++i) { | 487 | for (i = 0; i < ttm->num_pages; ++i) { |
487 | from_page = read_mapping_page(swap_space, i, NULL); | 488 | from_page = shmem_read_mapping_page(swap_space, i); |
488 | if (IS_ERR(from_page)) { | 489 | if (IS_ERR(from_page)) { |
489 | ret = PTR_ERR(from_page); | 490 | ret = PTR_ERR(from_page); |
490 | goto out_err; | 491 | goto out_err; |
@@ -557,7 +558,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) | |||
557 | from_page = ttm->pages[i]; | 558 | from_page = ttm->pages[i]; |
558 | if (unlikely(from_page == NULL)) | 559 | if (unlikely(from_page == NULL)) |
559 | continue; | 560 | continue; |
560 | to_page = read_mapping_page(swap_space, i, NULL); | 561 | to_page = shmem_read_mapping_page(swap_space, i); |
561 | if (unlikely(IS_ERR(to_page))) { | 562 | if (unlikely(IS_ERR(to_page))) { |
562 | ret = PTR_ERR(to_page); | 563 | ret = PTR_ERR(to_page); |
563 | goto out_err; | 564 | goto out_err; |