Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lukas Czerner and committed by
Theodore Ts'o
63fedaf1 85556c9a

+9 -39
+9 -39
fs/ext4/extents.c
··· 2136 2136 } 2137 2137 2138 2138 /* 2139 - * ext4_ext_check_cache() 2139 + * ext4_ext_in_cache() 2140 2140 * Checks to see if the given block is in the cache. 2141 2141 * If it is, the cached extent is stored in the given 2142 - * cache extent pointer. If the cached extent is a hole, 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. 2142 + * cache extent pointer. 2146 2143 * 2147 2144 * @inode: The files inode 2148 2145 * @block: The block to look for in the cache ··· 2148 2151 * 2149 2152 * Return 0 if cache is invalid; 1 if the cache is valid 2150 2153 */ 2151 - static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block, 2152 - struct ext4_ext_cache *ex){ 2154 + static int 2155 + ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block, 2156 + struct ext4_extent *ex) 2157 + { 2153 2158 struct ext4_ext_cache *cex; 2154 2159 struct ext4_sb_info *sbi; 2155 2160 int ret = 0; ··· 2168 2169 goto errout; 2169 2170 2170 2171 if (in_range(block, cex->ec_block, cex->ec_len)) { 2171 - memcpy(ex, cex, sizeof(struct ext4_ext_cache)); 2172 + ex->ee_block = cpu_to_le32(cex->ec_block); 2173 + ext4_ext_store_pblock(ex, cex->ec_start); 2174 + ex->ee_len = cpu_to_le16(cex->ec_len); 2172 2175 ext_debug("%u cached by %u:%u:%llu\n", 2173 2176 block, 2174 2177 cex->ec_block, cex->ec_len, cex->ec_start); ··· 2181 2180 spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); 2182 2181 return ret; 2183 2182 } 2184 - 2185 - /* 2186 - * ext4_ext_in_cache() 2187 - * Checks to see if the given block is in the cache. 2188 - * If it is, the cached extent is stored in the given 2189 - * extent pointer. 2190 - * 2191 - * @inode: The files inode 2192 - * @block: The block to look for in the cache 2193 - * @ex: Pointer where the cached extent will be stored 2194 - * if it contains block 2195 - * 2196 - * Return 0 if cache is invalid; 1 if the cache is valid 2197 - */ 2198 - static int 2199 - ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block, 2200 - struct ext4_extent *ex) 2201 - { 2202 - struct ext4_ext_cache cex; 2203 - int ret = 0; 2204 - 2205 - if (ext4_ext_check_cache(inode, block, &cex)) { 2206 - ex->ee_block = cpu_to_le32(cex.ec_block); 2207 - ext4_ext_store_pblock(ex, cex.ec_start); 2208 - ex->ee_len = cpu_to_le16(cex.ec_len); 2209 - ret = 1; 2210 - } 2211 - 2212 - return ret; 2213 - } 2214 - 2215 2183 2216 2184 /* 2217 2185 * ext4_ext_rm_idx: