From a476fbc91d20cc6d6bc3db3cfdc2b6449b0b1e68 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 7 Aug 2008 11:19:43 -0400 Subject: [PATCH] --- yaml --- r: 128891 b: refs/heads/master c: 2db04966ae9a3eeb57f28df9aac4e77d5b287cb1 h: refs/heads/master i: 128889: ea22b4cff8e8a81e0b259d27e935e16ec99e3598 128887: d5f3e65eade3d31f2b483178e92813be2a5ad53d v: v3 --- [refs] | 2 +- trunk/fs/btrfs/compat.h | 3 +++ trunk/fs/btrfs/extent_io.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 81917fb75030..51c59f60c59b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5036f53868ae943704ae69a192d21225dc914c35 +refs/heads/master: 2db04966ae9a3eeb57f28df9aac4e77d5b287cb1 diff --git a/trunk/fs/btrfs/compat.h b/trunk/fs/btrfs/compat.h index d39a768e65ff..b3349a66999d 100644 --- a/trunk/fs/btrfs/compat.h +++ b/trunk/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. diff --git a/trunk/fs/btrfs/extent_io.c b/trunk/fs/btrfs/extent_io.c index 1cf4baba4342..f46f88620c70 100644 --- a/trunk/fs/btrfs/extent_io.c +++ b/trunk/fs/btrfs/extent_io.c @@ -14,6 +14,7 @@ #include #include "extent_io.h" #include "extent_map.h" +#include "compat.h" /* temporary define until extent_map moves out of btrfs */ struct kmem_cache *btrfs_cache_create(const char *name, size_t size, @@ -3055,7 +3056,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, for (i = start_i; i < num_pages; i++) { page = extent_buffer_page(eb, i); if (!wait) { - if (TestSetPageLocked(page)) + if (!trylock_page(page)) goto unlock_exit; } else { lock_page(page);