[XFS] Fix block reservation mechanism.
[linux-drm-fsl-dcu.git] / fs / xfs / xfs_vfsops.c
index 6c96391f3f1aad091982840e85e13d107757f461..f5ea74b999b69cd1d3380fa5bfee357e2f8ae254 100644 (file)
@@ -515,7 +515,7 @@ xfs_mount(
        if (error)
                goto error2;
 
-       if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (mp->m_flags & XFS_MOUNT_BARRIER)
                xfs_mountfs_check_barriers(mp);
 
        error = XFS_IOINIT(vfsp, args, flags);
@@ -640,7 +640,7 @@ xfs_quiesce_fs(
         * we can write the unmount record.
         */
        do {
-               xfs_syncsub(mp, SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT, 0, NULL);
+               xfs_syncsub(mp, SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT, NULL);
                pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
                if (!pincount) {
                        delay(50);
@@ -806,12 +806,13 @@ xfs_statvfs(
 
        statp->f_type = XFS_SB_MAGIC;
 
-       xfs_icsb_sync_counters_lazy(mp);
+       xfs_icsb_sync_counters_flags(mp, XFS_ICSB_LAZY_COUNT);
        s = XFS_SB_LOCK(mp);
        statp->f_bsize = sbp->sb_blocksize;
        lsize = sbp->sb_logstart ? sbp->sb_logblocks : 0;
        statp->f_blocks = sbp->sb_dblocks - lsize;
-       statp->f_bfree = statp->f_bavail = sbp->sb_fdblocks;
+       statp->f_bfree = statp->f_bavail =
+                               sbp->sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp);
        fakeinos = statp->f_bfree << sbp->sb_inopblog;
 #if XFS_BIG_INUMS
        fakeinos += mp->m_inoadd;
@@ -885,24 +886,20 @@ xfs_sync(
        if (unlikely(flags == SYNC_QUIESCE))
                return xfs_quiesce_fs(mp);
        else
-               return xfs_syncsub(mp, flags, 0, NULL);
+               return xfs_syncsub(mp, flags, NULL);
 }
 
 /*
  * xfs sync routine for internal use
  *
  * This routine supports all of the flags defined for the generic vfs_sync
- * interface as explained above under xfs_sync.  In the interests of not
- * changing interfaces within the 6.5 family, additional internally-
- * required functions are specified within a separate xflags parameter,
- * only available by calling this routine.
+ * interface as explained above under xfs_sync.
  *
  */
 int
 xfs_sync_inodes(
        xfs_mount_t     *mp,
        int             flags,
-       int             xflags,
        int             *bypassed)
 {
        xfs_inode_t     *ip = NULL;
@@ -1411,17 +1408,13 @@ xfs_sync_inodes(
  * xfs sync routine for internal use
  *
  * This routine supports all of the flags defined for the generic vfs_sync
- * interface as explained above under xfs_sync.  In the interests of not
- * changing interfaces within the 6.5 family, additional internally-
- * required functions are specified within a separate xflags parameter,
- * only available by calling this routine.
+ * interface as explained above under xfs_sync.
  *
  */
 int
 xfs_syncsub(
        xfs_mount_t     *mp,
        int             flags,
-       int             xflags,
        int             *bypassed)
 {
        int             error = 0;
@@ -1443,7 +1436,7 @@ xfs_syncsub(
                if (flags & SYNC_BDFLUSH)
                        xfs_finish_reclaim_all(mp, 1);
                else
-                       error = xfs_sync_inodes(mp, flags, xflags, bypassed);
+                       error = xfs_sync_inodes(mp, flags, bypassed);
        }
 
        /*
@@ -1921,7 +1914,7 @@ xfs_showargs(
        }
 
        if (mp->m_flags & XFS_MOUNT_IHASHSIZE)
-               seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", mp->m_ihsize);
+               seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", (int)mp->m_ihsize);
 
        if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE)
                seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk",