From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 09/11] f2fs: test before set/clear bits
Date: Fri, 25 Jul 2014 15:47:23 -0700 [thread overview]
Message-ID: <1406328445-63707-9-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1406328445-63707-1-git-send-email-jaegeuk@kernel.org>
If the bit is already set, we don't need to reset it, and vice versa.
Because we don't need to make the caches dirty for that.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/f2fs.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 8f8685e..475f97c 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1003,7 +1003,8 @@ enum {
static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag)
{
- set_bit(flag, &fi->flags);
+ if (!test_bit(flag, &fi->flags))
+ set_bit(flag, &fi->flags);
}
static inline int is_inode_flag_set(struct f2fs_inode_info *fi, int flag)
@@ -1013,7 +1014,8 @@ static inline int is_inode_flag_set(struct f2fs_inode_info *fi, int flag)
static inline void clear_inode_flag(struct f2fs_inode_info *fi, int flag)
{
- clear_bit(flag, &fi->flags);
+ if (test_bit(flag, &fi->flags))
+ clear_bit(flag, &fi->flags);
}
static inline void set_acl_inode(struct f2fs_inode_info *fi, umode_t mode)
--
1.8.5.2 (Apple Git-48)
next prev parent reply other threads:[~2014-07-25 22:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 22:47 [PATCH 01/11] f2fs: add nobarrier mount option Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 02/11] f2fs: punch the core function for inode management Jaegeuk Kim
2014-07-29 11:29 ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 03/11] f2fs: add infra for ino management Jaegeuk Kim
2014-07-29 11:30 ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 04/11] f2fs: use radix_tree " Jaegeuk Kim
2014-07-29 11:32 ` [f2fs-dev] " Chao Yu
2014-07-29 12:34 ` Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 05/11] f2fs: add info of appended or updated data writes Jaegeuk Kim
2014-07-29 11:38 ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 06/11] f2fs: skip unnecessary data writes during fsync Jaegeuk Kim
2014-07-29 11:39 ` [f2fs-dev] " Chao Yu
2014-07-29 12:43 ` Jaegeuk Kim
2014-07-30 11:58 ` Chao Yu
2014-07-25 22:47 ` [PATCH 07/11] f2fs: enable in-place-update for fdatasync Jaegeuk Kim
2014-07-29 0:41 ` [f2fs-dev] " Changman Lee
2014-07-29 12:22 ` Jaegeuk Kim
2014-07-29 23:54 ` Changman Lee
2014-07-30 1:08 ` Jaegeuk Kim
2014-07-30 1:56 ` Changman Lee
2014-07-30 3:11 ` Jaegeuk Kim
2014-07-30 2:45 ` Chao Yu
2014-07-30 3:13 ` Jaegeuk Kim
2014-07-30 12:48 ` Chao Yu
2014-07-25 22:47 ` [PATCH 08/11] f2fs: fix wrong condition for unlikely Jaegeuk Kim
2014-07-30 1:44 ` [f2fs-dev] " Chao Yu
2014-07-30 3:18 ` Jaegeuk Kim
2014-07-30 12:58 ` Chao Yu
2014-07-25 22:47 ` Jaegeuk Kim [this message]
2014-07-25 22:47 ` [PATCH 10/11] f2fs: avoid checkpoint when error was occurred Jaegeuk Kim
2014-07-29 11:41 ` [f2fs-dev] " Chao Yu
2014-07-29 13:00 ` Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 11/11] f2fs: avoid retrying wrong recovery routine " Jaegeuk Kim
2014-07-29 13:01 ` [PATCH v2 " Jaegeuk Kim
2014-07-29 11:28 ` [f2fs-dev] [PATCH 01/11] f2fs: add nobarrier mount option Chao Yu
2014-07-29 12:22 ` Jaegeuk Kim
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=1406328445-63707-9-git-send-email-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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