linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: save goal group and offset in struct ext4_allocation_context.ac_g_ex
@ 2014-07-23  9:47 Xiaoguang Wang
  2014-07-29 13:58 ` Theodore Ts'o
  0 siblings, 1 reply; 7+ messages in thread
From: Xiaoguang Wang @ 2014-07-23  9:47 UTC (permalink / raw)
  To: linux-ext4; +Cc: adilger, lczerner, tytso, Xiaoguang Wang

In ext4_mb_normalize_request(), if ac_g_ex.fe_logical is adjacent to the closest logical
allocated block to the left or (ac_g_ex.fe_logical+len) adjacent to the closest logical
allocated block to the right, we'll attach EXT4_MB_HINT_TRY_GOAL flag taking the physical
block (ext4_allocation_request.lleft+1) or (ext4_allocation_request.pright-len) as a goal,
and put this information in ext4_allocation_context.ac_f_ex.

But look at the ext4_mb_find_by_goal(), indeed it use ac_g_ex to look up, so this is wrong,
we should save goal group and offset in struct ext4_allocation_context.ac_g_ex.

Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
---
 fs/ext4/mballoc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 2dcb936..6d939d79 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3168,15 +3168,15 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
 	if (ar->pright && (ar->lright == (start + size))) {
 		/* merge to the right */
 		ext4_get_group_no_and_offset(ac->ac_sb, ar->pright - size,
-						&ac->ac_f_ex.fe_group,
-						&ac->ac_f_ex.fe_start);
+						&ac->ac_g_ex.fe_group,
+						&ac->ac_g_ex.fe_start);
 		ac->ac_flags |= EXT4_MB_HINT_TRY_GOAL;
 	}
 	if (ar->pleft && (ar->lleft + 1 == start)) {
 		/* merge to the left */
 		ext4_get_group_no_and_offset(ac->ac_sb, ar->pleft + 1,
-						&ac->ac_f_ex.fe_group,
-						&ac->ac_f_ex.fe_start);
+						&ac->ac_g_ex.fe_group,
+						&ac->ac_g_ex.fe_start);
 		ac->ac_flags |= EXT4_MB_HINT_TRY_GOAL;
 	}
 
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-04 10:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23  9:47 [PATCH] ext4: save goal group and offset in struct ext4_allocation_context.ac_g_ex Xiaoguang Wang
2014-07-29 13:58 ` Theodore Ts'o
2014-07-31 15:32   ` Theodore Ts'o
2014-08-01  1:13     ` Xiaoguang Wang
2014-08-01 12:40       ` Theodore Ts'o
2014-08-04  7:00     ` Xiaoguang Wang
2014-08-04 10:39       ` [PATCH v2] " Xiaoguang Wang

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