btrfs: readdir: use GFP_KERNEL
authorDavid Sterba <dsterba@suse.com>
Thu, 11 Feb 2016 13:25:38 +0000 (14:25 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Feb 2016 14:19:39 +0000 (15:19 +0100)
Readdir is initiated from userspace and is not on the critical
writeback path, we don't need to use GFP_NOFS for allocations.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 5f06eb1f43843055c0373daeb9ad98648865150f..2bd47fb228b29577d673c57d608e9d7580d024a1 100644 (file)
@@ -5788,7 +5788,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx)
                        if (name_len <= sizeof(tmp_name)) {
                                name_ptr = tmp_name;
                        } else {
-                               name_ptr = kmalloc(name_len, GFP_NOFS);
+                               name_ptr = kmalloc(name_len, GFP_KERNEL);
                                if (!name_ptr) {
                                        ret = -ENOMEM;
                                        goto err;