diff options
author | David Woodhouse <dwmw2@infradead.org> | 2008-08-07 11:19:43 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:06 -0400 |
commit | 2db04966ae9a3eeb57f28df9aac4e77d5b287cb1 (patch) | |
tree | 12f42fdef9b5965c7e9970f875a6bf33ed5090f1 /fs | |
parent | 5036f53868ae943704ae69a192d21225dc914c35 (diff) |
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')
-rw-r--r-- | fs/btrfs/compat.h | 3 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 3 |
2 files changed, 5 insertions, 1 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 @@ | |||
1 | #ifndef _COMPAT_H_ | 1 | #ifndef _COMPAT_H_ |
2 | #define _COMPAT_H_ | 2 | #define _COMPAT_H_ |
3 | 3 | ||
4 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26) | ||
5 | #define trylock_page(page) (!TestSetPageLocked(page)) | ||
6 | #endif | ||
4 | 7 | ||
5 | /* | 8 | /* |
6 | * Even if AppArmor isn't enabled, it still has different prototypes. | 9 | * Even if AppArmor isn't enabled, it still has different prototypes. |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 1cf4baba4342..f46f88620c70 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/pagevec.h> | 14 | #include <linux/pagevec.h> |
15 | #include "extent_io.h" | 15 | #include "extent_io.h" |
16 | #include "extent_map.h" | 16 | #include "extent_map.h" |
17 | #include "compat.h" | ||
17 | 18 | ||
18 | /* temporary define until extent_map moves out of btrfs */ | 19 | /* temporary define until extent_map moves out of btrfs */ |
19 | struct kmem_cache *btrfs_cache_create(const char *name, size_t size, | 20 | 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, | |||
3055 | for (i = start_i; i < num_pages; i++) { | 3056 | for (i = start_i; i < num_pages; i++) { |
3056 | page = extent_buffer_page(eb, i); | 3057 | page = extent_buffer_page(eb, i); |
3057 | if (!wait) { | 3058 | if (!wait) { |
3058 | if (TestSetPageLocked(page)) | 3059 | if (!trylock_page(page)) |
3059 | goto unlock_exit; | 3060 | goto unlock_exit; |
3060 | } else { | 3061 | } else { |
3061 | lock_page(page); | 3062 | lock_page(page); |