]> git.karo-electronics.de Git - linux-beck.git/commitdiff
f2fs: clean up f2fs_ioc_write_checkpoint
authorChao Yu <chao2.yu@samsung.com>
Thu, 24 Dec 2015 10:11:32 +0000 (18:11 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 30 Dec 2015 18:14:18 +0000 (10:14 -0800)
Use f2fs_sync_fs to clean up codes in f2fs_ioc_write_checkpoint.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: remove unused err variable]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 2d87a3cf6768fcbe3b1def409528ccee9791c978..91f576a7903cfe9fdee0786c43279e37d69aea19 100644 (file)
@@ -1619,8 +1619,6 @@ static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
 {
        struct inode *inode = file_inode(filp);
        struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
-       struct cp_control cpc;
-       int err;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -1628,13 +1626,7 @@ static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
        if (f2fs_readonly(sbi->sb))
                return -EROFS;
 
-       cpc.reason = __get_cp_reason(sbi);
-
-       mutex_lock(&sbi->gc_mutex);
-       err = write_checkpoint(sbi, &cpc);
-       mutex_unlock(&sbi->gc_mutex);
-
-       return err;
+       return f2fs_sync_fs(sbi->sb, 1);
 }
 
 static int f2fs_defragment_range(struct f2fs_sb_info *sbi,