Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128891
b: refs/heads/master
c: 2db0496
h: refs/heads/master
i:
  128889: ea22b4c
  128887: d5f3e65
v: v3
  • Loading branch information
David Woodhouse authored and Chris Mason committed Sep 25, 2008
1 parent ad1e912 commit a476fbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5036f53868ae943704ae69a192d21225dc914c35
refs/heads/master: 2db04966ae9a3eeb57f28df9aac4e77d5b287cb1
3 changes: 3 additions & 0 deletions trunk/fs/btrfs/compat.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/pagevec.h>
#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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a476fbc

Please sign in to comment.