diff --git a/mm/shmem.c b/mm/shmem.c index d43f2806df18d494404d4bb6a70c7aac8a45d9ca..07e3f0d0ba12c03b87896e7cea1cf5a44e1e1ecf 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1670,8 +1670,7 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, struct address_space *mapping = inode->i_mapping; struct shmem_inode_info *info = SHMEM_I(inode); struct mm_struct *charge_mm = vma ? vma->vm_mm : current->mm; - struct swap_info_struct *si; - struct page *page = NULL; + struct page *page; swp_entry_t swap; int error; @@ -1679,12 +1678,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, swap = radix_to_swp_entry(*pagep); *pagep = NULL; - /* Prevent swapoff from happening to us. */ - si = get_swap_device(swap); - if (!si) { - error = EINVAL; - goto failed; - } /* Look it up and read it in.. */ page = lookup_swap_cache(swap, NULL, 0); if (!page) { @@ -1746,8 +1739,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, swap_free(swap); *pagep = page; - if (si) - put_swap_device(si); return 0; failed: if (!shmem_confirm_swap(mapping, index, swap)) @@ -1758,9 +1749,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, put_page(page); } - if (si) - put_swap_device(si); - return error; }