From: Colin King <colin.king@canonical.com>
To: Mike Marshall <hubcap@omnibond.com>,
Martin Brandenburg <martin@omnibond.com>,
devel@lists.orangefs.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] orangefs: remove redundant code
Date: Fri, 12 Apr 2019 11:57:33 +0100 [thread overview]
Message-ID: <20190412105733.25976-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
The check of inode->i_state & I_DIRTY_PAGES is redundant as it
just does the same actions as the following code when the condition
is false. Although it shows the intention of what to do when
I_DIRTY_PAGES is set I think removing the redunant check is preferable.
Addresses-Coverity: ("Identical code for different branches")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/orangefs/orangefs-utils.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 523e7f9fc2e9..d4b7ae763186 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -253,10 +253,6 @@ int orangefs_inode_getattr(struct inode *inode, int flags)
write_inode_now(inode, 1);
goto again;
}
- if (inode->i_state & I_DIRTY_PAGES) {
- spin_unlock(&inode->i_lock);
- return 0;
- }
spin_unlock(&inode->i_lock);
return 0;
}
--
2.20.1
reply other threads:[~2019-04-12 10:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190412105733.25976-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=devel@lists.orangefs.org \
--cc=hubcap@omnibond.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin@omnibond.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).