summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorSven Wegener2008-07-30 22:54:26 +0200
committerChris Mason2008-09-25 17:04:05 +0200
commit0ee0fda06b943d7ef65f3cec50ab9d427a2baf97 (patch)
tree342ac5337dc72cf18b683f7f79b497db98a6062e /fs/btrfs/inode.c
parentBtrfs: implement memory reclaim for leaf reference cache (diff)
downloadkernel-qcow2-linux-0ee0fda06b943d7ef65f3cec50ab9d427a2baf97.tar.gz
kernel-qcow2-linux-0ee0fda06b943d7ef65f3cec50ab9d427a2baf97.tar.xz
kernel-qcow2-linux-0ee0fda06b943d7ef65f3cec50ab9d427a2baf97.zip
Btrfs: Add compatibility for kernels >= 2.6.27-rc1
Add a couple of #if's to follow API changes. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7af8be076ee5..c4afa9d78da9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3293,7 +3293,9 @@ void btrfs_destroy_inode(struct inode *inode)
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,
@@ -3321,7 +3323,9 @@ void btrfs_destroy_cachep(void)
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 *,
@@ -3561,8 +3565,12 @@ static int btrfs_set_page_dirty(struct page *page)
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;