linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Dong <hao.bigrat@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Robin Dong <sanbai@taobao.com>
Subject: [PATCH 3/8 bigalloc] ext4: remove unused functions and tags
Date: Tue,  1 Nov 2011 18:53:32 +0800	[thread overview]
Message-ID: <1320144817-16397-4-git-send-email-hao.bigrat@gmail.com> (raw)
In-Reply-To: <1320144817-16397-1-git-send-email-hao.bigrat@gmail.com>

From: Robin Dong <sanbai@taobao.com>

remove unused functions and tags.

Signed-off-by: Robin Dong <sanbai@taobao.com>
---
 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


  parent reply	other threads:[~2011-11-01 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 10:53 [PATCH 0/8 bigalloc] ext4: change unit of extent's ee_len from block to cluster Robin Dong
2011-11-01 10:53 ` [PATCH 1/8 bigalloc] ext4: get blocks from ext4_ext_get_actual_len Robin Dong
2011-11-02 18:29   ` Andreas Dilger
2011-11-03  8:50     ` Yongqiang Yang
2011-11-03 17:57       ` Andreas Dilger
2011-11-01 10:53 ` [PATCH 2/8 bigalloc] ext4: change ext4_ext_map_blocks to allocate clusters instead of blocks Robin Dong
2011-11-01 10:53 ` Robin Dong [this message]
2011-11-01 10:53 ` [PATCH 4/8 bigalloc] ext4: zeroout extra pages when users write one page Robin Dong
2011-11-01 10:53 ` [PATCH 5/8 bigalloc] ext4: zero out extra pages when truncate file Robin Dong
2011-11-01 10:53 ` [PATCH 6/8 bigalloc] ext4: directories allocate a cluster when it need spaces Robin Dong
2011-11-01 10:53 ` [PATCH 7/8 bigalloc] ext4: align fallocate size to a whole cluster Robin Dong
2011-11-01 10:53 ` [PATCH 8/8 bigalloc] ext4: make cluster works for mmap Robin Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320144817-16397-4-git-send-email-hao.bigrat@gmail.com \
    --to=hao.bigrat@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sanbai@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).