mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
xarray: Replace exceptional entries
Introduce xarray value entries and tagged pointers to replace radix tree exceptional entries. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in emphasis; exceptional entries are intimidating and different. As the comment explains, you can choose to store values or pointers in the xarray and they are both first-class citizens. Signed-off-by: Matthew Wilcox <[email protected]> Reviewed-by: Josef Bacik <[email protected]>
This commit is contained in:
parent
66ee620f06
commit
3159f943aa
26 changed files with 278 additions and 232 deletions
|
|
@ -70,7 +70,7 @@ static void truncate_exceptional_pvec_entries(struct address_space *mapping,
|
|||
return;
|
||||
|
||||
for (j = 0; j < pagevec_count(pvec); j++)
|
||||
if (radix_tree_exceptional_entry(pvec->pages[j]))
|
||||
if (xa_is_value(pvec->pages[j]))
|
||||
break;
|
||||
|
||||
if (j == pagevec_count(pvec))
|
||||
|
|
@ -85,7 +85,7 @@ static void truncate_exceptional_pvec_entries(struct address_space *mapping,
|
|||
struct page *page = pvec->pages[i];
|
||||
pgoff_t index = indices[i];
|
||||
|
||||
if (!radix_tree_exceptional_entry(page)) {
|
||||
if (!xa_is_value(page)) {
|
||||
pvec->pages[j++] = page;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -347,7 +347,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
|
|||
if (index >= end)
|
||||
break;
|
||||
|
||||
if (radix_tree_exceptional_entry(page))
|
||||
if (xa_is_value(page))
|
||||
continue;
|
||||
|
||||
if (!trylock_page(page))
|
||||
|
|
@ -442,7 +442,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
|
|||
break;
|
||||
}
|
||||
|
||||
if (radix_tree_exceptional_entry(page))
|
||||
if (xa_is_value(page))
|
||||
continue;
|
||||
|
||||
lock_page(page);
|
||||
|
|
@ -561,7 +561,7 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
|||
if (index > end)
|
||||
break;
|
||||
|
||||
if (radix_tree_exceptional_entry(page)) {
|
||||
if (xa_is_value(page)) {
|
||||
invalidate_exceptional_entry(mapping, index,
|
||||
page);
|
||||
continue;
|
||||
|
|
@ -692,7 +692,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
|
|||
if (index > end)
|
||||
break;
|
||||
|
||||
if (radix_tree_exceptional_entry(page)) {
|
||||
if (xa_is_value(page)) {
|
||||
if (!invalidate_exceptional_entry2(mapping,
|
||||
index, page))
|
||||
ret = -EBUSY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue