mapping = eb->first_page->mapping;
if (!mapping)
return NULL;
+
+ /*
+ * extent_buffer_page is only called after pinning the page
+ * by increasing the reference count. So we know the page must
+ * be in the radix tree.
+ */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+ rcu_read_lock();
+#else
read_lock_irq(&mapping->tree_lock);
+#endif
p = radix_tree_lookup(&mapping->page_tree, i);
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+ rcu_read_unlock();
+#else
read_unlock_irq(&mapping->tree_lock);
+#endif
return p;
}
}
}
clear_page_dirty_for_io(page);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+ spin_lock_irq(&page->mapping->tree_lock);
+#else
read_lock_irq(&page->mapping->tree_lock);
+#endif
if (!PageDirty(page)) {
radix_tree_tag_clear(&page->mapping->page_tree,
page_index(page),
PAGECACHE_TAG_DIRTY);
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+ spin_unlock_irq(&page->mapping->tree_lock);
+#else
read_unlock_irq(&page->mapping->tree_lock);
+#endif
unlock_page(page);
}
return 0;
kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+static void init_once(void *foo)
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
static void init_once(struct kmem_cache * cachep, void *foo)
#else
static void init_once(void * foo, struct kmem_cache * cachep,
struct kmem_cache *btrfs_cache_create(const char *name, size_t size,
unsigned long extra_flags,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+ void (*ctor)(void *)
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
void (*ctor)(struct kmem_cache *, void *)
#else
void (*ctor)(void *, struct kmem_cache *,
return __set_page_dirty_nobuffers(page);
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)
+static int btrfs_permission(struct inode *inode, int mask)
+#else
static int btrfs_permission(struct inode *inode, int mask,
struct nameidata *nd)
+#endif
{
if (btrfs_test_flag(inode, READONLY) && (mask & MAY_WRITE))
return -EACCES;