Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 172ddd60 authored by David Sterba's avatar David Sterba
Browse files

btrfs: drop gfp parameter from alloc_extent_map



pass GFP_NOFS directly to kmem_cache_alloc

Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent a8067e02
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ static struct extent_map *btree_get_extent(struct inode *inode,
	}
	}
	read_unlock(&em_tree->lock);
	read_unlock(&em_tree->lock);


	em = alloc_extent_map(GFP_NOFS);
	em = alloc_extent_map();
	if (!em) {
	if (!em) {
		em = ERR_PTR(-ENOMEM);
		em = ERR_PTR(-ENOMEM);
		goto out;
		goto out;
+1 −1
Original line number Original line Diff line number Diff line
@@ -6694,7 +6694,7 @@ static noinline int relocate_data_extent(struct inode *reloc_inode,
	u64 start = extent_key->objectid - offset;
	u64 start = extent_key->objectid - offset;
	u64 end = start + extent_key->offset - 1;
	u64 end = start + extent_key->offset - 1;


	em = alloc_extent_map(GFP_NOFS);
	em = alloc_extent_map();
	BUG_ON(!em);
	BUG_ON(!em);


	em->start = start;
	em->start = start;
+2 −3
Original line number Original line Diff line number Diff line
@@ -40,16 +40,15 @@ void extent_map_tree_init(struct extent_map_tree *tree)


/**
/**
 * alloc_extent_map - allocate new extent map structure
 * alloc_extent_map - allocate new extent map structure
 * @mask:	memory allocation flags
 *
 *
 * Allocate a new extent_map structure.  The new structure is
 * Allocate a new extent_map structure.  The new structure is
 * returned with a reference count of one and needs to be
 * returned with a reference count of one and needs to be
 * freed using free_extent_map()
 * freed using free_extent_map()
 */
 */
struct extent_map *alloc_extent_map(gfp_t mask)
struct extent_map *alloc_extent_map(void)
{
{
	struct extent_map *em;
	struct extent_map *em;
	em = kmem_cache_alloc(extent_map_cache, mask);
	em = kmem_cache_alloc(extent_map_cache, GFP_NOFS);
	if (!em)
	if (!em)
		return NULL;
		return NULL;
	em->in_tree = 0;
	em->in_tree = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@ int add_extent_mapping(struct extent_map_tree *tree,
		       struct extent_map *em);
		       struct extent_map *em);
int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);


struct extent_map *alloc_extent_map(gfp_t mask);
struct extent_map *alloc_extent_map(void);
void free_extent_map(struct extent_map *em);
void free_extent_map(struct extent_map *em);
int __init extent_map_init(void);
int __init extent_map_init(void);
void extent_map_exit(void);
void extent_map_exit(void);
+2 −2
Original line number Original line Diff line number Diff line
@@ -191,9 +191,9 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
	}
	}
	while (1) {
	while (1) {
		if (!split)
		if (!split)
			split = alloc_extent_map(GFP_NOFS);
			split = alloc_extent_map();
		if (!split2)
		if (!split2)
			split2 = alloc_extent_map(GFP_NOFS);
			split2 = alloc_extent_map();
		BUG_ON(!split || !split2);
		BUG_ON(!split || !split2);


		write_lock(&em_tree->lock);
		write_lock(&em_tree->lock);
Loading