linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unused function ext4_ext_check_cache
@ 2012-09-12 13:52 Lukas Czerner
  2012-09-12 17:17 ` Carlos Maiolino
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukas Czerner @ 2012-09-12 13:52 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Lukas Czerner

Remove unused function ext4_ext_check_cache() and merge the code back to
the ext4_ext_in_cache().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/extents.c |   48 +++++++++---------------------------------------
 1 files changed, 9 insertions(+), 39 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index aabbb3f..d635dd6 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2092,13 +2092,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
 }
 
 /*
- * ext4_ext_check_cache()
+ * ext4_ext_in_cache()
  * Checks to see if the given block is in the cache.
  * If it is, the cached extent is stored in the given
- * cache extent pointer.  If the cached extent is a hole,
- * this routine should be used instead of
- * ext4_ext_in_cache if the calling function needs to
- * know the size of the hole.
+ * cache extent pointer.
  *
  * @inode: The files inode
  * @block: The block to look for in the cache
@@ -2107,8 +2104,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
  *
  * Return 0 if cache is invalid; 1 if the cache is valid
  */
-static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
-	struct ext4_ext_cache *ex){
+static int
+ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
+			struct ext4_extent *ex)
+{
 	struct ext4_ext_cache *cex;
 	struct ext4_sb_info *sbi;
 	int ret = 0;
@@ -2125,7 +2124,9 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
 		goto errout;
 
 	if (in_range(block, cex->ec_block, cex->ec_len)) {
-		memcpy(ex, cex, sizeof(struct ext4_ext_cache));
+		ex->ee_block = cpu_to_le32(cex->ec_block);
+		ext4_ext_store_pblock(ex, cex->ec_start);
+		ex->ee_len = cpu_to_le16(cex->ec_len);
 		ext_debug("%u cached by %u:%u:%llu\n",
 				block,
 				cex->ec_block, cex->ec_len, cex->ec_start);
@@ -2138,37 +2139,6 @@ errout:
 }
 
 /*
- * ext4_ext_in_cache()
- * Checks to see if the given block is in the cache.
- * If it is, the cached extent is stored in the given
- * extent pointer.
- *
- * @inode: The files inode
- * @block: The block to look for in the cache
- * @ex:    Pointer where the cached extent will be stored
- *         if it contains block
- *
- * Return 0 if cache is invalid; 1 if the cache is valid
- */
-static int
-ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
-			struct ext4_extent *ex)
-{
-	struct ext4_ext_cache cex;
-	int ret = 0;
-
-	if (ext4_ext_check_cache(inode, block, &cex)) {
-		ex->ee_block = cpu_to_le32(cex.ec_block);
-		ext4_ext_store_pblock(ex, cex.ec_start);
-		ex->ee_len = cpu_to_le16(cex.ec_len);
-		ret = 1;
-	}
-
-	return ret;
-}
-

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

* Re: [PATCH] ext4: remove unused function ext4_ext_check_cache
  2012-09-12 13:52 [PATCH] ext4: remove unused function ext4_ext_check_cache Lukas Czerner
@ 2012-09-12 17:17 ` Carlos Maiolino
  2012-09-26 19:46 ` Lukáš Czerner
  2012-09-27  1:08 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2012-09-12 17:17 UTC (permalink / raw)
  To: linux-ext4

On Wed, Sep 12, 2012 at 09:52:41AM -0400, Lukas Czerner wrote:
> Remove unused function ext4_ext_check_cache() and merge the code back to
> the ext4_ext_in_cache().
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---

Looks good to me.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
-- 
--Carlos

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

* Re: [PATCH] ext4: remove unused function ext4_ext_check_cache
  2012-09-12 13:52 [PATCH] ext4: remove unused function ext4_ext_check_cache Lukas Czerner
  2012-09-12 17:17 ` Carlos Maiolino
@ 2012-09-26 19:46 ` Lukáš Czerner
  2012-09-27  1:08 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Lukáš Czerner @ 2012-09-26 19:46 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4, tytso

On Wed, 12 Sep 2012, Lukas Czerner wrote:

> Date: Wed, 12 Sep 2012 09:52:41 -0400
> From: Lukas Czerner <lczerner@redhat.com>
> To: linux-ext4@vger.kernel.org
> Cc: tytso@mit.edu, Lukas Czerner <lczerner@redhat.com>
> Subject: [PATCH] ext4: remove unused function ext4_ext_check_cache
> 
> Remove unused function ext4_ext_check_cache() and merge the code back to
> the ext4_ext_in_cache().

ping

> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
>  fs/ext4/extents.c |   48 +++++++++---------------------------------------
>  1 files changed, 9 insertions(+), 39 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index aabbb3f..d635dd6 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2092,13 +2092,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
>  }
>  
>  /*
> - * ext4_ext_check_cache()
> + * ext4_ext_in_cache()
>   * Checks to see if the given block is in the cache.
>   * If it is, the cached extent is stored in the given
> - * cache extent pointer.  If the cached extent is a hole,
> - * this routine should be used instead of
> - * ext4_ext_in_cache if the calling function needs to
> - * know the size of the hole.
> + * cache extent pointer.
>   *
>   * @inode: The files inode
>   * @block: The block to look for in the cache
> @@ -2107,8 +2104,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
>   *
>   * Return 0 if cache is invalid; 1 if the cache is valid
>   */
> -static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
> -	struct ext4_ext_cache *ex){
> +static int
> +ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
> +			struct ext4_extent *ex)
> +{
>  	struct ext4_ext_cache *cex;
>  	struct ext4_sb_info *sbi;
>  	int ret = 0;
> @@ -2125,7 +2124,9 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
>  		goto errout;
>  
>  	if (in_range(block, cex->ec_block, cex->ec_len)) {
> -		memcpy(ex, cex, sizeof(struct ext4_ext_cache));
> +		ex->ee_block = cpu_to_le32(cex->ec_block);
> +		ext4_ext_store_pblock(ex, cex->ec_start);
> +		ex->ee_len = cpu_to_le16(cex->ec_len);
>  		ext_debug("%u cached by %u:%u:%llu\n",
>  				block,
>  				cex->ec_block, cex->ec_len, cex->ec_start);
> @@ -2138,37 +2139,6 @@ errout:
>  }
>  
>  /*
> - * ext4_ext_in_cache()
> - * Checks to see if the given block is in the cache.
> - * If it is, the cached extent is stored in the given
> - * extent pointer.
> - *
> - * @inode: The files inode
> - * @block: The block to look for in the cache
> - * @ex:    Pointer where the cached extent will be stored
> - *         if it contains block
> - *
> - * Return 0 if cache is invalid; 1 if the cache is valid
> - */
> -static int
> -ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
> -			struct ext4_extent *ex)
> -{
> -	struct ext4_ext_cache cex;
> -	int ret = 0;
> -
> -	if (ext4_ext_check_cache(inode, block, &cex)) {
> -		ex->ee_block = cpu_to_le32(cex.ec_block);
> -		ext4_ext_store_pblock(ex, cex.ec_start);
> -		ex->ee_len = cpu_to_le16(cex.ec_len);
> -		ret = 1;
> -	}
> -
> -	return ret;
> -}
> -
> -
> -/*
>   * ext4_ext_rm_idx:
>   * removes index from the index block.
>   */
> 

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

* Re: [PATCH] ext4: remove unused function ext4_ext_check_cache
  2012-09-12 13:52 [PATCH] ext4: remove unused function ext4_ext_check_cache Lukas Czerner
  2012-09-12 17:17 ` Carlos Maiolino
  2012-09-26 19:46 ` Lukáš Czerner
@ 2012-09-27  1:08 ` Theodore Ts'o
  2 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2012-09-27  1:08 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4

On Wed, Sep 12, 2012 at 09:52:41AM -0400, Lukas Czerner wrote:
> Remove unused function ext4_ext_check_cache() and merge the code back to
> the ext4_ext_in_cache().
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Applied, thanks!

					- Ted

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

end of thread, other threads:[~2012-09-27  1:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12 13:52 [PATCH] ext4: remove unused function ext4_ext_check_cache Lukas Czerner
2012-09-12 17:17 ` Carlos Maiolino
2012-09-26 19:46 ` Lukáš Czerner
2012-09-27  1:08 ` Theodore Ts'o

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