aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2012-09-26 21:09:06 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-09-26 21:09:06 -0400
commit63fedaf1c2dd546da22ff5b4ae06e9b4efba5146 (patch)
tree062e09a27c29554c67641fe41150213f00f2b1ba /fs/ext4
parent85556c9a503ababa889bd7bb7a9b3effba795d00 (diff)
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(). Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c48
1 files changed, 9 insertions, 39 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a510917c175..cbcc6b3f2ae 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2136,13 +2136,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
2136} 2136}
2137 2137
2138/* 2138/*
2139 * ext4_ext_check_cache() 2139 * ext4_ext_in_cache()
2140 * Checks to see if the given block is in the cache. 2140 * Checks to see if the given block is in the cache.
2141 * If it is, the cached extent is stored in the given 2141 * If it is, the cached extent is stored in the given
2142 * cache extent pointer. If the cached extent is a hole, 2142 * cache extent pointer.
2143 * this routine should be used instead of
2144 * ext4_ext_in_cache if the calling function needs to
2145 * know the size of the hole.
2146 * 2143 *
2147 * @inode: The files inode 2144 * @inode: The files inode
2148 * @block: The block to look for in the cache 2145 * @block: The block to look for in the cache
@@ -2151,8 +2148,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
2151 * 2148 *
2152 * Return 0 if cache is invalid; 1 if the cache is valid 2149 * Return 0 if cache is invalid; 1 if the cache is valid
2153 */ 2150 */
2154static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block, 2151static int
2155 struct ext4_ext_cache *ex){ 2152ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
2153 struct ext4_extent *ex)
2154{
2156 struct ext4_ext_cache *cex; 2155 struct ext4_ext_cache *cex;
2157 struct ext4_sb_info *sbi; 2156 struct ext4_sb_info *sbi;
2158 int ret = 0; 2157 int ret = 0;
@@ -2169,7 +2168,9 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
2169 goto errout; 2168 goto errout;
2170 2169
2171 if (in_range(block, cex->ec_block, cex->ec_len)) { 2170 if (in_range(block, cex->ec_block, cex->ec_len)) {
2172 memcpy(ex, cex, sizeof(struct ext4_ext_cache)); 2171 ex->ee_block = cpu_to_le32(cex->ec_block);
2172 ext4_ext_store_pblock(ex, cex->ec_start);
2173 ex->ee_len = cpu_to_le16(cex->ec_len);
2173 ext_debug("%u cached by %u:%u:%llu\n", 2174 ext_debug("%u cached by %u:%u:%llu\n",
2174 block, 2175 block,
2175 cex->ec_block, cex->ec_len, cex->ec_start); 2176 cex->ec_block, cex->ec_len, cex->ec_start);
@@ -2182,37 +2183,6 @@ errout:
2182} 2183}
2183 2184
2184/* 2185/*
2185 * ext4_ext_in_cache()
2186 * Checks to see if the given block is in the cache.
2187 * If it is, the cached extent is stored in the given
2188 * extent pointer.
2189 *
2190 * @inode: The files inode
2191 * @block: The block to look for in the cache
2192 * @ex: Pointer where the cached extent will be stored
2193 * if it contains block
2194 *
2195 * Return 0 if cache is invalid; 1 if the cache is valid
2196 */
2197static int
2198ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
2199 struct ext4_extent *ex)
2200{
2201 struct ext4_ext_cache cex;
2202 int ret = 0;
2203
2204 if (ext4_ext_check_cache(inode, block, &cex)) {
2205 ex->ee_block = cpu_to_le32(cex.ec_block);
2206 ext4_ext_store_pblock(ex, cex.ec_start);
2207 ex->ee_len = cpu_to_le16(cex.ec_len);
2208 ret = 1;
2209 }
2210
2211 return ret;
2212}
2213
2214
2215/*
2216 * ext4_ext_rm_idx: 2186 * ext4_ext_rm_idx:
2217 * removes index from the index block. 2187 * removes index from the index block.
2218 */ 2188 */