linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Jianan <huangjianan@oppo.com>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: huangjianan@oppo.com, guoweichao@oppo.com, zhangshiming@oppo.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] f2fs: remove unnecessary IS_SWAPFILE check
Date: Sat, 27 Feb 2021 20:02:29 +0800	[thread overview]
Message-ID: <20210227120231.136559-1-huangjianan@oppo.com> (raw)

Now swapfile in f2fs directly submit IO to blockdev according to
swapfile extents reported by f2fs when swapon, therefore there is
no need to check IS_SWAPFILE when exec filesystem operation.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
---
 fs/f2fs/data.c | 2 +-
 fs/f2fs/f2fs.h | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b9721c8f116c..a1498a1a345c 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1723,7 +1723,7 @@ static int get_data_block_dio_write(struct inode *inode, sector_t iblock,
 	return __get_data_block(inode, iblock, bh_result, create,
 				F2FS_GET_BLOCK_DIO, NULL,
 				f2fs_rw_hint_to_seg_type(inode->i_write_hint),
-				IS_SWAPFILE(inode) ? false : true);
+				true);
 }
 
 static int get_data_block_dio(struct inode *inode, sector_t iblock,
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cccdfb1a40ab..3f65cfe11a0f 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -4176,8 +4176,7 @@ static inline bool f2fs_force_buffered_io(struct inode *inode,
 		if (F2FS_IO_ALIGNED(sbi))
 			return true;
 	}
-	if (is_sbi_flag_set(F2FS_I_SB(inode), SBI_CP_DISABLED) &&
-					!IS_SWAPFILE(inode))
+	if (is_sbi_flag_set(F2FS_I_SB(inode), SBI_CP_DISABLED))
 		return true;
 
 	return false;
-- 
2.25.1


             reply	other threads:[~2021-02-27 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27 12:02 Huang Jianan [this message]
2021-02-27 12:02 ` [PATCH 2/3] f2fs: fix last_lblock check in check_swap_activate_fast Huang Jianan
2021-03-01  2:01   ` [f2fs-dev] " Chao Yu
2021-02-27 12:02 ` [PATCH 3/3] f2fs: check if swapfile is section-alligned Huang Jianan
2021-03-01  2:41   ` [f2fs-dev] " Chao Yu
2021-03-02  4:20     ` Jaegeuk Kim
2021-03-02  4:25       ` Jaegeuk Kim
2021-03-01  1:58 ` [f2fs-dev] [PATCH 1/3] f2fs: remove unnecessary IS_SWAPFILE check Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210227120231.136559-1-huangjianan@oppo.com \
    --to=huangjianan@oppo.com \
    --cc=guoweichao@oppo.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhangshiming@oppo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).