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;
|
index = start;
|
||||||
while (index <= end) {
|
for ( ; ; ) {
|
||||||
cond_resched();
|
cond_resched();
|
||||||
pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
|
pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
|
||||||
min(end - index, (pgoff_t)PAGEVEC_SIZE - 1) + 1,
|
min(end - index, (pgoff_t)PAGEVEC_SIZE - 1) + 1,
|
||||||
pvec.pages, indices);
|
pvec.pages, indices);
|
||||||
if (!pvec.nr) {
|
if (!pvec.nr) {
|
||||||
/* If all gone or hole-punch, we're done */
|
if (index == start)
|
||||||
if (index == start || end != -1)
|
|
||||||
break;
|
break;
|
||||||
/* But if truncating, restart to make sure all gone */
|
|
||||||
index = start;
|
index = start;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (index == start && indices[0] > end) {
|
||||||
|
shmem_deswap_pagevec(&pvec);
|
||||||
|
pagevec_release(&pvec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
mem_cgroup_uncharge_start();
|
mem_cgroup_uncharge_start();
|
||||||
for (i = 0; i < pagevec_count(&pvec); i++) {
|
for (i = 0; i < pagevec_count(&pvec); i++) {
|
||||||
struct page *page = pvec.pages[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;
|
break;
|
||||||
|
|
||||||
if (radix_tree_exceptional_entry(page)) {
|
if (radix_tree_exceptional_entry(page)) {
|
||||||
if (shmem_free_swap(mapping, index, page)) {
|
nr_swaps_freed += !shmem_free_swap(mapping,
|
||||||
/* Swap was replaced by page: retry */
|
index, page);
|
||||||
index--;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nr_swaps_freed++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,11 +535,6 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend)
|
||||||
if (page->mapping == mapping) {
|
if (page->mapping == mapping) {
|
||||||
VM_BUG_ON(PageWriteback(page));
|
VM_BUG_ON(PageWriteback(page));
|
||||||
truncate_inode_page(mapping, page);
|
truncate_inode_page(mapping, page);
|
||||||
} else {
|
|
||||||
/* Page was replaced by swap: retry */
|
|
||||||
unlock_page(page);
|
|
||||||
index--;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue