diff options
Diffstat (limited to 'fs/xfs/xfs_trans_extfree.c')
| -rw-r--r-- | fs/xfs/xfs_trans_extfree.c | 16 | 
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/xfs/xfs_trans_extfree.c b/fs/xfs/xfs_trans_extfree.c index f783d5e9fa7..47978ba89da 100644 --- a/fs/xfs/xfs_trans_extfree.c +++ b/fs/xfs/xfs_trans_extfree.c @@ -17,13 +17,13 @@   */  #include "xfs.h"  #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_inum.h" -#include "xfs_trans.h" +#include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h"  #include "xfs_sb.h"  #include "xfs_ag.h"  #include "xfs_mount.h" +#include "xfs_trans.h"  #include "xfs_trans_priv.h"  #include "xfs_extfree_item.h" @@ -69,12 +69,16 @@ xfs_trans_log_efi_extent(xfs_trans_t		*tp,  	tp->t_flags |= XFS_TRANS_DIRTY;  	efip->efi_item.li_desc->lid_flags |= XFS_LID_DIRTY; -	next_extent = efip->efi_next_extent; +	/* +	 * atomic_inc_return gives us the value after the increment; +	 * we want to use it as an array index so we need to subtract 1 from +	 * it. +	 */ +	next_extent = atomic_inc_return(&efip->efi_next_extent) - 1;  	ASSERT(next_extent < efip->efi_format.efi_nextents);  	extp = &(efip->efi_format.efi_extents[next_extent]);  	extp->ext_start = start_block;  	extp->ext_len = ext_len; -	efip->efi_next_extent++;  }  | 
