public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Martin J. Bligh" <mbligh@mbligh.org>,
	Valerie Henson <val_henson@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [-mm patch] remove fs/ext2/balloc.c:reserve_blocks()
Date: Tue, 14 Aug 2007 23:25:56 +0200	[thread overview]
Message-ID: <20070814212556.GV18945@stusta.de> (raw)
In-Reply-To: <20070809224254.11f42716.akpm@linux-foundation.org>

reserve_blocks() is no longer used.

Spotted by the GNU C compiler.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 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) {


  parent reply	other threads:[~2007-08-14 21:44 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10  5:42 2.6.23-rc2-mm2 Andrew Morton
2007-08-10  7:59 ` 2.6.23-rc2-mm2: possible irq lock inversion dependency detected Mariusz Kozlowski
2007-08-10  8:18 ` 2.6.23-rc2-mm2 Dave Young
2007-08-10  8:32   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10  8:37     ` 2.6.23-rc2-mm2 Dave Young
2007-08-10  9:52       ` 2.6.23-rc2-mm2 Dave Young
2007-08-10 11:19         ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 20:22           ` 2.6.23-rc2-mm2 -- conntrack divide error Jiri Slaby
2007-08-10  9:23 ` 2.6.23-rc2-mm2 Aurelien Jarno
2007-08-10 16:40   ` 2.6.23-rc2-mm2 Valdis.Kletnieks
2007-08-10 16:59     ` 2.6.23-rc2-mm2 Adrian Bunk
2007-08-10 17:21       ` 2.6.23-rc2-mm2 Valdis.Kletnieks
2007-08-10 17:28         ` 2.6.23-rc2-mm2 Adrian Bunk
2007-08-10 10:23 ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 11:03   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 16:05     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 12:35   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 16:38     ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-12 15:21       ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 12:37   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 13:20     ` [PATCH -mm] Fix some section mismatch warnings Gabriel C
2007-08-14 20:50       ` Andrew Morton
2007-08-10 19:04     ` Section mismatch warnings ( Re: 2.6.23-rc2-mm2 ) Gabriel C
2007-08-10 19:32       ` Andrew Morton
2007-08-10 12:42   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-11 20:58     ` [linux-usb-devel] 2.6.23-rc2-mm2 David Brownell
2007-08-12 10:15       ` Gabriel C
2007-08-10 16:03   ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 14:38 ` [-mm patch] kernel/sysctl_check.c must #include <linux/string.h> Adrian Bunk
2007-08-10 21:32   ` Eric W. Biederman
2007-08-10 14:53 ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 15:05   ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 16:01     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 16:05       ` 2.6.23-rc2-mm2 Ingo Molnar
2007-08-10 17:10         ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 17:12         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-21 10:41           ` 2.6.23-rc2-mm2 Ingo Molnar
2007-08-10 15:56 ` 2.6.23-rc2-mm2: drivers/s390/char/keyboard.c compile error Adrian Bunk
2007-08-10 16:39   ` Samuel Thibault
2007-08-10 16:16 ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 16:37   ` 2.6.23-rc2-mm2 Gabriel C
2007-08-10 17:33     ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 19:41       ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 19:54         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 21:00         ` [PATCH 1/7] sysctl: Remove broken cdrom binary sysctls Eric W. Biederman
2007-08-10 21:01           ` [PATCH 2/7] sysctl: parport remove binary paths Eric W. Biederman
2007-08-10 21:03             ` [PATCH 3/7] sysctl: Simplify the pty sysctl logic Eric W. Biederman
2007-08-10 21:06               ` [PATCH 4/7] sysctl: remove broken netfilter binary sysctls Eric W. Biederman
2007-08-10 21:08                 ` [PATCH 5/7] sysctl: Cleanup the sched debug sysctl usage Eric W. Biederman
2007-08-10 21:09                   ` [PATCH 6/7] sysctl: Update sysctl_checks list of binary paths Eric W. Biederman
2007-08-10 21:10                     ` [PATCH 7/7] sysctl: Remove the cad_pid binary sysctl path Eric W. Biederman
2007-08-10 21:10           ` [PATCH 1/7] sysctl: Remove broken cdrom binary sysctls Alan Cox
2007-08-10 21:19         ` 2.6.23-rc2-mm2 Eric W. Biederman
2007-08-10 17:38     ` 2.6.23-rc2-mm2 Michal Piotrowski
2007-08-10 17:55 ` arch/i386/kernel/setup.c - compile error (Re: 2.6.23-rc2-mm2) Gabriel C
2007-08-10 18:44   ` Andrew Morton
2007-08-10 19:34     ` Gabriel C
2007-08-10 20:08 ` 2.6.23-rc2-mm2 Aurelien Jarno
2007-08-10 20:20   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-10 21:43     ` 2.6.23-rc2-mm2 John W. Linville
2007-08-11 22:04 ` [PATCH] Re: 2.6.23-rc2-mm2: sata disk going slow Hugh Dickins
2007-08-13  5:29 ` 2.6.23-rc2-mm2 (libertas) Randy Dunlap
2007-08-14 21:23 ` [-mm patch] unexport ide_tune_dma Adrian Bunk
2007-08-14 21:23 ` [-mm patch] AFLAGS: fix the -g setting Adrian Bunk
2007-08-16 21:02   ` Andrew Morton
2007-08-16 22:16     ` Adrian Bunk
2007-08-16 22:30       ` Roland McGrath
2007-08-14 21:25 ` Adrian Bunk [this message]
2007-08-14 21:26 ` [-mm patch] unexport cap_inode_killpriv Adrian Bunk
2007-08-14 21:35   ` Serge E. Hallyn
2007-08-14 23:43     ` Adrian Bunk
2007-08-19 15:56 ` 2.6.23-rc2-mm2 richard kennedy
2007-08-21 23:36   ` 2.6.23-rc2-mm2 Andrew Morton
2007-08-23 15:54     ` 2.6.23-rc2-mm2 richard kennedy

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=20070814212556.GV18945@stusta.de \
    --to=bunk@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    --cc=val_henson@linux.intel.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