]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_fsops.c
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6] / fs / xfs / xfs_fsops.c
index d1236d6f40455c96d188463c188dee42502447db..dfa3527b20a78fd07db80df71f3ed2cbef9c7204 100644 (file)
@@ -462,6 +462,7 @@ xfs_fs_counts(
 {
        unsigned long   s;
 
+       xfs_icsb_sync_counters_lazy(mp);
        s = XFS_SB_LOCK(mp);
        cnt->freedata = mp->m_sb.sb_fdblocks;
        cnt->freertx = mp->m_sb.sb_frextents;
@@ -476,7 +477,7 @@ xfs_fs_counts(
  *
  * xfs_reserve_blocks is called to set m_resblks
  * in the in-core mount table. The number of unused reserved blocks
- * is kept in m_resbls_avail.
+ * is kept in m_resblks_avail.
  *
  * Reserve the requested number of blocks if available. Otherwise return
  * as many as possible to satisfy the request. The actual number
@@ -501,7 +502,7 @@ xfs_reserve_blocks(
        if (inval == (__uint64_t *)NULL) {
                outval->resblks = mp->m_resblks;
                outval->resblks_avail = mp->m_resblks_avail;
-               return(0);
+               return 0;
        }
 
        request = *inval;
@@ -537,7 +538,33 @@ xfs_reserve_blocks(
        outval->resblks = mp->m_resblks;
        outval->resblks_avail = mp->m_resblks_avail;
        XFS_SB_UNLOCK(mp, s);
-       return(0);
+       return 0;
+}
+
+void
+xfs_fs_log_dummy(xfs_mount_t *mp)
+{
+       xfs_trans_t *tp;
+       xfs_inode_t *ip;
+
+
+       tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1);
+       atomic_inc(&mp->m_active_trans);
+       if (xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0)) {
+               xfs_trans_cancel(tp, 0);
+               return;
+       }
+
+       ip = mp->m_rootip;
+       xfs_ilock(ip, XFS_ILOCK_EXCL);
+
+       xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+       xfs_trans_ihold(tp, ip);
+       xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+       xfs_trans_set_sync(tp);
+       xfs_trans_commit(tp, 0, NULL);
+
+       xfs_iunlock(ip, XFS_ILOCK_EXCL);
 }
 
 int