diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2008-07-30 16:54:26 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 0ee0fda06b943d7ef65f3cec50ab9d427a2baf97 (patch) | |
tree | 342ac5337dc72cf18b683f7f79b497db98a6062e /fs/btrfs/inode.c | |
parent | bcc63abbf3e9bf948a1b0129b3e6120ec7d7f698 (diff) |
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.c | 12 |
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) | |||
3293 | kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); | 3293 | kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); |
3294 | } | 3294 | } |
3295 | 3295 | ||
3296 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23) | 3296 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26) |
3297 | static void init_once(void *foo) | ||
3298 | #elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23) | ||
3297 | static void init_once(struct kmem_cache * cachep, void *foo) | 3299 | static void init_once(struct kmem_cache * cachep, void *foo) |
3298 | #else | 3300 | #else |
3299 | static void init_once(void * foo, struct kmem_cache * cachep, | 3301 | static void init_once(void * foo, struct kmem_cache * cachep, |
@@ -3321,7 +3323,9 @@ void btrfs_destroy_cachep(void) | |||
3321 | 3323 | ||
3322 | struct kmem_cache *btrfs_cache_create(const char *name, size_t size, | 3324 | struct kmem_cache *btrfs_cache_create(const char *name, size_t size, |
3323 | unsigned long extra_flags, | 3325 | unsigned long extra_flags, |
3324 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23) | 3326 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26) |
3327 | void (*ctor)(void *) | ||
3328 | #elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23) | ||
3325 | void (*ctor)(struct kmem_cache *, void *) | 3329 | void (*ctor)(struct kmem_cache *, void *) |
3326 | #else | 3330 | #else |
3327 | void (*ctor)(void *, struct kmem_cache *, | 3331 | void (*ctor)(void *, struct kmem_cache *, |
@@ -3561,8 +3565,12 @@ static int btrfs_set_page_dirty(struct page *page) | |||
3561 | return __set_page_dirty_nobuffers(page); | 3565 | return __set_page_dirty_nobuffers(page); |
3562 | } | 3566 | } |
3563 | 3567 | ||
3568 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26) | ||
3569 | static int btrfs_permission(struct inode *inode, int mask) | ||
3570 | #else | ||
3564 | static int btrfs_permission(struct inode *inode, int mask, | 3571 | static int btrfs_permission(struct inode *inode, int mask, |
3565 | struct nameidata *nd) | 3572 | struct nameidata *nd) |
3573 | #endif | ||
3566 | { | 3574 | { |
3567 | if (btrfs_test_flag(inode, READONLY) && (mask & MAY_WRITE)) | 3575 | if (btrfs_test_flag(inode, READONLY) && (mask & MAY_WRITE)) |
3568 | return -EACCES; | 3576 | return -EACCES; |