diff options
author | David Sterba <dsterba@suse.com> | 2017-05-31 13:32:09 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 12:26:02 -0400 |
commit | f54de068dda73e337972481eabd103671859b2aa (patch) | |
tree | 3233b63f1cbe19b8cb6506ca12a97513f47545aa /fs/btrfs | |
parent | de2491fdefe7e599fa08a81a1b89d03c96c9cbc3 (diff) |
btrfs: use GFP_KERNEL in init_ipath
Now that init_ipath is called either from a safe context or with
memalloc_nofs protection, we can switch to GFP_KERNEL allocations in
init_path and init_data_container.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/backref.c | 10 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 24865da63d8f..f723c11bb763 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * Boston, MA 021110-1307, USA. | 16 | * Boston, MA 021110-1307, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/vmalloc.h> | 19 | #include <linux/mm.h> |
20 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
21 | #include "ctree.h" | 21 | #include "ctree.h" |
22 | #include "disk-io.h" | 22 | #include "disk-io.h" |
@@ -2305,7 +2305,7 @@ struct btrfs_data_container *init_data_container(u32 total_bytes) | |||
2305 | size_t alloc_bytes; | 2305 | size_t alloc_bytes; |
2306 | 2306 | ||
2307 | alloc_bytes = max_t(size_t, total_bytes, sizeof(*data)); | 2307 | alloc_bytes = max_t(size_t, total_bytes, sizeof(*data)); |
2308 | data = vmalloc(alloc_bytes); | 2308 | data = kvmalloc(alloc_bytes, GFP_KERNEL); |
2309 | if (!data) | 2309 | if (!data) |
2310 | return ERR_PTR(-ENOMEM); | 2310 | return ERR_PTR(-ENOMEM); |
2311 | 2311 | ||
@@ -2339,9 +2339,9 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, | |||
2339 | if (IS_ERR(fspath)) | 2339 | if (IS_ERR(fspath)) |
2340 | return (void *)fspath; | 2340 | return (void *)fspath; |
2341 | 2341 | ||
2342 | ifp = kmalloc(sizeof(*ifp), GFP_NOFS); | 2342 | ifp = kmalloc(sizeof(*ifp), GFP_KERNEL); |
2343 | if (!ifp) { | 2343 | if (!ifp) { |
2344 | vfree(fspath); | 2344 | kvfree(fspath); |
2345 | return ERR_PTR(-ENOMEM); | 2345 | return ERR_PTR(-ENOMEM); |
2346 | } | 2346 | } |
2347 | 2347 | ||
@@ -2356,6 +2356,6 @@ void free_ipath(struct inode_fs_paths *ipath) | |||
2356 | { | 2356 | { |
2357 | if (!ipath) | 2357 | if (!ipath) |
2358 | return; | 2358 | return; |
2359 | vfree(ipath->fspath); | 2359 | kvfree(ipath->fspath); |
2360 | kfree(ipath); | 2360 | kfree(ipath); |
2361 | } | 2361 | } |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c9cdea8061bc..e4116f9248c2 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/bit_spinlock.h> | 37 | #include <linux/bit_spinlock.h> |
38 | #include <linux/security.h> | 38 | #include <linux/security.h> |
39 | #include <linux/xattr.h> | 39 | #include <linux/xattr.h> |
40 | #include <linux/vmalloc.h> | 40 | #include <linux/mm.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/blkdev.h> | 42 | #include <linux/blkdev.h> |
43 | #include <linux/uuid.h> | 43 | #include <linux/uuid.h> |
@@ -4588,7 +4588,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info, | |||
4588 | 4588 | ||
4589 | out: | 4589 | out: |
4590 | btrfs_free_path(path); | 4590 | btrfs_free_path(path); |
4591 | vfree(inodes); | 4591 | kvfree(inodes); |
4592 | kfree(loi); | 4592 | kfree(loi); |
4593 | 4593 | ||
4594 | return ret; | 4594 | return ret; |