Commit c8eb7024 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: clean up kvfree



After commit 0b6d4ca0 ("f2fs: don't return vmalloc() memory from
f2fs_kmalloc()"), f2fs_k{m,z}alloc() will not return vmalloc()'ed
memory, so clean up to use kfree() instead of kvfree() to free
vmalloc()'ed memory.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 6fcaebac
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
	return (void *)f2fs_acl;

fail:
	kvfree(f2fs_acl);
	kfree(f2fs_acl);
	return ERR_PTR(-EINVAL);
}

@@ -190,7 +190,7 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
		acl = NULL;
	else
		acl = ERR_PTR(retval);
	kvfree(value);
	kfree(value);

	return acl;
}
@@ -240,7 +240,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,

	error = f2fs_setxattr(inode, name_index, "", value, size, ipage, 0);

	kvfree(value);
	kfree(value);
	if (!error)
		set_cached_acl(inode, type, acl);

+1 −1
Original line number Diff line number Diff line
@@ -3570,7 +3570,7 @@ static void f2fs_dio_end_io(struct bio *bio)
	bio->bi_private = dio->orig_private;
	bio->bi_end_io = dio->orig_end_io;

	kvfree(dio);
	kfree(dio);

	bio_endio(bio);
}
+1 −1
Original line number Diff line number Diff line
@@ -574,7 +574,7 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi)
	list_del(&si->stat_list);
	mutex_unlock(&f2fs_stat_mutex);

	kvfree(si);
	kfree(si);
}

void __init f2fs_create_root_stats(void)
+1 −1
Original line number Diff line number Diff line
@@ -3373,7 +3373,7 @@ static int f2fs_ioc_getfslabel(struct file *filp, unsigned long arg)
				min(FSLABEL_MAX, count)))
		err = -EFAULT;

	kvfree(vbuf);
	kfree(vbuf);
	return err;
}

+2 −2
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
			"f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
	if (IS_ERR(gc_th->f2fs_gc_task)) {
		err = PTR_ERR(gc_th->f2fs_gc_task);
		kvfree(gc_th);
		kfree(gc_th);
		sbi->gc_thread = NULL;
	}
out:
@@ -165,7 +165,7 @@ void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi)
	if (!gc_th)
		return;
	kthread_stop(gc_th->f2fs_gc_task);
	kvfree(gc_th);
	kfree(gc_th);
	sbi->gc_thread = NULL;
}

Loading