linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] ext4: remove unnecessary var in ext4_ext_insert_extent
@ 2011-11-17  2:03 Yongqiang Yang
  2011-11-17  2:03 ` [PATCH 2/6] ext4: remove useless BUG_ON " Yongqiang Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Yongqiang Yang @ 2011-11-17  2:03 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, Yongqiang Yang

Var(uninitialized) is not necessary.  As the comment says,
two extent are either initialized or uninitialized.  So
checking newext is ok.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
 fs/ext4/extents.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 61fa9e1..6b4a558 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1665,7 +1665,6 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
 	struct ext4_ext_path *npath = NULL;
 	int depth, len, err;
 	ext4_lblk_t next;
-	unsigned uninitialized = 0;
 	int flags = 0;
 
 	if (unlikely(ext4_ext_get_actual_len(newext) == 0)) {
@@ -1698,11 +1697,9 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
 		 * both extents are uninitialized, or both aren't. Thus we
 		 * need to check only one of them here.
 		 */
-		if (ext4_ext_is_uninitialized(ex))
-			uninitialized = 1;
 		ex->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex)
 					+ ext4_ext_get_actual_len(newext));
-		if (uninitialized)
+		if (ext4_ext_is_uninitialized(newext))
 			ext4_ext_mark_uninitialized(ex);
 		eh = path[depth].p_hdr;
 		nearex = ex;
-- 
1.7.5.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-02  1:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  2:03 [PATCH 1/6] ext4: remove unnecessary var in ext4_ext_insert_extent Yongqiang Yang
2011-11-17  2:03 ` [PATCH 2/6] ext4: remove useless BUG_ON " Yongqiang Yang
2011-11-17  2:03 ` [PATCH 3/6] ext4: correct comment on extent merging " Yongqiang Yang
2011-11-17  2:03 ` [PATCH 4/6] ext4: remove code related to punching hole from ext4_ext_insert_extent Yongqiang Yang
2011-11-17 16:56   ` Andreas Dilger
2011-11-18  3:19     ` Yongqiang Yang
2011-12-01 20:55   ` Allison Henderson
2011-12-02  1:09     ` Yongqiang Yang
2011-11-17  2:03 ` [PATCH 5/6] ext4: remove useless code in ext4_ext_split Yongqiang Yang
2011-11-17  2:03 ` [PATCH 6/6] ext4: move code checking if leaf is full to the beginning of ext4_ext_split Yongqiang Yang

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).