Skip to content

Commit

Permalink
xfs: pull up stack_switch check into xfs_bmapi_write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian Foster authored and Ben Myers committed Jan 28, 2013
1 parent 1bee12b commit d26978d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4680,9 +4680,6 @@ __xfs_bmapi_allocate(
return error;
}

if (bma->flags & XFS_BMAPI_STACK_SWITCH)
bma->stack_switch = 1;

error = xfs_bmap_alloc(bma);
if (error)
return error;
Expand Down Expand Up @@ -4956,6 +4953,9 @@ xfs_bmapi_write(
bma.flist = flist;
bma.firstblock = firstblock;

if (flags & XFS_BMAPI_STACK_SWITCH)
bma.stack_switch = 1;

while (bno < end && n < *nmap) {
inhole = eof || bma.got.br_startoff > bno;
wasdelay = !inhole && isnullstartblock(bma.got.br_startblock);
Expand Down

0 comments on commit d26978d

Please sign in to comment.