Skip to content

Commit 3ec8362

Browse files
committed
btrfs: use GFP_KERNEL in mount and remount
We don't need to restrict the allocation flags in btrfs_mount or _remount. No big filesystem locks are held (possibly s_umount but that does no count here). Signed-off-by: David Sterba <dsterba@suse.com>
1 parent e3f3ad1 commit 3ec8362

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎fs/btrfs/super.c‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
426426
* strsep changes the string, duplicate it because parse_options
427427
* gets called twice
428428
*/
429-
options = kstrdup(options, GFP_NOFS);
429+
options = kstrdup(options, GFP_KERNEL);
430430
if (!options)
431431
return -ENOMEM;
432432

@@ -950,7 +950,7 @@ static char *get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
950950
}
951951
path->leave_spinning = 1;
952952

953-
name = kmalloc(PATH_MAX, GFP_NOFS);
953+
name = kmalloc(PATH_MAX, GFP_KERNEL);
954954
if (!name) {
955955
ret = -ENOMEM;
956956
goto err;
@@ -1336,10 +1336,11 @@ static char *setup_root_args(char *args)
13361336
char *buf, *dst, *sep;
13371337

13381338
if (!args)
1339-
return kstrdup("subvolid=0", GFP_NOFS);
1339+
return kstrdup("subvolid=0", GFP_KERNEL);
13401340

13411341
/* The worst case is that we add ",subvolid=0" to the end. */
1342-
buf = dst = kmalloc(strlen(args) + strlen(",subvolid=0") + 1, GFP_NOFS);
1342+
buf = dst = kmalloc(strlen(args) + strlen(",subvolid=0") + 1,
1343+
GFP_KERNEL);
13431344
if (!buf)
13441345
return NULL;
13451346

@@ -1568,16 +1569,16 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
15681569
* it for searching for existing supers, so this lets us do that and
15691570
* then open_ctree will properly initialize everything later.
15701571
*/
1571-
fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_NOFS);
1572+
fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
15721573
if (!fs_info) {
15731574
error = -ENOMEM;
15741575
goto error_sec_opts;
15751576
}
15761577

15771578
fs_info->fs_devices = fs_devices;
15781579

1579-
fs_info->super_copy = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_NOFS);
1580-
fs_info->super_for_commit = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_NOFS);
1580+
fs_info->super_copy = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
1581+
fs_info->super_for_commit = kzalloc(BTRFS_SUPER_INFO_SIZE, GFP_KERNEL);
15811582
security_init_mnt_opts(&fs_info->security_opts);
15821583
if (!fs_info->super_copy || !fs_info->super_for_commit) {
15831584
error = -ENOMEM;

0 commit comments

Comments
 (0)