Btrfs: Change TestSetPageLocked() to trylock_page()
[safe/jmp/linux-2.6] / fs / btrfs / compat.h
1 #ifndef _COMPAT_H_
2 #define _COMPAT_H_
3
4 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26)
5 #define trylock_page(page) (!TestSetPageLocked(page))
6 #endif
7
8 /*
9  * Even if AppArmor isn't enabled, it still has different prototypes.
10  * Add more distro/version pairs here to declare which has AppArmor applied.
11  */
12 #if defined(CONFIG_SUSE_KERNEL)
13 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
14 # define REMOVE_SUID_PATH 1
15 # endif
16 #endif
17
18 /*
19  * catch any other distros that have patched in apparmor.  This isn't
20  * 100% reliable because it won't catch people that hand compile their
21  * own distro kernels without apparmor compiled in.  But, it is better
22  * than nothing.
23  */
24 #ifdef CONFIG_SECURITY_APPARMOR
25 # define REMOVE_SUID_PATH 1
26 #endif
27
28 #endif /* _COMPAT_H_ */