Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757867Ab3ENQiY (ORCPT ); Tue, 14 May 2013 12:38:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60193 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757832Ab3ENQiV (ORCPT ); Tue, 14 May 2013 12:38:21 -0400 From: Lukas Czerner To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, hughd@google.com, lczerner@redhat.com Subject: [PATCH v4 17/20] ext4: remove unused code from ext4_remove_blocks() Date: Tue, 14 May 2013 18:37:31 +0200 Message-Id: <1368549454-8930-18-git-send-email-lczerner@redhat.com> In-Reply-To: <1368549454-8930-1-git-send-email-lczerner@redhat.com> References: <1368549454-8930-1-git-send-email-lczerner@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 54 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 Reviewed-by: Jan Kara --- 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 bc0f191..18c3f1a 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2432,23 +2432,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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/