Btrfs: Change TestSetPageLocked() to trylock_page()
[linux-2.6/verdex.git] / fs / btrfs / compat.h
blobb3349a66999d20762b407d9dc853cdda908cac74
1 #ifndef _COMPAT_H_
2 #define _COMPAT_H_
4 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26)
5 #define trylock_page(page) (!TestSetPageLocked(page))
6 #endif
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.
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
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.
24 #ifdef CONFIG_SECURITY_APPARMOR
25 # define REMOVE_SUID_PATH 1
26 #endif
28 #endif /* _COMPAT_H_ */