From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 998237F92 for ; Fri, 1 Feb 2013 04:44:25 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7A3268F8049 for ; Fri, 1 Feb 2013 02:44:25 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id FYOVZfad25zvoQ5A for ; Fri, 01 Feb 2013 02:44:24 -0800 (PST) From: Lukas Czerner Subject: [PATCH 15/18] ext4: remove unused code from ext4_remove_blocks() Date: Fri, 1 Feb 2013 11:43:41 +0100 Message-Id: <1359715424-32318-16-git-send-email-lczerner@redhat.com> In-Reply-To: <1359715424-32318-1-git-send-email-lczerner@redhat.com> References: <1359715424-32318-1-git-send-email-lczerner@redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, Lukas Czerner , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com The "head removal" branch in the condition is never used in any code path in ext4 since the function only caller ext4_ext_rm_leaf() will make sure that the extent is properly split before removing blocks. Note that there is a bug in this branch anyway. This commit removes the unused code completely and makes use of ext4_error() instead of printk if dubious range is provided. Signed-off-by: Lukas Czerner --- fs/ext4/extents.c | 21 ++++----------------- 1 files changed, 4 insertions(+), 17 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 7b44dc1..966a09e 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2414,23 +2414,10 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode, *partial_cluster = EXT4_B2C(sbi, pblk); else *partial_cluster = 0; - } else if (from == le32_to_cpu(ex->ee_block) - && to <= le32_to_cpu(ex->ee_block) + ee_len - 1) { - /* head removal */ - ext4_lblk_t num; - ext4_fsblk_t start; - - num = to - from; - start = ext4_ext_pblock(ex); - - ext_debug("free first %u blocks starting %llu\n", num, start); - ext4_free_blocks(handle, inode, NULL, start, num, flags); - - } else { - printk(KERN_INFO "strange request: removal(2) " - "%u-%u from %u:%u\n", - from, to, le32_to_cpu(ex->ee_block), ee_len); - } + } else + ext4_error(sbi->s_sb, "strange request: removal(2) " + "%u-%u from %u:%u\n", + from, to, le32_to_cpu(ex->ee_block), ee_len); return 0; } -- 1.7.7.6 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs