aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-03-06 18:08:35 -0500
committerDave Chinner <david@fromorbit.com>2011-03-06 18:08:35 -0500
commit0b932cccbdc09a72aa370456a59b40ecd6b10baf (patch)
treee13910b0589804e7e56e765e931c781829bafe8c /fs/xfs/quota
parent8221112b4377a3b69f2016b5cc3c550d51dd3139 (diff)
xfs: Convert remaining cmn_err() callers to new API
Once converted, kill the remainder of the cmn_err() interface. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r--fs/xfs/quota/xfs_dquot.c34
-rw-r--r--fs/xfs/quota/xfs_qm.c27
-rw-r--r--fs/xfs/quota/xfs_qm_bhv.c3
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c58
-rw-r--r--fs/xfs/quota/xfs_trans_dquot.c5
5 files changed, 65 insertions, 62 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index e1ff7e50767..7e241647850 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -828,7 +828,7 @@ xfs_qm_dqget(
828 if (xfs_do_dqerror) { 828 if (xfs_do_dqerror) {
829 if ((xfs_dqerror_target == mp->m_ddev_targp) && 829 if ((xfs_dqerror_target == mp->m_ddev_targp) &&
830 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { 830 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) {
831 cmn_err(CE_DEBUG, "Returning error in dqget"); 831 xfs_debug(mp, "Returning error in dqget");
832 return (EIO); 832 return (EIO);
833 } 833 }
834 } 834 }
@@ -1427,36 +1427,38 @@ xfs_qm_dqpurge(
1427void 1427void
1428xfs_qm_dqprint(xfs_dquot_t *dqp) 1428xfs_qm_dqprint(xfs_dquot_t *dqp)
1429{ 1429{
1430 cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------"); 1430 struct xfs_mount *mp = dqp->q_mount;
1431 cmn_err(CE_DEBUG, "---- dquotID = %d", 1431
1432 xfs_debug(mp, "-----------KERNEL DQUOT----------------");
1433 xfs_debug(mp, "---- dquotID = %d",
1432 (int)be32_to_cpu(dqp->q_core.d_id)); 1434 (int)be32_to_cpu(dqp->q_core.d_id));
1433 cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); 1435 xfs_debug(mp, "---- type = %s", DQFLAGTO_TYPESTR(dqp));
1434 cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount); 1436 xfs_debug(mp, "---- fs = 0x%p", dqp->q_mount);
1435 cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno); 1437 xfs_debug(mp, "---- blkno = 0x%x", (int) dqp->q_blkno);
1436 cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset); 1438 xfs_debug(mp, "---- boffset = 0x%x", (int) dqp->q_bufoffset);
1437 cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)", 1439 xfs_debug(mp, "---- blkhlimit = %Lu (0x%x)",
1438 be64_to_cpu(dqp->q_core.d_blk_hardlimit), 1440 be64_to_cpu(dqp->q_core.d_blk_hardlimit),
1439 (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit)); 1441 (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit));
1440 cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)", 1442 xfs_debug(mp, "---- blkslimit = %Lu (0x%x)",
1441 be64_to_cpu(dqp->q_core.d_blk_softlimit), 1443 be64_to_cpu(dqp->q_core.d_blk_softlimit),
1442 (int)be64_to_cpu(dqp->q_core.d_blk_softlimit)); 1444 (int)be64_to_cpu(dqp->q_core.d_blk_softlimit));
1443 cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)", 1445 xfs_debug(mp, "---- inohlimit = %Lu (0x%x)",
1444 be64_to_cpu(dqp->q_core.d_ino_hardlimit), 1446 be64_to_cpu(dqp->q_core.d_ino_hardlimit),
1445 (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit)); 1447 (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit));
1446 cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)", 1448 xfs_debug(mp, "---- inoslimit = %Lu (0x%x)",
1447 be64_to_cpu(dqp->q_core.d_ino_softlimit), 1449 be64_to_cpu(dqp->q_core.d_ino_softlimit),
1448 (int)be64_to_cpu(dqp->q_core.d_ino_softlimit)); 1450 (int)be64_to_cpu(dqp->q_core.d_ino_softlimit));
1449 cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", 1451 xfs_debug(mp, "---- bcount = %Lu (0x%x)",
1450 be64_to_cpu(dqp->q_core.d_bcount), 1452 be64_to_cpu(dqp->q_core.d_bcount),
1451 (int)be64_to_cpu(dqp->q_core.d_bcount)); 1453 (int)be64_to_cpu(dqp->q_core.d_bcount));
1452 cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", 1454 xfs_debug(mp, "---- icount = %Lu (0x%x)",
1453 be64_to_cpu(dqp->q_core.d_icount), 1455 be64_to_cpu(dqp->q_core.d_icount),
1454 (int)be64_to_cpu(dqp->q_core.d_icount)); 1456 (int)be64_to_cpu(dqp->q_core.d_icount));
1455 cmn_err(CE_DEBUG, "---- btimer = %d", 1457 xfs_debug(mp, "---- btimer = %d",
1456 (int)be32_to_cpu(dqp->q_core.d_btimer)); 1458 (int)be32_to_cpu(dqp->q_core.d_btimer));
1457 cmn_err(CE_DEBUG, "---- itimer = %d", 1459 xfs_debug(mp, "---- itimer = %d",
1458 (int)be32_to_cpu(dqp->q_core.d_itimer)); 1460 (int)be32_to_cpu(dqp->q_core.d_itimer));
1459 cmn_err(CE_DEBUG, "---------------------------"); 1461 xfs_debug(mp, "---------------------------");
1460} 1462}
1461#endif 1463#endif
1462 1464
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index e34dce1ce54..254ee062bd7 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -80,7 +80,7 @@ xfs_qm_dquot_list_print(
80 int i = 0; 80 int i = 0;
81 81
82 list_for_each_entry(dqp, &mp->m_quotainfo->qi_dqlist_lock, qi_mplist) { 82 list_for_each_entry(dqp, &mp->m_quotainfo->qi_dqlist_lock, qi_mplist) {
83 cmn_err(CE_DEBUG, " %d. \"%d (%s)\" " 83 xfs_debug(mp, " %d. \"%d (%s)\" "
84 "bcnt = %lld, icnt = %lld, refs = %d", 84 "bcnt = %lld, icnt = %lld, refs = %d",
85 i++, be32_to_cpu(dqp->q_core.d_id), 85 i++, be32_to_cpu(dqp->q_core.d_id),
86 DQFLAGTO_TYPESTR(dqp), 86 DQFLAGTO_TYPESTR(dqp),
@@ -205,7 +205,7 @@ xfs_qm_destroy(
205 list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) { 205 list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) {
206 xfs_dqlock(dqp); 206 xfs_dqlock(dqp);
207#ifdef QUOTADEBUG 207#ifdef QUOTADEBUG
208 cmn_err(CE_DEBUG, "FREELIST destroy 0x%p", dqp); 208 xfs_debug(dqp->q_mount, "FREELIST destroy 0x%p", dqp);
209#endif 209#endif
210 list_del_init(&dqp->q_freelist); 210 list_del_init(&dqp->q_freelist);
211 xfs_Gqm->qm_dqfrlist_cnt--; 211 xfs_Gqm->qm_dqfrlist_cnt--;
@@ -341,9 +341,7 @@ xfs_qm_mount_quotas(
341 * quotas immediately. 341 * quotas immediately.
342 */ 342 */
343 if (mp->m_sb.sb_rextents) { 343 if (mp->m_sb.sb_rextents) {
344 cmn_err(CE_NOTE, 344 xfs_notice(mp, "Cannot turn on quotas for realtime filesystem");
345 "Cannot turn on quotas for realtime filesystem %s",
346 mp->m_fsname);
347 mp->m_qflags = 0; 345 mp->m_qflags = 0;
348 goto write_changes; 346 goto write_changes;
349 } 347 }
@@ -1668,7 +1666,7 @@ xfs_qm_quotacheck(
1668 */ 1666 */
1669 ASSERT(list_empty(&mp->m_quotainfo->qi_dqlist)); 1667 ASSERT(list_empty(&mp->m_quotainfo->qi_dqlist));
1670 1668
1671 cmn_err(CE_NOTE, "XFS quotacheck %s: Please wait.", mp->m_fsname); 1669 xfs_notice(mp, "Quotacheck needed: Please wait.");
1672 1670
1673 /* 1671 /*
1674 * First we go thru all the dquots on disk, USR and GRP/PRJ, and reset 1672 * First we go thru all the dquots on disk, USR and GRP/PRJ, and reset
@@ -1746,9 +1744,9 @@ xfs_qm_quotacheck(
1746 1744
1747 error_return: 1745 error_return:
1748 if (error) { 1746 if (error) {
1749 cmn_err(CE_WARN, "XFS quotacheck %s: Unsuccessful (Error %d): " 1747 xfs_warn(mp,
1750 "Disabling quotas.", 1748 "Quotacheck: Unsuccessful (Error %d): Disabling quotas.",
1751 mp->m_fsname, error); 1749 error);
1752 /* 1750 /*
1753 * We must turn off quotas. 1751 * We must turn off quotas.
1754 */ 1752 */
@@ -1756,12 +1754,11 @@ xfs_qm_quotacheck(
1756 ASSERT(xfs_Gqm != NULL); 1754 ASSERT(xfs_Gqm != NULL);
1757 xfs_qm_destroy_quotainfo(mp); 1755 xfs_qm_destroy_quotainfo(mp);
1758 if (xfs_mount_reset_sbqflags(mp)) { 1756 if (xfs_mount_reset_sbqflags(mp)) {
1759 cmn_err(CE_WARN, "XFS quotacheck %s: " 1757 xfs_warn(mp,
1760 "Failed to reset quota flags.", mp->m_fsname); 1758 "Quotacheck: Failed to reset quota flags.");
1761 } 1759 }
1762 } else { 1760 } else
1763 cmn_err(CE_NOTE, "XFS quotacheck %s: Done.", mp->m_fsname); 1761 xfs_notice(mp, "Quotacheck: Done.");
1764 }
1765 return (error); 1762 return (error);
1766} 1763}
1767 1764
@@ -2107,7 +2104,7 @@ xfs_qm_write_sb_changes(
2107 int error; 2104 int error;
2108 2105
2109#ifdef QUOTADEBUG 2106#ifdef QUOTADEBUG
2110 cmn_err(CE_NOTE, "Writing superblock quota changes :%s", mp->m_fsname); 2107 xfs_notice(mp, "Writing superblock quota changes");
2111#endif 2108#endif
2112 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); 2109 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
2113 if ((error = xfs_trans_reserve(tp, 0, 2110 if ((error = xfs_trans_reserve(tp, 0,
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c
index 45b5cb1788a..774d7ec6df8 100644
--- a/fs/xfs/quota/xfs_qm_bhv.c
+++ b/fs/xfs/quota/xfs_qm_bhv.c
@@ -119,8 +119,7 @@ xfs_qm_newmount(
119 (gquotaondisk && !XFS_IS_GQUOTA_ON(mp)) || 119 (gquotaondisk && !XFS_IS_GQUOTA_ON(mp)) ||
120 (!gquotaondisk && XFS_IS_OQUOTA_ON(mp))) && 120 (!gquotaondisk && XFS_IS_OQUOTA_ON(mp))) &&
121 xfs_dev_is_read_only(mp, "changing quota state")) { 121 xfs_dev_is_read_only(mp, "changing quota state")) {
122 cmn_err(CE_WARN, 122 xfs_warn(mp, "please mount with%s%s%s%s.",
123 "XFS: please mount with%s%s%s%s.",
124 (!quotaondisk ? "out quota" : ""), 123 (!quotaondisk ? "out quota" : ""),
125 (uquotaondisk ? " usrquota" : ""), 124 (uquotaondisk ? " usrquota" : ""),
126 (pquotaondisk ? " prjquota" : ""), 125 (pquotaondisk ? " prjquota" : ""),
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index 603ab867259..c82f06778a2 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -936,10 +936,11 @@ struct mutex qcheck_lock;
936#define DQTEST_LIST_PRINT(l, NXT, title) \ 936#define DQTEST_LIST_PRINT(l, NXT, title) \
937{ \ 937{ \
938 xfs_dqtest_t *dqp; int i = 0;\ 938 xfs_dqtest_t *dqp; int i = 0;\
939 cmn_err(CE_DEBUG, "%s (#%d)", title, (int) (l)->qh_nelems); \ 939 xfs_debug(NULL, "%s (#%d)", title, (int) (l)->qh_nelems); \
940 for (dqp = (xfs_dqtest_t *)(l)->qh_next; dqp != NULL; \ 940 for (dqp = (xfs_dqtest_t *)(l)->qh_next; dqp != NULL; \
941 dqp = (xfs_dqtest_t *)dqp->NXT) { \ 941 dqp = (xfs_dqtest_t *)dqp->NXT) { \
942 cmn_err(CE_DEBUG, " %d. \"%d (%s)\" bcnt = %d, icnt = %d", \ 942 xfs_debug(dqp->q_mount, \
943 " %d. \"%d (%s)\" bcnt = %d, icnt = %d", \
943 ++i, dqp->d_id, DQFLAGTO_TYPESTR(dqp), \ 944 ++i, dqp->d_id, DQFLAGTO_TYPESTR(dqp), \
944 dqp->d_bcount, dqp->d_icount); } \ 945 dqp->d_bcount, dqp->d_icount); } \
945} 946}
@@ -963,16 +964,17 @@ xfs_qm_hashinsert(xfs_dqhash_t *h, xfs_dqtest_t *dqp)
963} 964}
964STATIC void 965STATIC void
965xfs_qm_dqtest_print( 966xfs_qm_dqtest_print(
966 xfs_dqtest_t *d) 967 struct xfs_mount *mp,
968 struct dqtest *d)
967{ 969{
968 cmn_err(CE_DEBUG, "-----------DQTEST DQUOT----------------"); 970 xfs_debug(mp, "-----------DQTEST DQUOT----------------");
969 cmn_err(CE_DEBUG, "---- dquot ID = %d", d->d_id); 971 xfs_debug(mp, "---- dquot ID = %d", d->d_id);
970 cmn_err(CE_DEBUG, "---- fs = 0x%p", d->q_mount); 972 xfs_debug(mp, "---- fs = 0x%p", d->q_mount);
971 cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", 973 xfs_debug(mp, "---- bcount = %Lu (0x%x)",
972 d->d_bcount, (int)d->d_bcount); 974 d->d_bcount, (int)d->d_bcount);
973 cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", 975 xfs_debug(mp, "---- icount = %Lu (0x%x)",
974 d->d_icount, (int)d->d_icount); 976 d->d_icount, (int)d->d_icount);
975 cmn_err(CE_DEBUG, "---------------------------"); 977 xfs_debug(mp, "---------------------------");
976} 978}
977 979
978STATIC void 980STATIC void
@@ -986,12 +988,14 @@ xfs_qm_dqtest_failed(
986{ 988{
987 qmtest_nfails++; 989 qmtest_nfails++;
988 if (error) 990 if (error)
989 cmn_err(CE_DEBUG, "quotacheck failed id=%d, err=%d\nreason: %s", 991 xfs_debug(dqp->q_mount,
990 d->d_id, error, reason); 992 "quotacheck failed id=%d, err=%d\nreason: %s",
993 d->d_id, error, reason);
991 else 994 else
992 cmn_err(CE_DEBUG, "quotacheck failed id=%d (%s) [%d != %d]", 995 xfs_debug(dqp->q_mount,
993 d->d_id, reason, (int)a, (int)b); 996 "quotacheck failed id=%d (%s) [%d != %d]",
994 xfs_qm_dqtest_print(d); 997 d->d_id, reason, (int)a, (int)b);
998 xfs_qm_dqtest_print(dqp->q_mount, d);
995 if (dqp) 999 if (dqp)
996 xfs_qm_dqprint(dqp); 1000 xfs_qm_dqprint(dqp);
997} 1001}
@@ -1018,9 +1022,9 @@ xfs_dqtest_cmp2(
1018 be64_to_cpu(dqp->q_core.d_bcount) >= 1022 be64_to_cpu(dqp->q_core.d_bcount) >=
1019 be64_to_cpu(dqp->q_core.d_blk_softlimit)) { 1023 be64_to_cpu(dqp->q_core.d_blk_softlimit)) {
1020 if (!dqp->q_core.d_btimer && dqp->q_core.d_id) { 1024 if (!dqp->q_core.d_btimer && dqp->q_core.d_id) {
1021 cmn_err(CE_DEBUG, 1025 xfs_debug(dqp->q_mount,
1022 "%d [%s] [0x%p] BLK TIMER NOT STARTED", 1026 "%d [%s] BLK TIMER NOT STARTED",
1023 d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); 1027 d->d_id, DQFLAGTO_TYPESTR(d));
1024 err++; 1028 err++;
1025 } 1029 }
1026 } 1030 }
@@ -1028,16 +1032,16 @@ xfs_dqtest_cmp2(
1028 be64_to_cpu(dqp->q_core.d_icount) >= 1032 be64_to_cpu(dqp->q_core.d_icount) >=
1029 be64_to_cpu(dqp->q_core.d_ino_softlimit)) { 1033 be64_to_cpu(dqp->q_core.d_ino_softlimit)) {
1030 if (!dqp->q_core.d_itimer && dqp->q_core.d_id) { 1034 if (!dqp->q_core.d_itimer && dqp->q_core.d_id) {
1031 cmn_err(CE_DEBUG, 1035 xfs_debug(dqp->q_mount,
1032 "%d [%s] [0x%p] INO TIMER NOT STARTED", 1036 "%d [%s] INO TIMER NOT STARTED",
1033 d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); 1037 d->d_id, DQFLAGTO_TYPESTR(d));
1034 err++; 1038 err++;
1035 } 1039 }
1036 } 1040 }
1037#ifdef QUOTADEBUG 1041#ifdef QUOTADEBUG
1038 if (!err) { 1042 if (!err) {
1039 cmn_err(CE_DEBUG, "%d [%s] [0x%p] qchecked", 1043 xfs_debug(dqp->q_mount, "%d [%s] qchecked",
1040 d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); 1044 d->d_id, DQFLAGTO_TYPESTR(d));
1041 } 1045 }
1042#endif 1046#endif
1043 return (err); 1047 return (err);
@@ -1220,12 +1224,12 @@ xfs_qm_internalqcheck(
1220 xfs_qm_internalqcheck_adjust, 1224 xfs_qm_internalqcheck_adjust,
1221 0, NULL, &done); 1225 0, NULL, &done);
1222 if (error) { 1226 if (error) {
1223 cmn_err(CE_DEBUG, "Bulkstat returned error 0x%x", error); 1227 xfs_debug(mp, "Bulkstat returned error 0x%x", error);
1224 break; 1228 break;
1225 } 1229 }
1226 } while (!done); 1230 } while (!done);
1227 1231
1228 cmn_err(CE_DEBUG, "Checking results against system dquots"); 1232 xfs_debug(mp, "Checking results against system dquots");
1229 for (i = 0; i < qmtest_hashmask; i++) { 1233 for (i = 0; i < qmtest_hashmask; i++) {
1230 xfs_dqtest_t *d, *n; 1234 xfs_dqtest_t *d, *n;
1231 xfs_dqhash_t *h; 1235 xfs_dqhash_t *h;
@@ -1243,10 +1247,10 @@ xfs_qm_internalqcheck(
1243 } 1247 }
1244 1248
1245 if (qmtest_nfails) { 1249 if (qmtest_nfails) {
1246 cmn_err(CE_DEBUG, "******** quotacheck failed ********"); 1250 xfs_debug(mp, "******** quotacheck failed ********");
1247 cmn_err(CE_DEBUG, "failures = %d", qmtest_nfails); 1251 xfs_debug(mp, "failures = %d", qmtest_nfails);
1248 } else { 1252 } else {
1249 cmn_err(CE_DEBUG, "******** quotacheck successful! ********"); 1253 xfs_debug(mp, "******** quotacheck successful! ********");
1250 } 1254 }
1251 kmem_free(qmtest_udqtab); 1255 kmem_free(qmtest_udqtab);
1252 kmem_free(qmtest_gdqtab); 1256 kmem_free(qmtest_gdqtab);
diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c
index 7de91d1b75c..2a364873133 100644
--- a/fs/xfs/quota/xfs_trans_dquot.c
+++ b/fs/xfs/quota/xfs_trans_dquot.c
@@ -643,8 +643,9 @@ xfs_trans_dqresv(
643 (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) && 643 (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) &&
644 (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) { 644 (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) {
645#ifdef QUOTADEBUG 645#ifdef QUOTADEBUG
646 cmn_err(CE_DEBUG, "BLK Res: nblks=%ld + resbcount=%Ld" 646 xfs_debug(mp,
647 " > hardlimit=%Ld?", nblks, *resbcountp, hardlimit); 647 "BLK Res: nblks=%ld + resbcount=%Ld > hardlimit=%Ld?",
648 nblks, *resbcountp, hardlimit);
648#endif 649#endif
649 if (nblks > 0) { 650 if (nblks > 0) {
650 /* 651 /*