Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit facb0205 authored by Changman Lee's avatar Changman Lee Committed by Jaegeuk Kim
Browse files

f2fs: stop repeated checking if cp is needed



If it is decided that f2fs should do checkpoint, skip next comparison.

Signed-off-by: default avatarChangman Lee <cm224.lee@samsung.com>
parent d4686d56
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -157,11 +157,11 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)


	if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
	if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
		need_cp = true;
		need_cp = true;
	if (is_inode_flag_set(F2FS_I(inode), FI_NEED_CP))
	else if (is_inode_flag_set(F2FS_I(inode), FI_NEED_CP))
		need_cp = true;
		need_cp = true;
	if (!space_for_roll_forward(sbi))
	else if (!space_for_roll_forward(sbi))
		need_cp = true;
		need_cp = true;
	if (need_to_sync_dir(sbi, inode))
	else if (need_to_sync_dir(sbi, inode))
		need_cp = true;
		need_cp = true;


	if (need_cp) {
	if (need_cp) {