aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-06-22 03:13:02 +0200
committerDavid Sterba <dsterba@suse.com>2017-07-20 17:15:53 +0200
commit2f491c90b18433b187454427ef8421b37ef7019d (patch)
tree3ae5b496f8ae1dd544123760e2cb700d81f29f03 /fs
parentfb8d42e1ca2fc04a3f935a3b932fa6f33a1e7c42 (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')
-rw-r--r--fs/btrfs/ioctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index fa1b78cf25f6..d260c4c57338 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1308,7 +1308,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);
@@ -1316,8 +1316,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;