Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935242AbXHNVoX (ORCPT ); Tue, 14 Aug 2007 17:44:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757997AbXHNV0O (ORCPT ); Tue, 14 Aug 2007 17:26:14 -0400 Received: from emailhub.stusta.mhn.de ([141.84.69.5]:45837 "EHLO mailhub.stusta.mhn.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758108AbXHNV0M (ORCPT ); Tue, 14 Aug 2007 17:26:12 -0400 Date: Tue, 14 Aug 2007 23:25:56 +0200 From: Adrian Bunk To: Andrew Morton , "Martin J. Bligh" , Valerie Henson Cc: linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [-mm patch] remove fs/ext2/balloc.c:reserve_blocks() Message-ID: <20070814212556.GV18945@stusta.de> References: <20070809224254.11f42716.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20070809224254.11f42716.akpm@linux-foundation.org> User-Agent: Mutt/1.5.16 (2007-06-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1775 Lines: 64 reserve_blocks() is no longer used. Spotted by the GNU C compiler. Signed-off-by: Adrian Bunk --- fs/ext2/balloc.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) 4b64502ecee91af41888261d7392688c9283792f diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 1c57a3f..b63f6a4 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -133,41 +133,6 @@ error_out: return NULL; } -/* - * Set sb->s_dirt here because the superblock was "logically" altered. We - * need to recalculate its free blocks count and flush it out. - */ -static int reserve_blocks(struct super_block *sb, int count) -{ - struct ext2_sb_info *sbi = EXT2_SB(sb); - struct ext2_super_block *es = sbi->s_es; - unsigned free_blocks; - unsigned root_blocks; - - free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); - root_blocks = le32_to_cpu(es->s_r_blocks_count); - - if (free_blocks < count) - count = free_blocks; - - if (free_blocks < root_blocks + count && !capable(CAP_SYS_RESOURCE) && - sbi->s_resuid != current->fsuid && - (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { - /* - * We are too close to reserve and we are not privileged. - * Can we allocate anything at all? - */ - if (free_blocks > root_blocks) - count = free_blocks - root_blocks; - else - return 0; - } - - percpu_counter_mod(&sbi->s_freeblocks_counter, -count); - sb->s_dirt = 1; - return count; -} - static void release_blocks(struct super_block *sb, int count) { if (count) { - 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/