mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: akpm@osdl.org, "Stephen C. Tweedie" <sct@redhat.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"ext2-devel@lists.sourceforge.net"
	<ext2-devel@lists.sourceforge.net>
Subject: [PATCH 2/3] ext3 reservation allow turn off for specifed file
Date: 18 Oct 2004 15:55:20 -0700	[thread overview]
Message-ID: <1098140129.9754.1064.camel@w-ming2.beaverton.ibm.com> (raw)
In-Reply-To: <1097879695.4591.61.camel@localhost.localdomain>

Allow user shut down reservation-based allocation(using ioctl) on a specific file(e.g. for seeky random write).


---

 linux-2.6.9-rc4-mm1-ming/fs/ext3/balloc.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff -puN fs/ext3/balloc.c~ext3_shutdown_reservation_per-file fs/ext3/balloc.c
--- linux-2.6.9-rc4-mm1/fs/ext3/balloc.c~ext3_shutdown_reservation_per-file	2004-10-18 22:27:06.333698488 -0700
+++ linux-2.6.9-rc4-mm1-ming/fs/ext3/balloc.c	2004-10-18 22:34:52.825780912 -0700
@@ -1153,6 +1153,7 @@ int ext3_new_block(handle_t *handle, str
 	struct ext3_super_block *es;
 	struct ext3_sb_info *sbi;
 	struct reserve_window_node *my_rsv = NULL;
+	struct reserve_window_node *rsv = &EXT3_I(inode)->i_rsv_window;
 #ifdef EXT3FS_DEBUG
 	static int goal_hits, goal_attempts;
 #endif
@@ -1176,8 +1177,18 @@ int ext3_new_block(handle_t *handle, str
 	sbi = EXT3_SB(sb);
 	es = EXT3_SB(sb)->s_es;
 	ext3_debug("goal=%lu.\n", goal);
-	if (test_opt(sb, RESERVATION) && S_ISREG(inode->i_mode))
-		my_rsv = &EXT3_I(inode)->i_rsv_window;
+	/*
+	 * Allocate a block from reservation only when
+	 * filesystem is mounted with reservation(default,-o reservation), and
+	 * it's a regular file, and
+	 * the desired window size is greater than 0 (One could use ioctl
+	 * command EXT3_IOC_SETRSVSZ to set the window size to 0 to turn off
+	 * reservation on that particular file)
+	 */
+	if (test_opt(sb, RESERVATION) &&
+		S_ISREG(inode->i_mode) &&
+		(atomic_read(&rsv->rsv_goal_size) > 0))
+		my_rsv = rsv;
 	if (!ext3_has_free_blocks(sbi)) {
 		*errp = -ENOSPC;
 		goto out;

_


  reply	other threads:[~2004-10-18 22:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-15 13:27 Ext3 -mm reservations code: is this fix really correct? Stephen C. Tweedie
2004-10-15 16:01 ` [Ext2-devel] " mingming cao
2004-10-15 16:40   ` Stephen C. Tweedie
2004-10-15 20:29     ` mingming cao
2004-10-15 22:20       ` Stephen C. Tweedie
2004-10-15 22:34         ` mingming cao
2004-10-18 22:55           ` Mingming Cao [this message]
2004-10-18 23:42             ` [PATCH 2/3] ext3 reservation allow turn off for specifed file Andrew Morton
2004-10-19  1:01               ` Mingming Cao
2004-10-20 17:55                 ` Ray Lee
2004-10-25 20:33                   ` [Ext2-devel] " Mingming Cao
2004-10-25 23:05                     ` Mingming Cao
2004-10-25 23:45                       ` Andrew Morton
2004-10-26 16:53                         ` Mingming Cao
2004-10-26 20:18                           ` Andrew Morton
2004-10-26 23:01                             ` Mingming Cao

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=1098140129.9754.1064.camel@w-ming2.beaverton.ibm.com \
    --to=cmm@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=sct@redhat.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

all inboxes | Powered by JetHome®