diff options
author | Brian Foster <bfoster@redhat.com> | 2013-01-17 13:11:29 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-01-17 18:53:37 -0500 |
commit | 9e96fe6df44425b69ed89f6ac20352cec1f127d7 (patch) | |
tree | 875ad09d40b65530fe61c6dbf7b97c3c8b70f995 /fs/xfs | |
parent | 667a9291c5b38318a47a2df730bc064e5d37d2a8 (diff) |
xfs: pull up stack_switch check into xfs_bmapi_write
The stack_switch check currently occurs in __xfs_bmapi_allocate,
which means the stack switch only occurs when xfs_bmapi_allocate()
is called in a loop. Pull the check up before the loop in
xfs_bmapi_write() such that the first iteration of the loop has
consistent behavior.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index c5077208e419..491f35e2dd26 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -4676,9 +4676,6 @@ __xfs_bmapi_allocate( | |||
4676 | return error; | 4676 | return error; |
4677 | } | 4677 | } |
4678 | 4678 | ||
4679 | if (bma->flags & XFS_BMAPI_STACK_SWITCH) | ||
4680 | bma->stack_switch = 1; | ||
4681 | |||
4682 | error = xfs_bmap_alloc(bma); | 4679 | error = xfs_bmap_alloc(bma); |
4683 | if (error) | 4680 | if (error) |
4684 | return error; | 4681 | return error; |
@@ -4952,6 +4949,9 @@ xfs_bmapi_write( | |||
4952 | bma.flist = flist; | 4949 | bma.flist = flist; |
4953 | bma.firstblock = firstblock; | 4950 | bma.firstblock = firstblock; |
4954 | 4951 | ||
4952 | if (flags & XFS_BMAPI_STACK_SWITCH) | ||
4953 | bma.stack_switch = 1; | ||
4954 | |||
4955 | while (bno < end && n < *nmap) { | 4955 | while (bno < end && n < *nmap) { |
4956 | inhole = eof || bma.got.br_startoff > bno; | 4956 | inhole = eof || bma.got.br_startoff > bno; |
4957 | wasdelay = !inhole && isnullstartblock(bma.got.br_startblock); | 4957 | wasdelay = !inhole && isnullstartblock(bma.got.br_startblock); |