summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compat.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-08-07 17:19:43 +0200
committerChris Mason <chris.mason@oracle.com>2008-09-25 17:04:06 +0200
commit2db04966ae9a3eeb57f28df9aac4e77d5b287cb1 (patch)
tree12f42fdef9b5965c7e9970f875a6bf33ed5090f1 /fs/btrfs/compat.h
parentBtrfs: fix RHEL test for ClearPageFsMisc (diff)
downloadlinux-2db04966ae9a3eeb57f28df9aac4e77d5b287cb1.tar.xz
linux-2db04966ae9a3eeb57f28df9aac4e77d5b287cb1.zip
Btrfs: Change TestSetPageLocked() to trylock_page()
Add backwards compatibility in compat.h Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> --- compat.h | 3 +++ extent_io.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletions(-) Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/compat.h')
-rw-r--r--fs/btrfs/compat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/compat.h b/fs/btrfs/compat.h
index d39a768e65ff..b3349a66999d 100644
--- a/fs/btrfs/compat.h
+++ b/fs/btrfs/compat.h
@@ -1,6 +1,9 @@
#ifndef _COMPAT_H_
#define _COMPAT_H_
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26)
+#define trylock_page(page) (!TestSetPageLocked(page))
+#endif
/*
* Even if AppArmor isn't enabled, it still has different prototypes.