]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/xfs/quota/xfs_dquot.c
xfs: Remove the macro XFS_BUF_PTR
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / quota / xfs_dquot.c
index 6fa214603819d759f8fbbd8e588a1a306ac78420..2e0629265f674aa96e15c5dea5e5714555b98b3c 100644 (file)
@@ -220,7 +220,7 @@ xfs_qm_adjust_dqtimers(
 {
        ASSERT(d->d_id);
 
-#ifdef QUOTADEBUG
+#ifdef DEBUG
        if (d->d_blk_hardlimit)
                ASSERT(be64_to_cpu(d->d_blk_softlimit) <=
                       be64_to_cpu(d->d_blk_hardlimit));
@@ -231,6 +231,7 @@ xfs_qm_adjust_dqtimers(
                ASSERT(be64_to_cpu(d->d_rtb_softlimit) <=
                       be64_to_cpu(d->d_rtb_hardlimit));
 #endif
+
        if (!d->d_btimer) {
                if ((d->d_blk_softlimit &&
                     (be64_to_cpu(d->d_bcount) >=
@@ -317,10 +318,9 @@ xfs_qm_init_dquot_blk(
        int             curid, i;
 
        ASSERT(tp);
-       ASSERT(XFS_BUF_ISBUSY(bp));
-       ASSERT(XFS_BUF_VALUSEMA(bp) <= 0);
+       ASSERT(xfs_buf_islocked(bp));
 
-       d = (xfs_dqblk_t *)XFS_BUF_PTR(bp);
+       d = bp->b_addr;
 
        /*
         * ID of the first dquot in the block - id's are zero based.
@@ -402,7 +402,7 @@ xfs_qm_dqalloc(
                               dqp->q_blkno,
                               mp->m_quotainfo->qi_dqchunklen,
                               0);
-       if (!bp || (error = XFS_BUF_GETERROR(bp)))
+       if (!bp || (error = xfs_buf_geterror(bp)))
                goto error1;
        /*
         * Make a chunk of dquots out of this buffer and log
@@ -533,13 +533,12 @@ xfs_qm_dqtobp(
                        return XFS_ERROR(error);
        }
 
-       ASSERT(XFS_BUF_ISBUSY(bp));
-       ASSERT(XFS_BUF_VALUSEMA(bp) <= 0);
+       ASSERT(xfs_buf_islocked(bp));
 
        /*
         * calculate the location of the dquot inside the buffer.
         */
-       ddq = (struct xfs_disk_dquot *)(XFS_BUF_PTR(bp) + dqp->q_bufoffset);
+       ddq = bp->b_addr + dqp->q_bufoffset;
 
        /*
         * A simple sanity check in case we got a corrupted dquot...
@@ -552,7 +551,6 @@ xfs_qm_dqtobp(
                        xfs_trans_brelse(tp, bp);
                        return XFS_ERROR(EIO);
                }
-               XFS_BUF_BUSY(bp); /* We dirtied this */
        }
 
        *O_bpp = bp;
@@ -621,8 +619,7 @@ xfs_qm_dqread(
         * this particular dquot was repaired. We still aren't afraid to
         * brelse it because we have the changes incore.
         */
-       ASSERT(XFS_BUF_ISBUSY(bp));
-       ASSERT(XFS_BUF_VALUSEMA(bp) <= 0);
+       ASSERT(xfs_buf_islocked(bp));
        xfs_trans_brelse(tp, bp);
 
        return (error);
@@ -1203,7 +1200,7 @@ xfs_qm_dqflush(
        /*
         * Calculate the location of the dquot inside the buffer.
         */
-       ddqp = (struct xfs_disk_dquot *)(XFS_BUF_PTR(bp) + dqp->q_bufoffset);
+       ddqp = bp->b_addr + dqp->q_bufoffset;
 
        /*
         * A simple sanity check in case we got a corrupted dquot..
@@ -1423,45 +1420,6 @@ xfs_qm_dqpurge(
 }
 
 
-#ifdef QUOTADEBUG
-void
-xfs_qm_dqprint(xfs_dquot_t *dqp)
-{
-       struct xfs_mount        *mp = dqp->q_mount;
-
-       xfs_debug(mp, "-----------KERNEL DQUOT----------------");
-       xfs_debug(mp, "---- dquotID =  %d",
-               (int)be32_to_cpu(dqp->q_core.d_id));
-       xfs_debug(mp, "---- type    =  %s", DQFLAGTO_TYPESTR(dqp));
-       xfs_debug(mp, "---- fs      =  0x%p", dqp->q_mount);
-       xfs_debug(mp, "---- blkno   =  0x%x", (int) dqp->q_blkno);
-       xfs_debug(mp, "---- boffset =  0x%x", (int) dqp->q_bufoffset);
-       xfs_debug(mp, "---- blkhlimit =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_blk_hardlimit),
-               (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit));
-       xfs_debug(mp, "---- blkslimit =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_blk_softlimit),
-               (int)be64_to_cpu(dqp->q_core.d_blk_softlimit));
-       xfs_debug(mp, "---- inohlimit =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_ino_hardlimit),
-               (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit));
-       xfs_debug(mp, "---- inoslimit =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_ino_softlimit),
-               (int)be64_to_cpu(dqp->q_core.d_ino_softlimit));
-       xfs_debug(mp, "---- bcount  =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_bcount),
-               (int)be64_to_cpu(dqp->q_core.d_bcount));
-       xfs_debug(mp, "---- icount  =  %Lu (0x%x)",
-               be64_to_cpu(dqp->q_core.d_icount),
-               (int)be64_to_cpu(dqp->q_core.d_icount));
-       xfs_debug(mp, "---- btimer  =  %d",
-               (int)be32_to_cpu(dqp->q_core.d_btimer));
-       xfs_debug(mp, "---- itimer  =  %d",
-               (int)be32_to_cpu(dqp->q_core.d_itimer));
-       xfs_debug(mp, "---------------------------");
-}
-#endif
-
 /*
  * Give the buffer a little push if it is incore and
  * wait on the flush lock.