Patchwork [1/2] ext4: remove redundant goto tag "repeat"

login
register
mail settings
Submitter Robin Dong
Date June 30, 2011, 8:03 a.m.
Message ID <1309421014-6148-1-git-send-email-sanbai@taobao.com>
Download mbox | patch
Permalink /patch/102715/
State Accepted
Headers show

Comments

Robin Dong - June 30, 2011, 8:03 a.m.
If eh->eh_entries is smaller than eh->eh_max, the routine will
go to the "repeat" and then go to "has_space" directlly ,
since argument "depth" and "eh" are not even changed.

Therefore, goto "has_space" directly and remove redundant "repeat" tag.

Signed-off-by: Robin Dong <sanbai@taobao.com>
---
 fs/ext4/extents.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Lukas Czerner - June 30, 2011, 11:56 a.m.
On Thu, 30 Jun 2011, Robin Dong wrote:

> If eh->eh_entries is smaller than eh->eh_max, the routine will
> go to the "repeat" and then go to "has_space" directlly ,
> since argument "depth" and "eh" are not even changed.
> 
> Therefore, goto "has_space" directly and remove redundant "repeat" tag.

The patch looks good. Thanks!

-Lukas

> 
> Signed-off-by: Robin Dong <sanbai@taobao.com>
> ---
>  fs/ext4/extents.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index eb63c7b..dc5ef91 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -1758,7 +1758,6 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
>  		goto merge;
>  	}
>  
> -repeat:
>  	depth = ext_depth(inode);
>  	eh = path[depth].p_hdr;
>  	if (le16_to_cpu(eh->eh_entries) < le16_to_cpu(eh->eh_max))
> @@ -1780,7 +1779,7 @@ repeat:
>  			ext_debug("next leaf isn't full(%d)\n",
>  				  le16_to_cpu(eh->eh_entries));
>  			path = npath;
> -			goto repeat;
> +			goto has_space;
>  		}
>  		ext_debug("next leaf has no free space(%d,%d)\n",
>  			  le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max));
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - July 11, 2011, 3:45 p.m.
On Thu, Jun 30, 2011 at 04:03:33PM +0800, Robin Dong wrote:
> If eh->eh_entries is smaller than eh->eh_max, the routine will
> go to the "repeat" and then go to "has_space" directlly ,
> since argument "depth" and "eh" are not even changed.
> 
> Therefore, goto "has_space" directly and remove redundant "repeat" tag.
> 
> Signed-off-by: Robin Dong <sanbai@taobao.com>

Thanks, added to the ext4 tree.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index eb63c7b..dc5ef91 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1758,7 +1758,6 @@  int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
 		goto merge;
 	}
 
-repeat:
 	depth = ext_depth(inode);
 	eh = path[depth].p_hdr;
 	if (le16_to_cpu(eh->eh_entries) < le16_to_cpu(eh->eh_max))
@@ -1780,7 +1779,7 @@  repeat:
 			ext_debug("next leaf isn't full(%d)\n",
 				  le16_to_cpu(eh->eh_entries));
 			path = npath;
-			goto repeat;
+			goto has_space;
 		}
 		ext_debug("next leaf has no free space(%d,%d)\n",
 			  le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max));