reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Shapovalov <intelfx100@gmail.com>
To: reiserfs-devel@vger.kernel.org
Cc: edward.shishkin@gmail.com, Ivan Shapovalov <intelfx100@gmail.com>
Subject: [RFC] [PATCHv3 2/9] reiser4: block_alloc: add a "forward" parameter to reiser4_blocknr_hint to allocate blocks only in forward direction.
Date: Mon, 18 Aug 2014 01:52:52 +0400	[thread overview]
Message-ID: <1408312379-1990-3-git-send-email-intelfx100@gmail.com> (raw)
In-Reply-To: <1408312379-1990-1-git-send-email-intelfx100@gmail.com>

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---
 fs/reiser4/block_alloc.h         | 5 +++--
 fs/reiser4/plugin/space/bitmap.c | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/reiser4/block_alloc.h b/fs/reiser4/block_alloc.h
index bfc6be9..08b3941 100644
--- a/fs/reiser4/block_alloc.h
+++ b/fs/reiser4/block_alloc.h
@@ -51,9 +51,10 @@ struct reiser4_blocknr_hint {
 	/* block allocator assumes that blocks, which will be mapped to disk,
 	   are in this specified block_stage */
 	block_stage_t block_stage;
-	/* If direction = 1 allocate blocks in backward direction from the end
-	 * of disk to the beginning of disk.  */
+	/* Allocate blocks only in backward direction starting from blk. */
 	unsigned int backward:1;
+	/* Allocate blocks only in forward direction starting from blk. */
+	unsigned int forward:1;
 
 };
 
diff --git a/fs/reiser4/plugin/space/bitmap.c b/fs/reiser4/plugin/space/bitmap.c
index 3da3f6b..9beaf66 100644
--- a/fs/reiser4/plugin/space/bitmap.c
+++ b/fs/reiser4/plugin/space/bitmap.c
@@ -1127,7 +1127,8 @@ static int alloc_blocks_forward(reiser4_blocknr_hint *hint, int needed,
 	/* There is only one bitmap search if max_dist was specified or first
 	   pass was from the beginning of the bitmap. We also do one pass for
 	   scanning bitmap in backward direction. */
-	if (!(actual_len != 0 || hint->max_dist != 0 || search_start == 0)) {
+	if (actual_len == 0 && search_start != 0 &&
+	    hint->max_dist == 0 && hint->forward == 0) {
 		/* next step is a scanning from 0 to search_start */
 		search_end = search_start;
 		search_start = 0;
-- 
2.0.4


  parent reply	other threads:[~2014-08-17 21:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 21:52 [RFC] [PATCHv3 0/9] reiser4: batch discard support (FITRIM ioctl): initial implementation Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 1/9] reiser4: block_alloc: add BA_SOME_SPACE flag for grabbing a fixed amount of space Ivan Shapovalov
2014-10-19 22:04   ` Edward Shishkin
2014-10-20 10:36     ` Ivan Shapovalov
2014-10-21 10:32       ` Edward Shishkin
2014-10-21 16:17         ` Ivan Shapovalov
2014-08-17 21:52 ` Ivan Shapovalov [this message]
2014-10-21 15:50   ` [RFC] [PATCHv3 2/9] reiser4: block_alloc: add a "forward" parameter to reiser4_blocknr_hint to allocate blocks only in forward direction Edward Shishkin
2014-10-23  7:24     ` Ivan Shapovalov
2014-10-23 14:37       ` Edward Shishkin
2014-10-23 20:58         ` Ivan Shapovalov
2014-10-26 16:45           ` Edward Shishkin
2014-10-26 23:21             ` Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 3/9] reiser4: txnmgr: free allocated but unneeded atom in atom_begin_and_assign_to_txnh() Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 4/9] reiser4: txnmgr: add reiser4_create_atom() which creates an empty atom without capturing any nodes Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 5/9] reiser4: txnmgr: call reiser4_post_write_back_hook() also for empty atoms Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 6/9] reiser4: batch discard support: add a dummy FITRIM ioctl handler for directories Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 7/9] reiser4: batch discard support: actually implement the FITRIM ioctl handler Ivan Shapovalov
2014-10-20 10:54   ` Edward Shishkin
2014-10-20 22:39     ` Ivan Shapovalov
2014-10-21 10:14       ` Edward Shishkin
2014-10-21 16:18         ` Ivan Shapovalov
2014-10-21 16:21           ` Edward Shishkin
2014-10-21 16:23             ` Ivan Shapovalov
2014-10-21 16:33               ` Edward Shishkin
2014-10-21 16:42                 ` Ivan Shapovalov
2014-10-21 18:01                   ` Edward Shishkin
2014-10-21 18:11                     ` Ivan Shapovalov
2014-10-21 18:48                       ` Edward Shishkin
2014-10-21 19:00                         ` Ivan Shapovalov
2014-10-21 19:13                           ` Edward Shishkin
2014-08-17 21:52 ` [RFC] [PATCHv3 8/9] reiser4: block_alloc: add a "min_len" parameter to reiser4_blocknr_hint to limit allocated extent length from below Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 9/9] reiser4: batch discard support: honor minimal extent length passed from the userspace Ivan Shapovalov
2014-08-17 21:56 ` [RFC] [PATCHv3 0/9] reiser4: batch discard support (FITRIM ioctl): initial implementation Ivan Shapovalov

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=1408312379-1990-3-git-send-email-intelfx100@gmail.com \
    --to=intelfx100@gmail.com \
    --cc=edward.shishkin@gmail.com \
    --cc=reiserfs-devel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).