diff options
author | David Sterba <dsterba@suse.com> | 2017-06-22 03:13:02 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-08-16 16:12:03 +0200 |
commit | 63e727ecd238be2281156f2f0d5d7ad593d14ee8 (patch) | |
tree | febe05ec1937ec44f2d3aecb916e8ee53e2a9585 /fs/btrfs/ioctl.c | |
parent | 3ec836211183eee87609f832a949dfe711af2b5a (diff) |
btrfs: use GFP_KERNEL in btrfs_defrag_file
We can safely use GFP_KERNEL, the function is called from two contexts:
- ioctl handler, called directly, no locks taken
- cleaner thread, running all queued defrag work, outside of any locks
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3e744dd17ac5..4d1b07b81549 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1277,7 +1277,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, * context */ if (!file) { - ra = kzalloc(sizeof(*ra), GFP_NOFS); + ra = kzalloc(sizeof(*ra), GFP_KERNEL); if (!ra) return -ENOMEM; file_ra_state_init(ra, inode->i_mapping); @@ -1285,8 +1285,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, ra = &file->f_ra; } - pages = kmalloc_array(max_cluster, sizeof(struct page *), - GFP_NOFS); + pages = kmalloc_array(max_cluster, sizeof(struct page *), GFP_KERNEL); if (!pages) { ret = -ENOMEM; goto out_ra; |