diff options
author | David Sterba <dsterba@suse.cz> | 2011-04-20 18:48:27 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-05-02 07:57:21 -0400 |
commit | 172ddd60a662c4d8bf2809462866ddddd6431ea5 (patch) | |
tree | fc3c82d8e20a10f77fd26de64a58c416b80b42ac /fs | |
parent | a8067e022ab54fde8953880a64572c3acca644dc (diff) |
btrfs: drop gfp parameter from alloc_extent_map
pass GFP_NOFS directly to kmem_cache_alloc
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent_map.c | 5 | ||||
-rw-r--r-- | fs/btrfs/extent_map.h | 2 | ||||
-rw-r--r-- | fs/btrfs/file.c | 4 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 12 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 2 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 4 |
8 files changed, 16 insertions, 17 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f2ee584b8efd..e1e55679d061 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -154,7 +154,7 @@ static struct extent_map *btree_get_extent(struct inode *inode, | |||
154 | } | 154 | } |
155 | read_unlock(&em_tree->lock); | 155 | read_unlock(&em_tree->lock); |
156 | 156 | ||
157 | em = alloc_extent_map(GFP_NOFS); | 157 | em = alloc_extent_map(); |
158 | if (!em) { | 158 | if (!em) { |
159 | em = ERR_PTR(-ENOMEM); | 159 | em = ERR_PTR(-ENOMEM); |
160 | goto out; | 160 | goto out; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 7cdce82e03e7..6a3d53783d55 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -6694,7 +6694,7 @@ static noinline int relocate_data_extent(struct inode *reloc_inode, | |||
6694 | u64 start = extent_key->objectid - offset; | 6694 | u64 start = extent_key->objectid - offset; |
6695 | u64 end = start + extent_key->offset - 1; | 6695 | u64 end = start + extent_key->offset - 1; |
6696 | 6696 | ||
6697 | em = alloc_extent_map(GFP_NOFS); | 6697 | em = alloc_extent_map(); |
6698 | BUG_ON(!em); | 6698 | BUG_ON(!em); |
6699 | 6699 | ||
6700 | em->start = start; | 6700 | em->start = start; |
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 3c8f374a8e2d..2d0410344ea3 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -40,16 +40,15 @@ void extent_map_tree_init(struct extent_map_tree *tree) | |||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * alloc_extent_map - allocate new extent map structure | 42 | * alloc_extent_map - allocate new extent map structure |
43 | * @mask: memory allocation flags | ||
44 | * | 43 | * |
45 | * Allocate a new extent_map structure. The new structure is | 44 | * Allocate a new extent_map structure. The new structure is |
46 | * returned with a reference count of one and needs to be | 45 | * returned with a reference count of one and needs to be |
47 | * freed using free_extent_map() | 46 | * freed using free_extent_map() |
48 | */ | 47 | */ |
49 | struct extent_map *alloc_extent_map(gfp_t mask) | 48 | struct extent_map *alloc_extent_map(void) |
50 | { | 49 | { |
51 | struct extent_map *em; | 50 | struct extent_map *em; |
52 | em = kmem_cache_alloc(extent_map_cache, mask); | 51 | em = kmem_cache_alloc(extent_map_cache, GFP_NOFS); |
53 | if (!em) | 52 | if (!em) |
54 | return NULL; | 53 | return NULL; |
55 | em->in_tree = 0; | 54 | em->in_tree = 0; |
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 255813c51b9d..33a7890b1f40 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h | |||
@@ -56,7 +56,7 @@ int add_extent_mapping(struct extent_map_tree *tree, | |||
56 | struct extent_map *em); | 56 | struct extent_map *em); |
57 | int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); | 57 | int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); |
58 | 58 | ||
59 | struct extent_map *alloc_extent_map(gfp_t mask); | 59 | struct extent_map *alloc_extent_map(void); |
60 | void free_extent_map(struct extent_map *em); | 60 | void free_extent_map(struct extent_map *em); |
61 | int __init extent_map_init(void); | 61 | int __init extent_map_init(void); |
62 | void extent_map_exit(void); | 62 | void extent_map_exit(void); |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 83abd274370b..80eabe85409a 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -191,9 +191,9 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, | |||
191 | } | 191 | } |
192 | while (1) { | 192 | while (1) { |
193 | if (!split) | 193 | if (!split) |
194 | split = alloc_extent_map(GFP_NOFS); | 194 | split = alloc_extent_map(); |
195 | if (!split2) | 195 | if (!split2) |
196 | split2 = alloc_extent_map(GFP_NOFS); | 196 | split2 = alloc_extent_map(); |
197 | BUG_ON(!split || !split2); | 197 | BUG_ON(!split || !split2); |
198 | 198 | ||
199 | write_lock(&em_tree->lock); | 199 | write_lock(&em_tree->lock); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index f54c015cc294..26f4d56cf049 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -649,7 +649,7 @@ retry: | |||
649 | async_extent->start + | 649 | async_extent->start + |
650 | async_extent->ram_size - 1, 0); | 650 | async_extent->ram_size - 1, 0); |
651 | 651 | ||
652 | em = alloc_extent_map(GFP_NOFS); | 652 | em = alloc_extent_map(); |
653 | BUG_ON(!em); | 653 | BUG_ON(!em); |
654 | em->start = async_extent->start; | 654 | em->start = async_extent->start; |
655 | em->len = async_extent->ram_size; | 655 | em->len = async_extent->ram_size; |
@@ -826,7 +826,7 @@ static noinline int cow_file_range(struct inode *inode, | |||
826 | (u64)-1, &ins, 1); | 826 | (u64)-1, &ins, 1); |
827 | BUG_ON(ret); | 827 | BUG_ON(ret); |
828 | 828 | ||
829 | em = alloc_extent_map(GFP_NOFS); | 829 | em = alloc_extent_map(); |
830 | BUG_ON(!em); | 830 | BUG_ON(!em); |
831 | em->start = start; | 831 | em->start = start; |
832 | em->orig_start = em->start; | 832 | em->orig_start = em->start; |
@@ -1177,7 +1177,7 @@ out_check: | |||
1177 | struct extent_map *em; | 1177 | struct extent_map *em; |
1178 | struct extent_map_tree *em_tree; | 1178 | struct extent_map_tree *em_tree; |
1179 | em_tree = &BTRFS_I(inode)->extent_tree; | 1179 | em_tree = &BTRFS_I(inode)->extent_tree; |
1180 | em = alloc_extent_map(GFP_NOFS); | 1180 | em = alloc_extent_map(); |
1181 | BUG_ON(!em); | 1181 | BUG_ON(!em); |
1182 | em->start = cur_offset; | 1182 | em->start = cur_offset; |
1183 | em->orig_start = em->start; | 1183 | em->orig_start = em->start; |
@@ -5069,7 +5069,7 @@ again: | |||
5069 | else | 5069 | else |
5070 | goto out; | 5070 | goto out; |
5071 | } | 5071 | } |
5072 | em = alloc_extent_map(GFP_NOFS); | 5072 | em = alloc_extent_map(); |
5073 | if (!em) { | 5073 | if (!em) { |
5074 | err = -ENOMEM; | 5074 | err = -ENOMEM; |
5075 | goto out; | 5075 | goto out; |
@@ -5382,7 +5382,7 @@ struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *pag | |||
5382 | u64 hole_start = start; | 5382 | u64 hole_start = start; |
5383 | u64 hole_len = len; | 5383 | u64 hole_len = len; |
5384 | 5384 | ||
5385 | em = alloc_extent_map(GFP_NOFS); | 5385 | em = alloc_extent_map(); |
5386 | if (!em) { | 5386 | if (!em) { |
5387 | err = -ENOMEM; | 5387 | err = -ENOMEM; |
5388 | goto out; | 5388 | goto out; |
@@ -5483,7 +5483,7 @@ static struct extent_map *btrfs_new_extent_direct(struct inode *inode, | |||
5483 | } | 5483 | } |
5484 | 5484 | ||
5485 | if (!em) { | 5485 | if (!em) { |
5486 | em = alloc_extent_map(GFP_NOFS); | 5486 | em = alloc_extent_map(); |
5487 | if (!em) { | 5487 | if (!em) { |
5488 | em = ERR_PTR(-ENOMEM); | 5488 | em = ERR_PTR(-ENOMEM); |
5489 | goto out; | 5489 | goto out; |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index f3edf45317bc..2097a88f60aa 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2870,7 +2870,7 @@ int setup_extent_mapping(struct inode *inode, u64 start, u64 end, | |||
2870 | struct extent_map *em; | 2870 | struct extent_map *em; |
2871 | int ret = 0; | 2871 | int ret = 0; |
2872 | 2872 | ||
2873 | em = alloc_extent_map(GFP_NOFS); | 2873 | em = alloc_extent_map(); |
2874 | if (!em) | 2874 | if (!em) |
2875 | return -ENOMEM; | 2875 | return -ENOMEM; |
2876 | 2876 | ||
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 15d7dc943c9b..76acd1d235e4 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2609,7 +2609,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, | |||
2609 | 2609 | ||
2610 | trace_btrfs_chunk_alloc(info->chunk_root, map, start, *num_bytes); | 2610 | trace_btrfs_chunk_alloc(info->chunk_root, map, start, *num_bytes); |
2611 | 2611 | ||
2612 | em = alloc_extent_map(GFP_NOFS); | 2612 | em = alloc_extent_map(); |
2613 | if (!em) { | 2613 | if (!em) { |
2614 | ret = -ENOMEM; | 2614 | ret = -ENOMEM; |
2615 | goto error; | 2615 | goto error; |
@@ -3499,7 +3499,7 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key, | |||
3499 | free_extent_map(em); | 3499 | free_extent_map(em); |
3500 | } | 3500 | } |
3501 | 3501 | ||
3502 | em = alloc_extent_map(GFP_NOFS); | 3502 | em = alloc_extent_map(); |
3503 | if (!em) | 3503 | if (!em) |
3504 | return -ENOMEM; | 3504 | return -ENOMEM; |
3505 | num_stripes = btrfs_chunk_num_stripes(leaf, chunk); | 3505 | num_stripes = btrfs_chunk_num_stripes(leaf, chunk); |