xfs: pull up stack_switch check into xfs_bmapi_write
authorBrian Foster <[email protected]>
Thu, 17 Jan 2013 18:11:29 +0000 (13:11 -0500)
committerBen Myers <[email protected]>
Mon, 28 Jan 2013 18:48:55 +0000 (12:48 -0600)
commitd26978dd866dbb3b3a9690f3655a5e735055de89
treef0757e20ef85bdf9f640c98965ceab422bb69340
parent1bee12b8c44d825fb45cd6a13e76c185ed6888b8
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 <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Ben Myers <[email protected]>
fs/xfs/xfs_bmap.c