[XFS] Fix missing inode atime update from the utime syscall.
[linux-2.6-microblaze.git] / fs / xfs / xfs_mount.c
index 02b1892..62188ea 100644 (file)
@@ -51,7 +51,7 @@ STATIC int    xfs_uuid_mount(xfs_mount_t *);
 STATIC void    xfs_uuid_unmount(xfs_mount_t *mp);
 STATIC void    xfs_unmountfs_wait(xfs_mount_t *);
 
-static struct {
+static const struct {
     short offset;
     short type;     /* 0 = integer
                * 1 = binary / string (no translation)
@@ -117,7 +117,7 @@ xfs_mount_init(void)
 
        AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail");
        spinlock_init(&mp->m_sb_lock, "xfs_sb");
-       mutex_init(&mp->m_ilock, MUTEX_DEFAULT, "xfs_ilock");
+       mutex_init(&mp->m_ilock);
        initnsema(&mp->m_growlock, 1, "xfs_grow");
        /*
         * Initialize the AIL.
@@ -352,7 +352,7 @@ xfs_initialize_perag(
                        icount = sbp->sb_dblocks * sbp->sb_imax_pct;
                        do_div(icount, 100);
                        icount += sbp->sb_agblocks - 1;
-                       do_div(icount, mp->m_ialloc_blks);
+                       do_div(icount, sbp->sb_agblocks);
                        max_metadata = icount;
                } else {
                        max_metadata = agcount;
@@ -646,7 +646,7 @@ xfs_mountfs(
 
        if (mp->m_sb_bp == NULL) {
                if ((error = xfs_readsb(mp))) {
-                       return (error);
+                       return error;
                }
        }
        xfs_mount_common(mp, sbp);
@@ -889,7 +889,7 @@ xfs_mountfs(
         * For client case we are done now
         */
        if (mfsi_flags & XFS_MFSI_CLIENT) {
-               return(0);
+               return 0;
        }
 
        /*
@@ -1077,8 +1077,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
 
        xfs_iflush_all(mp);
 
-       XFS_QM_DQPURGEALL(mp,
-               XFS_QMOPT_UQUOTA | XFS_QMOPT_GQUOTA | XFS_QMOPT_UMOUNTING);
+       XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING);
 
        /*
         * Flush out the log synchronously so that we know for sure
@@ -1183,7 +1182,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
                        xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting.  Filesystem may not be marked shared readonly");
        }
        xfs_buf_relse(sbp);
-       return (error);
+       return error;
 }
 
 /*
@@ -1258,19 +1257,19 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
                lcounter += delta;
                if (lcounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_icount = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_IFREE:
                lcounter = (long long)mp->m_sb.sb_ifree;
                lcounter += delta;
                if (lcounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_ifree = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_FDBLOCKS:
 
                lcounter = (long long)mp->m_sb.sb_fdblocks;
@@ -1297,101 +1296,101 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
                                if (rsvd) {
                                        lcounter = (long long)mp->m_resblks_avail + delta;
                                        if (lcounter < 0) {
-                                               return (XFS_ERROR(ENOSPC));
+                                               return XFS_ERROR(ENOSPC);
                                        }
                                        mp->m_resblks_avail = lcounter;
-                                       return (0);
+                                       return 0;
                                } else {        /* not reserved */
-                                       return (XFS_ERROR(ENOSPC));
+                                       return XFS_ERROR(ENOSPC);
                                }
                        }
                }
 
                mp->m_sb.sb_fdblocks = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_FREXTENTS:
                lcounter = (long long)mp->m_sb.sb_frextents;
                lcounter += delta;
                if (lcounter < 0) {
-                       return (XFS_ERROR(ENOSPC));
+                       return XFS_ERROR(ENOSPC);
                }
                mp->m_sb.sb_frextents = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_DBLOCKS:
                lcounter = (long long)mp->m_sb.sb_dblocks;
                lcounter += delta;
                if (lcounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_dblocks = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_AGCOUNT:
                scounter = mp->m_sb.sb_agcount;
                scounter += delta;
                if (scounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_agcount = scounter;
-               return (0);
+               return 0;
        case XFS_SBS_IMAX_PCT:
                scounter = mp->m_sb.sb_imax_pct;
                scounter += delta;
                if (scounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_imax_pct = scounter;
-               return (0);
+               return 0;
        case XFS_SBS_REXTSIZE:
                scounter = mp->m_sb.sb_rextsize;
                scounter += delta;
                if (scounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_rextsize = scounter;
-               return (0);
+               return 0;
        case XFS_SBS_RBMBLOCKS:
                scounter = mp->m_sb.sb_rbmblocks;
                scounter += delta;
                if (scounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_rbmblocks = scounter;
-               return (0);
+               return 0;
        case XFS_SBS_RBLOCKS:
                lcounter = (long long)mp->m_sb.sb_rblocks;
                lcounter += delta;
                if (lcounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_rblocks = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_REXTENTS:
                lcounter = (long long)mp->m_sb.sb_rextents;
                lcounter += delta;
                if (lcounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_rextents = lcounter;
-               return (0);
+               return 0;
        case XFS_SBS_REXTSLOG:
                scounter = mp->m_sb.sb_rextslog;
                scounter += delta;
                if (scounter < 0) {
                        ASSERT(0);
-                       return (XFS_ERROR(EINVAL));
+                       return XFS_ERROR(EINVAL);
                }
                mp->m_sb.sb_rextslog = scounter;
-               return (0);
+               return 0;
        default:
                ASSERT(0);
-               return (XFS_ERROR(EINVAL));
+               return XFS_ERROR(EINVAL);
        }
 }
 
@@ -1410,7 +1409,7 @@ xfs_mod_incore_sb(xfs_mount_t *mp, xfs_sb_field_t field, int delta, int rsvd)
        s = XFS_SB_LOCK(mp);
        status = xfs_mod_incore_sb_unlocked(mp, field, delta, rsvd);
        XFS_SB_UNLOCK(mp, s);
-       return (status);
+       return status;
 }
 
 /*
@@ -1471,7 +1470,7 @@ xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
                }
        }
        XFS_SB_UNLOCK(mp, s);
-       return (status);
+       return status;
 }
 
 /*
@@ -1501,7 +1500,7 @@ xfs_getsb(
        }
        XFS_BUF_HOLD(bp);
        ASSERT(XFS_BUF_ISDONE(bp));
-       return (bp);
+       return bp;
 }
 
 /*