Skip to content

Commit

Permalink
xfs: remove the dead QUOTADEBUG code
Browse files Browse the repository at this point in the history
Remove the dead hash table test rid which has been rotting away under
QUOTADEBUG, including some code that was compiled for normal debug
builds, but not actually called without QUOTADEBUG, and enable a few
cheap debug checks that were hidden under QUOTADEBUG for normal
debug builds.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
  • Loading branch information
Christoph Hellwig committed Jul 13, 2011
1 parent 54244fe commit ea15ab3
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 466 deletions.
42 changes: 2 additions & 40 deletions fs/xfs/quota/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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) >=
Expand Down Expand Up @@ -1423,45 +1424,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.
Expand Down
6 changes: 0 additions & 6 deletions fs/xfs/quota/xfs_dquot.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
(XFS_IS_UQUOTA_ON((d)->q_mount)) : \
(XFS_IS_OQUOTA_ON((d)->q_mount))))

#ifdef QUOTADEBUG
extern void xfs_qm_dqprint(xfs_dquot_t *);
#else
#define xfs_qm_dqprint(a)
#endif

extern void xfs_qm_dqdestroy(xfs_dquot_t *);
extern int xfs_qm_dqflush(xfs_dquot_t *, uint);
extern int xfs_qm_dqpurge(xfs_dquot_t *);
Expand Down
49 changes: 2 additions & 47 deletions fs/xfs/quota/xfs_qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,6 @@ static struct shrinker xfs_qm_shaker = {
.seeks = DEFAULT_SEEKS,
};

#ifdef DEBUG
extern struct mutex qcheck_lock;
#endif

#ifdef QUOTADEBUG
static void
xfs_qm_dquot_list_print(
struct xfs_mount *mp)
{
xfs_dquot_t *dqp;
int i = 0;

list_for_each_entry(dqp, &mp->m_quotainfo->qi_dqlist_lock, qi_mplist) {
xfs_debug(mp, " %d. \"%d (%s)\" "
"bcnt = %lld, icnt = %lld, refs = %d",
i++, be32_to_cpu(dqp->q_core.d_id),
DQFLAGTO_TYPESTR(dqp),
(long long)be64_to_cpu(dqp->q_core.d_bcount),
(long long)be64_to_cpu(dqp->q_core.d_icount),
dqp->q_nrefs);
}
}
#else
static void xfs_qm_dquot_list_print(struct xfs_mount *mp) { }
#endif

/*
* Initialize the XQM structure.
* Note that there is not one quota manager per file system.
Expand Down Expand Up @@ -165,9 +139,6 @@ xfs_Gqm_init(void)
atomic_set(&xqm->qm_totaldquots, 0);
xqm->qm_dqfree_ratio = XFS_QM_DQFREE_RATIO;
xqm->qm_nrefs = 0;
#ifdef DEBUG
mutex_init(&qcheck_lock);
#endif
return xqm;

out_free_udqhash:
Expand Down Expand Up @@ -204,19 +175,13 @@ xfs_qm_destroy(
mutex_lock(&xqm->qm_dqfrlist_lock);
list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) {
xfs_dqlock(dqp);
#ifdef QUOTADEBUG
xfs_debug(dqp->q_mount, "FREELIST destroy 0x%p", dqp);
#endif
list_del_init(&dqp->q_freelist);
xfs_Gqm->qm_dqfrlist_cnt--;
xfs_dqunlock(dqp);
xfs_qm_dqdestroy(dqp);
}
mutex_unlock(&xqm->qm_dqfrlist_lock);
mutex_destroy(&xqm->qm_dqfrlist_lock);
#ifdef DEBUG
mutex_destroy(&qcheck_lock);
#endif
kmem_free(xqm);
}

Expand Down Expand Up @@ -409,11 +374,6 @@ xfs_qm_mount_quotas(
xfs_warn(mp, "Failed to initialize disk quotas.");
return;
}

#ifdef QUOTADEBUG
if (XFS_IS_QUOTA_ON(mp))
xfs_qm_internalqcheck(mp);
#endif
}

/*
Expand Down Expand Up @@ -866,8 +826,8 @@ xfs_qm_dqattach_locked(
}

done:
#ifdef QUOTADEBUG
if (! error) {
#ifdef DEBUG
if (!error) {
if (XFS_IS_UQUOTA_ON(mp))
ASSERT(ip->i_udquot);
if (XFS_IS_OQUOTA_ON(mp))
Expand Down Expand Up @@ -1733,8 +1693,6 @@ xfs_qm_quotacheck(
mp->m_qflags &= ~(XFS_OQUOTA_CHKD | XFS_UQUOTA_CHKD);
mp->m_qflags |= flags;

xfs_qm_dquot_list_print(mp);

error_return:
if (error) {
xfs_warn(mp,
Expand Down Expand Up @@ -2096,9 +2054,6 @@ xfs_qm_write_sb_changes(
xfs_trans_t *tp;
int error;

#ifdef QUOTADEBUG
xfs_notice(mp, "Writing superblock quota changes");
#endif
tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
if ((error = xfs_trans_reserve(tp, 0,
mp->m_sb.sb_sectsize + 128, 0,
Expand Down
6 changes: 0 additions & 6 deletions fs/xfs/quota/xfs_qm.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,4 @@ extern int xfs_qm_scall_getqstat(xfs_mount_t *, fs_quota_stat_t *);
extern int xfs_qm_scall_quotaon(xfs_mount_t *, uint);
extern int xfs_qm_scall_quotaoff(xfs_mount_t *, uint);

#ifdef DEBUG
extern int xfs_qm_internalqcheck(xfs_mount_t *);
#else
#define xfs_qm_internalqcheck(mp) (0)
#endif

#endif /* __XFS_QM_H__ */
Loading

0 comments on commit ea15ab3

Please sign in to comment.