]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/staging/lustre/lustre/mdc/mdc_request.c
page cache: use xa_lock
[mirror_ubuntu-jammy-kernel.git] / drivers / staging / lustre / lustre / mdc / mdc_request.c
index 3b1c8e5a30537be432245bb5c4cc478772ef0bd6..8ee7b4d273b2ed0942d70feeb70e3201f8713f0c 100644 (file)
@@ -934,14 +934,14 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash,
        struct page *page;
        int found;
 
-       spin_lock_irq(&mapping->tree_lock);
-       found = radix_tree_gang_lookup(&mapping->page_tree,
+       xa_lock_irq(&mapping->i_pages);
+       found = radix_tree_gang_lookup(&mapping->i_pages,
                                       (void **)&page, offset, 1);
        if (found > 0 && !radix_tree_exceptional_entry(page)) {
                struct lu_dirpage *dp;
 
                get_page(page);
-               spin_unlock_irq(&mapping->tree_lock);
+               xa_unlock_irq(&mapping->i_pages);
                /*
                 * In contrast to find_lock_page() we are sure that directory
                 * page cannot be truncated (while DLM lock is held) and,
@@ -989,7 +989,7 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash,
                        page = ERR_PTR(-EIO);
                }
        } else {
-               spin_unlock_irq(&mapping->tree_lock);
+               xa_unlock_irq(&mapping->i_pages);
                page = NULL;
        }
        return page;