ext4: remove unused function ext4_ext_check_cache
PATCH 1/1 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().
Signed-off-by Lukas Czerner <[email protected]>
--- fs/ext4/extents.c | 48 +++++++++--------------------------------------- 1 files changed, 9 insertions(+), 39 deletions(-)
fs/ext4/extents.c +9 -37
@@ -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; -} -
Quoted 5 lines · Lukas Czerner
Remove unused function
ext4_ext_check_cache()and merge the code back to theext4_ext_in_cache().Signed-off-by Lukas Czerner <[email protected]>---
Looks good to me.
Reviewed-by Carlos Maiolino <[email protected]>
Signature · 1 line
--Carlos
Quoted 8 lines · Lukas Czerner
Date: Wed, 12 Sep 2012 09:52:41 -0400
From: Lukas Czerner <[email protected]>
To: [email protected]
Cc: [email protected], Lukas Czerner <[email protected]>
Subject: [PATCH] ext4: remove unused functionext4_ext_check_cacheRemove unused function
ext4_ext_check_cache()and merge the code back to theext4_ext_in_cache().
ping
Quoted 89 lines
Signed-off-by Lukas Czerner <[email protected]>--- fs/ext4/extents.c | 48 +++++++++--------------------------------------- 1 files changed, 9 insertions(+), 39 deletions(-)fs/ext4/extents.c +9
-39@@ -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. */
Quoted 4 lines · Lukas Czerner
Remove unused function
ext4_ext_check_cache()and merge the code back to theext4_ext_in_cache().Signed-off-by Lukas Czerner <[email protected]>
Applied, thanks!
- Ted