diff options
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r-- | fs/xfs/xfs_trans.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index c83f63b33aa..2837220ea5c 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -566,31 +566,24 @@ xfs_trans_init( | |||
566 | 566 | ||
567 | /* | 567 | /* |
568 | * This routine is called to allocate a transaction structure. | 568 | * This routine is called to allocate a transaction structure. |
569 | * | ||
569 | * The type parameter indicates the type of the transaction. These | 570 | * The type parameter indicates the type of the transaction. These |
570 | * are enumerated in xfs_trans.h. | 571 | * are enumerated in xfs_trans.h. |
571 | * | ||
572 | * Dynamically allocate the transaction structure from the transaction | ||
573 | * zone, initialize it, and return it to the caller. | ||
574 | */ | 572 | */ |
575 | xfs_trans_t * | 573 | struct xfs_trans * |
576 | xfs_trans_alloc( | ||
577 | xfs_mount_t *mp, | ||
578 | uint type) | ||
579 | { | ||
580 | xfs_wait_for_freeze(mp, SB_FREEZE_TRANS); | ||
581 | return _xfs_trans_alloc(mp, type, KM_SLEEP); | ||
582 | } | ||
583 | |||
584 | xfs_trans_t * | ||
585 | _xfs_trans_alloc( | 574 | _xfs_trans_alloc( |
586 | xfs_mount_t *mp, | 575 | struct xfs_mount *mp, |
587 | uint type, | 576 | uint type, |
588 | uint memflags) | 577 | uint memflags, |
578 | bool wait_for_freeze) | ||
589 | { | 579 | { |
590 | xfs_trans_t *tp; | 580 | struct xfs_trans *tp; |
591 | 581 | ||
592 | atomic_inc(&mp->m_active_trans); | 582 | atomic_inc(&mp->m_active_trans); |
593 | 583 | ||
584 | if (wait_for_freeze) | ||
585 | xfs_wait_for_freeze(mp, SB_FREEZE_TRANS); | ||
586 | |||
594 | tp = kmem_zone_zalloc(xfs_trans_zone, memflags); | 587 | tp = kmem_zone_zalloc(xfs_trans_zone, memflags); |
595 | tp->t_magic = XFS_TRANS_MAGIC; | 588 | tp->t_magic = XFS_TRANS_MAGIC; |
596 | tp->t_type = type; | 589 | tp->t_type = type; |