From: Robin Dong Subject: [PATCH 3/8 bigalloc] ext4: remove unused functions and tags Date: Tue, 1 Nov 2011 18:53:32 +0800 Message-ID: <1320144817-16397-4-git-send-email-hao.bigrat@gmail.com> References: <1320144817-16397-1-git-send-email-hao.bigrat@gmail.com> Cc: Robin Dong To: linux-ext4@vger.kernel.org Return-path: Received: from mail-pz0-f42.google.com ([209.85.210.42]:52678 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753514Ab1KAKxv (ORCPT ); Tue, 1 Nov 2011 06:53:51 -0400 Received: by mail-pz0-f42.google.com with SMTP id 2so1043603pzk.1 for ; Tue, 01 Nov 2011 03:53:51 -0700 (PDT) In-Reply-To: <1320144817-16397-1-git-send-email-hao.bigrat@gmail.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: From: Robin Dong remove unused functions and tags. Signed-off-by: Robin Dong --- fs/ext4/extents.c | 108 ----------------------------------------------------- 1 files changed, 0 insertions(+), 108 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index c96f64f..d3866d1 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3619,111 +3619,6 @@ out2: } /* - * get_implied_cluster_alloc - check to see if the requested - * allocation (in the map structure) overlaps with a cluster already - * allocated in an extent. - * @sb The filesystem superblock structure - * @map The requested lblk->pblk mapping - * @ex The extent structure which might contain an implied - * cluster allocation - * - * This function is called by ext4_ext_map_blocks() after we failed to - * find blocks that were already in the inode's extent tree. Hence, - * we know that the beginning of the requested region cannot overlap - * the extent from the inode's extent tree. There are three cases we - * want to catch. The first is this case: - * - * |--- cluster # N--| - * |--- extent ---| |---- requested region ---| - * |==========| - * - * The second case that we need to test for is this one: - * - * |--------- cluster # N ----------------| - * |--- requested region --| |------- extent ----| - * |=======================| - * - * The third case is when the requested region lies between two extents - * within the same cluster: - * |------------- cluster # N-------------| - * |----- ex -----| |---- ex_right ----| - * |------ requested region ------| - * |================| - * - * In each of the above cases, we need to set the map->m_pblk and - * map->m_len so it corresponds to the return the extent labelled as - * "|====|" from cluster #N, since it is already in use for data in - * cluster EXT4_B2C(sbi, map->m_lblk). We will then return 1 to - * signal to ext4_ext_map_blocks() that map->m_pblk should be treated - * as a new "allocated" block region. Otherwise, we will return 0 and - * ext4_ext_map_blocks() will then allocate one or more new clusters - * by calling ext4_mb_new_blocks(). - */ -static int get_implied_cluster_alloc(struct super_block *sb, - struct ext4_map_blocks *map, - struct ext4_extent *ex, - struct ext4_ext_path *path) -{ - struct ext4_sb_info *sbi = EXT4_SB(sb); - ext4_lblk_t c_offset = map->m_lblk & (sbi->s_cluster_ratio-1); - ext4_lblk_t ex_cluster_start, ex_cluster_end; - ext4_lblk_t rr_cluster_start, rr_cluster_end; - ext4_lblk_t ee_block = le32_to_cpu(ex->ee_block); - ext4_fsblk_t ee_start = ext4_ext_pblock(ex); - unsigned int ee_len = EXT4_C2B(sbi, ext4_ext_get_actual_len(ex)); - - /* The extent passed in that we are trying to match */ - ex_cluster_start = EXT4_B2C(sbi, ee_block); - ex_cluster_end = EXT4_B2C(sbi, ee_block + ee_len - 1); - - /* The requested region passed into ext4_map_blocks() */ - rr_cluster_start = EXT4_B2C(sbi, map->m_lblk); - rr_cluster_end = EXT4_B2C(sbi, map->m_lblk + map->m_len - 1); - - if ((rr_cluster_start == ex_cluster_end) || - (rr_cluster_start == ex_cluster_start)) { - if (rr_cluster_start == ex_cluster_end) - ee_start += ee_len - 1; - map->m_pblk = (ee_start & ~(sbi->s_cluster_ratio - 1)) + - c_offset; - map->m_len = min(map->m_len, - (unsigned) sbi->s_cluster_ratio - c_offset); - /* - * Check for and handle this case: - * - * |--------- cluster # N-------------| - * |------- extent ----| - * |--- requested region ---| - * |===========| - */ - - if (map->m_lblk < ee_block) - map->m_len = min(map->m_len, ee_block - map->m_lblk); - - /* - * Check for the case where there is already another allocated - * block to the right of 'ex' but before the end of the cluster. - * - * |------------- cluster # N-------------| - * |----- ex -----| |---- ex_right ----| - * |------ requested region ------| - * |================| - */ - if (map->m_lblk > ee_block) { - ext4_lblk_t next = ext4_ext_next_allocated_block(path); - map->m_len = min(map->m_len, next - map->m_lblk); - } - - trace_ext4_get_implied_cluster_alloc_exit(sb, map, 1); - return 1; - } - - trace_ext4_get_implied_cluster_alloc_exit(sb, map, 0); - return 0; -} - - -/* * Block allocation/map/preallocation routine for extents based files * * @@ -3755,7 +3650,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, unsigned int result = 0; struct ext4_allocation_request ar; ext4_io_end_t *io = EXT4_I(inode)->cur_aio_dio; - ext4_lblk_t cluster_offset; struct ext4_map_blocks punch_map; ext_debug("blocks %u/%u requested for inode %lu\n", @@ -3963,7 +3857,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, */ map->m_flags &= ~EXT4_MAP_FROM_CLUSTER; newex.ee_block = cpu_to_le32(map->m_lblk & ~(sbi->s_cluster_ratio-1)); - cluster_offset = map->m_lblk & (sbi->s_cluster_ratio-1); if (ex) BUG_ON((le32_to_cpu(ex->ee_block) + @@ -4033,7 +3926,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, free_on_err = 1; allocated_clusters = ar.len; -got_allocated_blocks: /* try to insert new extent into found leaf and return */ ext4_ext_store_pblock(&newex, newblock); newex.ee_len = cpu_to_le16(allocated_clusters); -- 1.7.3.2