diff options
Diffstat (limited to 'fs/btrfs/compat.h')
-rw-r--r-- | fs/btrfs/compat.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/btrfs/compat.h b/fs/btrfs/compat.h index b3349a66999d..d45fb37887bc 100644 --- a/fs/btrfs/compat.h +++ b/fs/btrfs/compat.h | |||
@@ -5,6 +5,23 @@ | |||
5 | #define trylock_page(page) (!TestSetPageLocked(page)) | 5 | #define trylock_page(page) (!TestSetPageLocked(page)) |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27) | ||
9 | static inline struct dentry *d_obtain_alias(struct inode *inode) | ||
10 | { | ||
11 | struct dentry *d; | ||
12 | |||
13 | if (!inode) | ||
14 | return NULL; | ||
15 | if (IS_ERR(inode)) | ||
16 | return ERR_CAST(inode); | ||
17 | |||
18 | d = d_alloc_anon(inode); | ||
19 | if (!d) | ||
20 | iput(inode); | ||
21 | return d; | ||
22 | } | ||
23 | #endif | ||
24 | |||
8 | /* | 25 | /* |
9 | * Even if AppArmor isn't enabled, it still has different prototypes. | 26 | * Even if AppArmor isn't enabled, it still has different prototypes. |
10 | * Add more distro/version pairs here to declare which has AppArmor applied. | 27 | * Add more distro/version pairs here to declare which has AppArmor applied. |