page cache: use xa_lock
[linux-2.6-microblaze.git] / mm / huge_memory.c
index 3f3267a..14ed6ee 100644 (file)
@@ -2450,7 +2450,7 @@ static void __split_huge_page(struct page *page, struct list_head *list,
        } else {
                /* Additional pin to radix tree */
                page_ref_add(head, 2);
-               spin_unlock(&head->mapping->tree_lock);
+               xa_unlock(&head->mapping->i_pages);
        }
 
        spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags);
@@ -2658,15 +2658,15 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
        if (mapping) {
                void **pslot;
 
-               spin_lock(&mapping->tree_lock);
-               pslot = radix_tree_lookup_slot(&mapping->page_tree,
+               xa_lock(&mapping->i_pages);
+               pslot = radix_tree_lookup_slot(&mapping->i_pages,
                                page_index(head));
                /*
                 * Check if the head page is present in radix tree.
                 * We assume all tail are present too, if head is there.
                 */
                if (radix_tree_deref_slot_protected(pslot,
-                                       &mapping->tree_lock) != head)
+                                       &mapping->i_pages.xa_lock) != head)
                        goto fail;
        }
 
@@ -2700,7 +2700,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
                }
                spin_unlock(&pgdata->split_queue_lock);
 fail:          if (mapping)
-                       spin_unlock(&mapping->tree_lock);
+                       xa_unlock(&mapping->i_pages);
                spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags);
                unfreeze_page(head);
                ret = -EBUSY;