]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_trans.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / fs / xfs / xfs_trans.c
index 7a99ed3b187f04e8ee689b8dcba346ed0c29db01..ee2721e0de4d7fd700e22e8a3b635255c14696cc 100644 (file)
@@ -24,7 +24,6 @@
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
-#include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
@@ -33,7 +32,6 @@
 #include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
 #include "xfs_ialloc_btree.h"
-#include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
@@ -236,11 +234,8 @@ xfs_trans_alloc(
        xfs_mount_t     *mp,
        uint            type)
 {
-       fs_check_frozen(XFS_MTOVFS(mp), SB_FREEZE_TRANS);
-       atomic_inc(&mp->m_active_trans);
-
-       return (_xfs_trans_alloc(mp, type));
-
+       vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_TRANS);
+       return _xfs_trans_alloc(mp, type);
 }
 
 xfs_trans_t *
@@ -250,12 +245,9 @@ _xfs_trans_alloc(
 {
        xfs_trans_t     *tp;
 
-       ASSERT(xfs_trans_zone != NULL);
-       tp = kmem_zone_zalloc(xfs_trans_zone, KM_SLEEP);
+       atomic_inc(&mp->m_active_trans);
 
-       /*
-        * Initialize the transaction structure.
-        */
+       tp = kmem_zone_zalloc(xfs_trans_zone, KM_SLEEP);
        tp->t_magic = XFS_TRANS_MAGIC;
        tp->t_type = type;
        tp->t_mountp = mp;
@@ -263,8 +255,7 @@ _xfs_trans_alloc(
        tp->t_busy_free = XFS_LBC_NUM_SLOTS;
        XFS_LIC_INIT(&(tp->t_items));
        XFS_LBC_INIT(&(tp->t_busy));
-
-       return (tp);
+       return tp;
 }
 
 /*