From: Yongqiang Yang <xiaoqiangnk@gmail.com>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org, Yongqiang Yang <xiaoqiangnk@gmail.com>
Subject: [PATCH 1/4] ext4: fold two if statements into one
Date: Wed, 26 Oct 2011 15:11:49 +0800 [thread overview]
Message-ID: <1319613112-16807-1-git-send-email-xiaoqiangnk@gmail.com> (raw)
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
fs/ext4/extents.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f1ed90b..f887023 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4082,18 +4082,17 @@ got_allocated_blocks:
*/
reserved_clusters = get_reserved_cluster_alloc(inode,
map->m_lblk, allocated);
- if (map->m_flags & EXT4_MAP_FROM_CLUSTER) {
- if (reserved_clusters) {
- /*
- * We have clusters reserved for this range.
- * But since we are not doing actual allocation
- * and are simply using blocks from previously
- * allocated cluster, we should release the
- * reservation and not claim quota.
- */
- ext4_da_update_reserve_space(inode,
- reserved_clusters, 0);
- }
+ if ((map->m_flags & EXT4_MAP_FROM_CLUSTER) &&
+ reserved_clusters) {
+ /*
+ * We have clusters reserved for this range.
+ * But since we are not doing actual allocation
+ * and are simply using blocks from previously
+ * allocated cluster, we should release the
+ * reservation and not claim quota.
+ */
+ ext4_da_update_reserve_space(inode,
+ reserved_clusters, 0);
} else {
BUG_ON(allocated_clusters < reserved_clusters);
/* We will claim quota for all newly allocated blocks.*/
--
1.7.5.1
next reply other threads:[~2011-10-26 9:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 7:11 Yongqiang Yang [this message]
2011-10-26 7:11 ` [PATCH 2/4] ext4: move variable to its scope Yongqiang Yang
2011-10-29 13:24 ` Ted Ts'o
2011-10-26 7:11 ` [PATCH 3/4] ext4: let AGGRESSIVE_TEST brace code only related to itself Yongqiang Yang
2011-10-29 13:30 ` Ted Ts'o
2011-10-26 7:11 ` [PATCH 4/4] ext4: trace punch_hole correctly in ext4_ext_map_blocks Yongqiang Yang
2011-10-29 13:51 ` Ted Ts'o
2011-10-29 13:14 ` [PATCH 1/4] ext4: fold two if statements into one Ted Ts'o
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=1319613112-16807-1-git-send-email-xiaoqiangnk@gmail.com \
--to=xiaoqiangnk@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).