mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Revert "shmem: fix splicing from a hole while it's punched"
This reverts commit 21618a8f0f
.
Change-Id: I1da9a6dbb1cb829c3964c3c29210872920a15898
This commit is contained in:
parent
c9f76626c3
commit
010eab88fb
1 changed files with 9 additions and 15 deletions
24
mm/shmem.c
24
mm/shmem.c
|
@ -501,19 +501,22 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend)
|
|||
}
|
||||
|
||||
index = start;
|
||||
while (index <= end) {
|
||||
for ( ; ; ) {
|
||||
cond_resched();
|
||||
pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
|
||||
min(end - index, (pgoff_t)PAGEVEC_SIZE - 1) + 1,
|
||||
pvec.pages, indices);
|
||||
if (!pvec.nr) {
|
||||
/* If all gone or hole-punch, we're done */
|
||||
if (index == start || end != -1)
|
||||
if (index == start)
|
||||
break;
|
||||
/* But if truncating, restart to make sure all gone */
|
||||
index = start;
|
||||
continue;
|
||||
}
|
||||
if (index == start && indices[0] > end) {
|
||||
shmem_deswap_pagevec(&pvec);
|
||||
pagevec_release(&pvec);
|
||||
break;
|
||||
}
|
||||
mem_cgroup_uncharge_start();
|
||||
for (i = 0; i < pagevec_count(&pvec); i++) {
|
||||
struct page *page = pvec.pages[i];
|
||||
|
@ -523,12 +526,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend)
|
|||
break;
|
||||
|
||||
if (radix_tree_exceptional_entry(page)) {
|
||||
if (shmem_free_swap(mapping, index, page)) {
|
||||
/* Swap was replaced by page: retry */
|
||||
index--;
|
||||
break;
|
||||
}
|
||||
nr_swaps_freed++;
|
||||
nr_swaps_freed += !shmem_free_swap(mapping,
|
||||
index, page);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -536,11 +535,6 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend)
|
|||
if (page->mapping == mapping) {
|
||||
VM_BUG_ON(PageWriteback(page));
|
||||
truncate_inode_page(mapping, page);
|
||||
} else {
|
||||
/* Page was replaced by swap: retry */
|
||||
unlock_page(page);
|
||||
index--;
|
||||
break;
|
||||
}
|
||||
unlock_page(page);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue