]> err.no Git - linux-2.6/blobdiff - fs/xfs/quota/xfs_qm.c
[XFS] Reduce stack use during quota mounts (caused a panic). This
[linux-2.6] / fs / xfs / quota / xfs_qm.c
index 79aadb1c1f442dd3763d9a3d88ab577ec69d8309..7c0e39dc618983a356c551a71a6c44fd39eaf23f 100644 (file)
  * quota functionality, including maintaining the freelist and hash
  * tables of dquots.
  */
-mutex_t xfs_Gqm_lock;
+mutex_t                xfs_Gqm_lock;
 struct xfs_qm  *xfs_Gqm;
+uint           ndquot;
 
 kmem_zone_t    *qm_dqzone;
 kmem_zone_t    *qm_dqtrxzone;
 STATIC kmem_shaker_t   xfs_qm_shaker;
 
+STATIC cred_t  xfs_zerocr;
+STATIC xfs_inode_t     xfs_zeroino;
+
 STATIC void    xfs_qm_list_init(xfs_dqlist_t *, char *, int);
 STATIC void    xfs_qm_list_destroy(xfs_dqlist_t *);
 
@@ -77,7 +81,7 @@ STATIC int    xfs_qm_dqhashlock_nowait(xfs_dquot_t *);
 
 STATIC int     xfs_qm_init_quotainos(xfs_mount_t *);
 STATIC int     xfs_qm_init_quotainfo(xfs_mount_t *);
-STATIC int     xfs_qm_shake(int, unsigned int);
+STATIC int     xfs_qm_shake(int, gfp_t);
 
 #ifdef DEBUG
 extern mutex_t qcheck_lock;
@@ -108,25 +112,25 @@ extern mutex_t    qcheck_lock;
 STATIC struct xfs_qm *
 xfs_Gqm_init(void)
 {
-       xfs_qm_t                *xqm;
-       int                     hsize, i;
-
-       xqm = kmem_zalloc(sizeof(xfs_qm_t), KM_SLEEP);
-       ASSERT(xqm);
+       xfs_dqhash_t    *udqhash, *gdqhash;
+       xfs_qm_t        *xqm;
+       uint            i, hsize, flags = KM_SLEEP | KM_MAYFAIL;
 
        /*
         * Initialize the dquot hash tables.
         */
-       hsize = (DQUOT_HASH_HEURISTIC < XFS_QM_NCSIZE_THRESHOLD) ?
-               XFS_QM_HASHSIZE_LOW : XFS_QM_HASHSIZE_HIGH;
-       xqm->qm_dqhashmask = hsize - 1;
+       hsize = XFS_QM_HASHSIZE_HIGH;
+       while (!(udqhash = kmem_zalloc(hsize * sizeof(xfs_dqhash_t), flags))) {
+               if ((hsize >>= 1) <= XFS_QM_HASHSIZE_LOW)
+                       flags = KM_SLEEP;
+       }
+       gdqhash = kmem_zalloc(hsize * sizeof(xfs_dqhash_t), KM_SLEEP);
+       ndquot = hsize << 8;
 
-       xqm->qm_usr_dqhtable = (xfs_dqhash_t *)kmem_zalloc(hsize *
-                                                     sizeof(xfs_dqhash_t),
-                                                     KM_SLEEP);
-       xqm->qm_grp_dqhtable = (xfs_dqhash_t *)kmem_zalloc(hsize *
-                                                     sizeof(xfs_dqhash_t),
-                                                     KM_SLEEP);
+       xqm = kmem_zalloc(sizeof(xfs_qm_t), KM_SLEEP);
+       xqm->qm_dqhashmask = hsize - 1;
+       xqm->qm_usr_dqhtable = udqhash;
+       xqm->qm_grp_dqhtable = gdqhash;
        ASSERT(xqm->qm_usr_dqhtable != NULL);
        ASSERT(xqm->qm_grp_dqhtable != NULL);
 
@@ -166,7 +170,7 @@ xfs_Gqm_init(void)
        xqm->qm_dqfree_ratio = XFS_QM_DQFREE_RATIO;
        xqm->qm_nrefs = 0;
 #ifdef DEBUG
-       mutex_init(&qcheck_lock, MUTEX_DEFAULT, "qchk");
+       mutex_init(&qcheck_lock);
 #endif
        return xqm;
 }
@@ -496,7 +500,7 @@ xfs_qm_dqflush_all(
        int             error;
 
        if (mp->m_quotainfo == NULL)
-               return (0);
+               return 0;
        niters = 0;
 again:
        xfs_qm_mplist_lock(mp);
@@ -527,7 +531,7 @@ again:
                error = xfs_qm_dqflush(dqp, flags);
                xfs_dqunlock(dqp);
                if (error)
-                       return (error);
+                       return error;
 
                xfs_qm_mplist_lock(mp);
                if (recl != XFS_QI_MPLRECLAIMS(mp)) {
@@ -539,7 +543,7 @@ again:
 
        xfs_qm_mplist_unlock(mp);
        /* return ! busy */
-       return (0);
+       return 0;
 }
 /*
  * Release the group dquot pointers the user dquots may be
@@ -598,7 +602,7 @@ xfs_qm_dqpurge_int(
        int             nmisses;
 
        if (mp->m_quotainfo == NULL)
-               return (0);
+               return 0;
 
        dqtype = (flags & XFS_QMOPT_UQUOTA) ? XFS_DQ_USER : 0;
        dqtype |= (flags & XFS_QMOPT_PQUOTA) ? XFS_DQ_PROJ : 0;
@@ -795,7 +799,7 @@ xfs_qm_dqattach_one(
                        ASSERT(XFS_DQ_IS_LOCKED(dqp));
        }
 #endif
-       return (error);
+       return error;
 }
 
 
@@ -896,7 +900,7 @@ xfs_qm_dqattach(
            (! XFS_NOT_DQATTACHED(mp, ip)) ||
            (ip->i_ino == mp->m_sb.sb_uquotino) ||
            (ip->i_ino == mp->m_sb.sb_gquotino))
-               return (0);
+               return 0;
 
        ASSERT((flags & XFS_QMOPT_ILOCKED) == 0 ||
               XFS_ISLOCKED_INODE_EXCL(ip));
@@ -983,7 +987,7 @@ xfs_qm_dqattach(
        else
                ASSERT(XFS_ISLOCKED_INODE_EXCL(ip));
 #endif
-       return (error);
+       return error;
 }
 
 /*
@@ -1048,7 +1052,7 @@ xfs_qm_sync(
         */
        if (! XFS_IS_QUOTA_ON(mp)) {
                xfs_qm_mplist_unlock(mp);
-               return (0);
+               return 0;
        }
        FOREACH_DQUOT_IN_MP(dqp, mp) {
                /*
@@ -1108,9 +1112,9 @@ xfs_qm_sync(
                error = xfs_qm_dqflush(dqp, flush_flags);
                xfs_dqunlock(dqp);
                if (error && XFS_FORCED_SHUTDOWN(mp))
-                       return(0);      /* Need to prevent umount failure */
+                       return 0;       /* Need to prevent umount failure */
                else if (error)
-                       return (error);
+                       return error;
 
                xfs_qm_mplist_lock(mp);
                if (recl != XFS_QI_MPLRECLAIMS(mp)) {
@@ -1123,7 +1127,7 @@ xfs_qm_sync(
        }
 
        xfs_qm_mplist_unlock(mp);
-       return (0);
+       return 0;
 }
 
 
@@ -1145,7 +1149,7 @@ xfs_qm_init_quotainfo(
         * Tell XQM that we exist as soon as possible.
         */
        if ((error = xfs_qm_hold_quotafs_ref(mp))) {
-               return (error);
+               return error;
        }
 
        qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
@@ -1157,7 +1161,7 @@ xfs_qm_init_quotainfo(
        if ((error = xfs_qm_init_quotainos(mp))) {
                kmem_free(qinf, sizeof(xfs_quotainfo_t));
                mp->m_quotainfo = NULL;
-               return (error);
+               return error;
        }
 
        spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin");
@@ -1165,7 +1169,7 @@ xfs_qm_init_quotainfo(
        qinf->qi_dqreclaims = 0;
 
        /* mutex used to serialize quotaoffs */
-       mutex_init(&qinf->qi_quotaofflock, MUTEX_DEFAULT, "qoff");
+       mutex_init(&qinf->qi_quotaofflock);
 
        /* Precalc some constants */
        qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB);
@@ -1231,7 +1235,7 @@ xfs_qm_init_quotainfo(
                qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT;
        }
 
-       return (0);
+       return 0;
 }
 
 
@@ -1284,7 +1288,7 @@ xfs_qm_list_init(
        char            *str,
        int             n)
 {
-       mutex_init(&list->qh_lock, MUTEX_DEFAULT, str);
+       mutex_init(&list->qh_lock);
        list->qh_next = NULL;
        list->qh_version = 0;
        list->qh_nelems = 0;
@@ -1331,7 +1335,7 @@ xfs_qm_dqget_noattach(
                         */
                        ASSERT(error != ESRCH);
                        ASSERT(error != ENOENT);
-                       return (error);
+                       return error;
                }
                ASSERT(udqp);
        }
@@ -1354,7 +1358,7 @@ xfs_qm_dqget_noattach(
                                xfs_qm_dqrele(udqp);
                        ASSERT(error != ESRCH);
                        ASSERT(error != ENOENT);
-                       return (error);
+                       return error;
                }
                ASSERT(gdqp);
 
@@ -1375,7 +1379,7 @@ xfs_qm_dqget_noattach(
        if (udqp) ASSERT(XFS_DQ_IS_LOCKED(udqp));
        if (gdqp) ASSERT(XFS_DQ_IS_LOCKED(gdqp));
 #endif
-       return (0);
+       return 0;
 }
 
 /*
@@ -1391,26 +1395,24 @@ xfs_qm_qino_alloc(
 {
        xfs_trans_t     *tp;
        int             error;
-       unsigned long s;
-       cred_t          zerocr;
+       unsigned long   s;
        int             committed;
 
-       tp = xfs_trans_alloc(mp,XFS_TRANS_QM_QINOCREATE);
+       tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE);
        if ((error = xfs_trans_reserve(tp,
                                      XFS_QM_QINOCREATE_SPACE_RES(mp),
                                      XFS_CREATE_LOG_RES(mp), 0,
                                      XFS_TRANS_PERM_LOG_RES,
                                      XFS_CREATE_LOG_COUNT))) {
                xfs_trans_cancel(tp, 0);
-               return (error);
+               return error;
        }
-       memset(&zerocr, 0, sizeof(zerocr));
 
-       if ((error = xfs_dir_ialloc(&tp, mp->m_rootip, S_IFREG, 1, 0,
-                                  &zerocr, 0, 1, ip, &committed))) {
+       if ((error = xfs_dir_ialloc(&tp, &xfs_zeroino, S_IFREG, 1, 0,
+                                  &xfs_zerocr, 0, 1, ip, &committed))) {
                xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
                                 XFS_TRANS_ABORT);
-               return (error);
+               return error;
        }
 
        /*
@@ -1458,9 +1460,9 @@ xfs_qm_qino_alloc(
        if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES,
                                     NULL))) {
                xfs_fs_cmn_err(CE_ALERT, mp, "XFS qino_alloc failed!");
-               return (error);
+               return error;
        }
-       return (0);
+       return 0;
 }
 
 
@@ -1505,7 +1507,7 @@ xfs_qm_reset_dqcounts(
                ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1);
        }
 
-       return (0);
+       return 0;
 }
 
 STATIC int
@@ -1554,7 +1556,7 @@ xfs_qm_dqiter_bufs(
                bno++;
                firstid += XFS_QM_DQPERBLK(mp);
        }
-       return (error);
+       return error;
 }
 
 /*
@@ -1583,7 +1585,7 @@ xfs_qm_dqiterate(
         * happens only at mount time which is single threaded.
         */
        if (qip->i_d.di_nblocks == 0)
-               return (0);
+               return 0;
 
        map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP);
 
@@ -1652,7 +1654,7 @@ xfs_qm_dqiterate(
 
        kmem_free(map, XFS_DQITER_MAP_SIZE * sizeof(*map));
 
-       return (error);
+       return error;
 }
 
 /*
@@ -1712,7 +1714,7 @@ xfs_qm_get_rtblks(
        ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
        if (!(ifp->if_flags & XFS_IFEXTENTS)) {
                if ((error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK)))
-                       return (error);
+                       return error;
        }
        rtblks = 0;
        nextents = ifp->if_bytes / sizeof(xfs_bmbt_rec_t);
@@ -1720,7 +1722,7 @@ xfs_qm_get_rtblks(
        for (ep = base; ep < &base[nextents]; ep++)
                rtblks += xfs_bmbt_get_blockcount(ep);
        *O_rtblks = (xfs_qcnt_t)rtblks;
-       return (0);
+       return 0;
 }
 
 /*
@@ -1764,7 +1766,7 @@ xfs_qm_dqusage_adjust(
         */
        if ((error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip, bno))) {
                *res = BULKSTAT_RV_NOTHING;
-               return (error);
+               return error;
        }
 
        if (ip->i_d.di_mode == 0) {
@@ -1782,7 +1784,7 @@ xfs_qm_dqusage_adjust(
        if ((error = xfs_qm_dqget_noattach(ip, &udqp, &gdqp))) {
                xfs_iput(ip, XFS_ILOCK_EXCL);
                *res = BULKSTAT_RV_GIVEUP;
-               return (error);
+               return error;
        }
 
        rtblks = 0;
@@ -1799,7 +1801,7 @@ xfs_qm_dqusage_adjust(
                        if (gdqp)
                                xfs_qm_dqput(gdqp);
                        *res = BULKSTAT_RV_GIVEUP;
-                       return (error);
+                       return error;
                }
                nblks = (xfs_qcnt_t)ip->i_d.di_nblocks - rtblks;
        }
@@ -1844,7 +1846,7 @@ xfs_qm_dqusage_adjust(
         * Goto next inode.
         */
        *res = BULKSTAT_RV_DIDONE;
-       return (0);
+       return 0;
 }
 
 /*
@@ -1917,9 +1919,7 @@ xfs_qm_quotacheck(
         * at this point (because we intentionally didn't in dqget_noattach).
         */
        if (error) {
-               xfs_qm_dqpurge_all(mp,
-                                  XFS_QMOPT_UQUOTA|XFS_QMOPT_GQUOTA|
-                                  XFS_QMOPT_PQUOTA|XFS_QMOPT_QUOTAOFF);
+               xfs_qm_dqpurge_all(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_QUOTAOFF);
                goto error_return;
        }
        /*
@@ -2040,7 +2040,7 @@ xfs_qm_init_quotainos(
        XFS_QI_UQIP(mp) = uip;
        XFS_QI_GQIP(mp) = gip;
 
-       return (0);
+       return 0;
 }
 
 
@@ -2061,7 +2061,7 @@ xfs_qm_shake_freelist(
        int             nflushes;
 
        if (howmany <= 0)
-               return (0);
+               return 0;
 
        nreclaimed = 0;
        restarts = 0;
@@ -2087,7 +2087,7 @@ xfs_qm_shake_freelist(
                        xfs_dqunlock(dqp);
                        xfs_qm_freelist_unlock(xfs_Gqm);
                        if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-                               return (nreclaimed);
+                               return nreclaimed;
                        XQM_STATS_INC(xqmstats.xs_qm_dqwants);
                        goto tryagain;
                }
@@ -2162,7 +2162,7 @@ xfs_qm_shake_freelist(
                        XFS_DQ_HASH_UNLOCK(hash);
                        xfs_qm_freelist_unlock(xfs_Gqm);
                        if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-                               return (nreclaimed);
+                               return nreclaimed;
                        goto tryagain;
                }
                xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
@@ -2187,7 +2187,7 @@ xfs_qm_shake_freelist(
                dqp = nextdqp;
        }
        xfs_qm_freelist_unlock(xfs_Gqm);
-       return (nreclaimed);
+       return nreclaimed;
 }
 
 
@@ -2196,14 +2196,14 @@ xfs_qm_shake_freelist(
  */
 /* ARGSUSED */
 STATIC int
-xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask)
+xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)
 {
        int     ndqused, nfree, n;
 
        if (!kmem_shake_allow(gfp_mask))
-               return (0);
+               return 0;
        if (!xfs_Gqm)
-               return (0);
+               return 0;
 
        nfree = xfs_Gqm->qm_dqfreelist.qh_nelems; /* free dquots */
        /* incore dquots in all f/s's */
@@ -2212,7 +2212,7 @@ xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask)
        ASSERT(ndqused >= 0);
 
        if (nfree <= ndqused && nfree < ndquot)
-               return (0);
+               return 0;
 
        ndqused *= xfs_Gqm->qm_dqfree_ratio;    /* target # of free dquots */
        n = nfree - ndqused - ndquot;           /* # over target */
@@ -2256,7 +2256,7 @@ xfs_qm_dqreclaim_one(void)
                        xfs_dqunlock(dqp);
                        xfs_qm_freelist_unlock(xfs_Gqm);
                        if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-                               return (NULL);
+                               return NULL;
                        XQM_STATS_INC(xqmstats.xs_qm_dqwants);
                        goto startagain;
                }
@@ -2332,7 +2332,7 @@ xfs_qm_dqreclaim_one(void)
        }
 
        xfs_qm_freelist_unlock(xfs_Gqm);
-       return (dqpout);
+       return dqpout;
 }
 
 
@@ -2368,7 +2368,7 @@ xfs_qm_dqalloc_incore(
                         */
                        memset(&dqp->q_core, 0, sizeof(dqp->q_core));
                        *O_dqpp = dqp;
-                       return (B_FALSE);
+                       return B_FALSE;
                }
                XQM_STATS_INC(xqmstats.xs_qm_dqreclaim_misses);
        }
@@ -2381,7 +2381,7 @@ xfs_qm_dqalloc_incore(
        *O_dqpp = kmem_zone_zalloc(xfs_Gqm->qm_dqzone, KM_SLEEP);
        atomic_inc(&xfs_Gqm->qm_totaldquots);
 
-       return (B_TRUE);
+       return B_TRUE;
 }
 
 
@@ -2406,13 +2406,13 @@ xfs_qm_write_sb_changes(
                                      0,
                                      XFS_DEFAULT_LOG_COUNT))) {
                xfs_trans_cancel(tp, 0);
-               return (error);
+               return error;
        }
 
        xfs_mod_sb(tp, flags);
        (void) xfs_trans_commit(tp, 0, NULL);
 
-       return (0);
+       return 0;
 }
 
 
@@ -2462,7 +2462,7 @@ xfs_qm_vop_dqalloc(
                if ((error = xfs_qm_dqattach(ip, XFS_QMOPT_DQALLOC |
                                            XFS_QMOPT_ILOCKED))) {
                        xfs_iunlock(ip, lockflags);
-                       return (error);
+                       return error;
                }
        }
 
@@ -2485,7 +2485,7 @@ xfs_qm_vop_dqalloc(
                                                 XFS_QMOPT_DOWARN,
                                                 &uq))) {
                                ASSERT(error != ENOENT);
-                               return (error);
+                               return error;
                        }
                        /*
                         * Get the ilock in the right order.
@@ -2516,7 +2516,7 @@ xfs_qm_vop_dqalloc(
                                if (uq)
                                        xfs_qm_dqrele(uq);
                                ASSERT(error != ENOENT);
-                               return (error);
+                               return error;
                        }
                        xfs_dqunlock(gq);
                        lockflags = XFS_ILOCK_SHARED;
@@ -2564,7 +2564,7 @@ xfs_qm_vop_dqalloc(
                *O_gdqpp = gq;
        else if (gq)
                xfs_qm_dqrele(gq);
-       return (0);
+       return 0;
 }
 
 /*
@@ -2607,7 +2607,7 @@ xfs_qm_vop_chown(
        xfs_dqunlock(newdq);
        *IO_olddq = newdq;
 
-       return (prevdq);
+       return prevdq;
 }
 
 /*
@@ -2701,12 +2701,12 @@ xfs_qm_vop_rename_dqattach(
        ip = i_tab[0];
 
        if (! XFS_IS_QUOTA_ON(ip->i_mount))
-               return (0);
+               return 0;
 
        if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) {
                error = xfs_qm_dqattach(ip, 0);
                if (error)
-                       return (error);
+                       return error;
        }
        for (i = 1; (i < 4 && i_tab[i]); i++) {
                /*
@@ -2716,11 +2716,11 @@ xfs_qm_vop_rename_dqattach(
                        if (XFS_NOT_DQATTACHED(ip->i_mount, ip)) {
                                error = xfs_qm_dqattach(ip, 0);
                                if (error)
-                                       return (error);
+                                       return error;
                        }
                }
        }
-       return (0);
+       return 0;
 }
 
 void
@@ -2742,6 +2742,7 @@ xfs_qm_vop_dqattach_and_dqmod_newinode(
                xfs_dqunlock(udqp);
                ASSERT(ip->i_udquot == NULL);
                ip->i_udquot = udqp;
+               ASSERT(XFS_IS_UQUOTA_ON(tp->t_mountp));
                ASSERT(ip->i_d.di_uid == be32_to_cpu(udqp->q_core.d_id));
                xfs_trans_mod_dquot(tp, udqp, XFS_TRANS_DQ_ICOUNT, 1);
        }
@@ -2751,7 +2752,10 @@ xfs_qm_vop_dqattach_and_dqmod_newinode(
                xfs_dqunlock(gdqp);
                ASSERT(ip->i_gdquot == NULL);
                ip->i_gdquot = gdqp;
-               ASSERT(ip->i_d.di_gid == be32_to_cpu(gdqp->q_core.d_id));
+               ASSERT(XFS_IS_OQUOTA_ON(tp->t_mountp));
+               ASSERT((XFS_IS_GQUOTA_ON(tp->t_mountp) ?
+                       ip->i_d.di_gid : ip->i_d.di_projid) ==
+                               be32_to_cpu(gdqp->q_core.d_id));
                xfs_trans_mod_dquot(tp, gdqp, XFS_TRANS_DQ_ICOUNT, 1);
        }
 }
@@ -2761,7 +2765,7 @@ STATIC void
 xfs_qm_freelist_init(xfs_frlist_t *ql)
 {
        ql->qh_next = ql->qh_prev = (xfs_dquot_t *) ql;
-       mutex_init(&ql->qh_lock, MUTEX_DEFAULT, "dqf");
+       mutex_init(&ql->qh_lock);
        ql->qh_version = 0;
        ql->qh_nelems = 0;
 }
@@ -2771,7 +2775,7 @@ xfs_qm_freelist_destroy(xfs_frlist_t *ql)
 {
        xfs_dquot_t     *dqp, *nextdqp;
 
-       mutex_lock(&ql->qh_lock, PINOD);
+       mutex_lock(&ql->qh_lock);
        for (dqp = ql->qh_next;
             dqp != (xfs_dquot_t *)ql; ) {
                xfs_dqlock(dqp);
@@ -2829,7 +2833,7 @@ xfs_qm_dqhashlock_nowait(
        int locked;
 
        locked = mutex_trylock(&((dqp)->q_hash->qh_lock));
-       return (locked);
+       return locked;
 }
 
 int
@@ -2839,7 +2843,7 @@ xfs_qm_freelist_lock_nowait(
        int locked;
 
        locked = mutex_trylock(&(xqm->qm_dqfreelist.qh_lock));
-       return (locked);
+       return locked;
 }
 
 STATIC int
@@ -2850,5 +2854,5 @@ xfs_qm_mplist_nowait(
 
        ASSERT(mp->m_quotainfo);
        locked = mutex_trylock(&(XFS_QI_MPLLOCK(mp)));
-       return (locked);
+       return locked;
 }