diff options
author | Dave Chinner <dchinner@redhat.com> | 2011-03-06 18:08:35 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2011-03-06 18:08:35 -0500 |
commit | 0b932cccbdc09a72aa370456a59b40ecd6b10baf (patch) | |
tree | e13910b0589804e7e56e765e931c781829bafe8c /fs/xfs/xfs_mount.c | |
parent | 8221112b4377a3b69f2016b5cc3c550d51dd3139 (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/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index e39b082eb049..bb3f9a7b24ed 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -133,9 +133,7 @@ xfs_uuid_mount( | |||
133 | return 0; | 133 | return 0; |
134 | 134 | ||
135 | if (uuid_is_nil(uuid)) { | 135 | if (uuid_is_nil(uuid)) { |
136 | cmn_err(CE_WARN, | 136 | xfs_warn(mp, "Filesystem has nil UUID - can't mount"); |
137 | "XFS: Filesystem %s has nil UUID - can't mount", | ||
138 | mp->m_fsname); | ||
139 | return XFS_ERROR(EINVAL); | 137 | return XFS_ERROR(EINVAL); |
140 | } | 138 | } |
141 | 139 | ||
@@ -163,8 +161,7 @@ xfs_uuid_mount( | |||
163 | 161 | ||
164 | out_duplicate: | 162 | out_duplicate: |
165 | mutex_unlock(&xfs_uuid_table_mutex); | 163 | mutex_unlock(&xfs_uuid_table_mutex); |
166 | cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount", | 164 | xfs_warn(mp, "Filesystem has duplicate UUID - can't mount"); |
167 | mp->m_fsname); | ||
168 | return XFS_ERROR(EINVAL); | 165 | return XFS_ERROR(EINVAL); |
169 | } | 166 | } |
170 | 167 | ||
@@ -867,8 +864,7 @@ xfs_update_alignment(xfs_mount_t *mp) | |||
867 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || | 864 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || |
868 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { | 865 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { |
869 | if (mp->m_flags & XFS_MOUNT_RETERR) { | 866 | if (mp->m_flags & XFS_MOUNT_RETERR) { |
870 | cmn_err(CE_WARN, | 867 | xfs_warn(mp, "alignment check 1 failed"); |
871 | "XFS: alignment check 1 failed"); | ||
872 | return XFS_ERROR(EINVAL); | 868 | return XFS_ERROR(EINVAL); |
873 | } | 869 | } |
874 | mp->m_dalign = mp->m_swidth = 0; | 870 | mp->m_dalign = mp->m_swidth = 0; |
@@ -1041,14 +1037,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1041 | 1037 | ||
1042 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); | 1038 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); |
1043 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { | 1039 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { |
1044 | cmn_err(CE_WARN, "XFS: filesystem size mismatch detected"); | 1040 | xfs_warn(mp, "filesystem size mismatch detected"); |
1045 | return XFS_ERROR(EFBIG); | 1041 | return XFS_ERROR(EFBIG); |
1046 | } | 1042 | } |
1047 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, | 1043 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, |
1048 | d - XFS_FSS_TO_BB(mp, 1), | 1044 | d - XFS_FSS_TO_BB(mp, 1), |
1049 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); | 1045 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); |
1050 | if (!bp) { | 1046 | if (!bp) { |
1051 | cmn_err(CE_WARN, "XFS: last sector read failed"); | 1047 | xfs_warn(mp, "last sector read failed"); |
1052 | return EIO; | 1048 | return EIO; |
1053 | } | 1049 | } |
1054 | xfs_buf_relse(bp); | 1050 | xfs_buf_relse(bp); |
@@ -1056,14 +1052,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1056 | if (mp->m_logdev_targp != mp->m_ddev_targp) { | 1052 | if (mp->m_logdev_targp != mp->m_ddev_targp) { |
1057 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); | 1053 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); |
1058 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { | 1054 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { |
1059 | cmn_err(CE_WARN, "XFS: log size mismatch detected"); | 1055 | xfs_warn(mp, "log size mismatch detected"); |
1060 | return XFS_ERROR(EFBIG); | 1056 | return XFS_ERROR(EFBIG); |
1061 | } | 1057 | } |
1062 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, | 1058 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, |
1063 | d - XFS_FSB_TO_BB(mp, 1), | 1059 | d - XFS_FSB_TO_BB(mp, 1), |
1064 | XFS_FSB_TO_B(mp, 1), 0); | 1060 | XFS_FSB_TO_B(mp, 1), 0); |
1065 | if (!bp) { | 1061 | if (!bp) { |
1066 | cmn_err(CE_WARN, "XFS: log device read failed"); | 1062 | xfs_warn(mp, "log device read failed"); |
1067 | return EIO; | 1063 | return EIO; |
1068 | } | 1064 | } |
1069 | xfs_buf_relse(bp); | 1065 | xfs_buf_relse(bp); |
@@ -1175,8 +1171,7 @@ xfs_mountfs( | |||
1175 | * transaction subsystem is online. | 1171 | * transaction subsystem is online. |
1176 | */ | 1172 | */ |
1177 | if (xfs_sb_has_mismatched_features2(sbp)) { | 1173 | if (xfs_sb_has_mismatched_features2(sbp)) { |
1178 | cmn_err(CE_WARN, | 1174 | xfs_warn(mp, "correcting sb_features alignment problem"); |
1179 | "XFS: correcting sb_features alignment problem"); | ||
1180 | sbp->sb_features2 |= sbp->sb_bad_features2; | 1175 | sbp->sb_features2 |= sbp->sb_bad_features2; |
1181 | sbp->sb_bad_features2 = sbp->sb_features2; | 1176 | sbp->sb_bad_features2 = sbp->sb_features2; |
1182 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; | 1177 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; |
@@ -1255,7 +1250,7 @@ xfs_mountfs( | |||
1255 | */ | 1250 | */ |
1256 | error = xfs_rtmount_init(mp); | 1251 | error = xfs_rtmount_init(mp); |
1257 | if (error) { | 1252 | if (error) { |
1258 | cmn_err(CE_WARN, "XFS: RT mount failed"); | 1253 | xfs_warn(mp, "RT mount failed"); |
1259 | goto out_remove_uuid; | 1254 | goto out_remove_uuid; |
1260 | } | 1255 | } |
1261 | 1256 | ||
@@ -1286,12 +1281,12 @@ xfs_mountfs( | |||
1286 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); | 1281 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); |
1287 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); | 1282 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); |
1288 | if (error) { | 1283 | if (error) { |
1289 | cmn_err(CE_WARN, "XFS: Failed per-ag init: %d", error); | 1284 | xfs_warn(mp, "Failed per-ag init: %d", error); |
1290 | goto out_remove_uuid; | 1285 | goto out_remove_uuid; |
1291 | } | 1286 | } |
1292 | 1287 | ||
1293 | if (!sbp->sb_logblocks) { | 1288 | if (!sbp->sb_logblocks) { |
1294 | cmn_err(CE_WARN, "XFS: no log defined"); | 1289 | xfs_warn(mp, "no log defined"); |
1295 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); | 1290 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); |
1296 | error = XFS_ERROR(EFSCORRUPTED); | 1291 | error = XFS_ERROR(EFSCORRUPTED); |
1297 | goto out_free_perag; | 1292 | goto out_free_perag; |
@@ -1304,7 +1299,7 @@ xfs_mountfs( | |||
1304 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), | 1299 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), |
1305 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); | 1300 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); |
1306 | if (error) { | 1301 | if (error) { |
1307 | cmn_err(CE_WARN, "XFS: log mount failed"); | 1302 | xfs_warn(mp, "log mount failed"); |
1308 | goto out_free_perag; | 1303 | goto out_free_perag; |
1309 | } | 1304 | } |
1310 | 1305 | ||
@@ -1341,16 +1336,14 @@ xfs_mountfs( | |||
1341 | */ | 1336 | */ |
1342 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); | 1337 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); |
1343 | if (error) { | 1338 | if (error) { |
1344 | cmn_err(CE_WARN, "XFS: failed to read root inode"); | 1339 | xfs_warn(mp, "failed to read root inode"); |
1345 | goto out_log_dealloc; | 1340 | goto out_log_dealloc; |
1346 | } | 1341 | } |
1347 | 1342 | ||
1348 | ASSERT(rip != NULL); | 1343 | ASSERT(rip != NULL); |
1349 | 1344 | ||
1350 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { | 1345 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { |
1351 | cmn_err(CE_WARN, "XFS: corrupted root inode"); | 1346 | xfs_warn(mp, "corrupted root inode %llu: not a directory", |
1352 | cmn_err(CE_WARN, "Device %s - root %llu is not a directory", | ||
1353 | XFS_BUFTARG_NAME(mp->m_ddev_targp), | ||
1354 | (unsigned long long)rip->i_ino); | 1347 | (unsigned long long)rip->i_ino); |
1355 | xfs_iunlock(rip, XFS_ILOCK_EXCL); | 1348 | xfs_iunlock(rip, XFS_ILOCK_EXCL); |
1356 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, | 1349 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, |
@@ -1370,7 +1363,7 @@ xfs_mountfs( | |||
1370 | /* | 1363 | /* |
1371 | * Free up the root inode. | 1364 | * Free up the root inode. |
1372 | */ | 1365 | */ |
1373 | cmn_err(CE_WARN, "XFS: failed to read RT inodes"); | 1366 | xfs_warn(mp, "failed to read RT inodes"); |
1374 | goto out_rele_rip; | 1367 | goto out_rele_rip; |
1375 | } | 1368 | } |
1376 | 1369 | ||
@@ -1382,7 +1375,7 @@ xfs_mountfs( | |||
1382 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { | 1375 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { |
1383 | error = xfs_mount_log_sb(mp, mp->m_update_flags); | 1376 | error = xfs_mount_log_sb(mp, mp->m_update_flags); |
1384 | if (error) { | 1377 | if (error) { |
1385 | cmn_err(CE_WARN, "XFS: failed to write sb changes"); | 1378 | xfs_warn(mp, "failed to write sb changes"); |
1386 | goto out_rtunmount; | 1379 | goto out_rtunmount; |
1387 | } | 1380 | } |
1388 | } | 1381 | } |
@@ -1403,10 +1396,7 @@ xfs_mountfs( | |||
1403 | * quotachecked license. | 1396 | * quotachecked license. |
1404 | */ | 1397 | */ |
1405 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { | 1398 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { |
1406 | cmn_err(CE_NOTE, | 1399 | xfs_notice(mp, "resetting quota flags"); |
1407 | "XFS: resetting qflags for filesystem %s", | ||
1408 | mp->m_fsname); | ||
1409 | |||
1410 | error = xfs_mount_reset_sbqflags(mp); | 1400 | error = xfs_mount_reset_sbqflags(mp); |
1411 | if (error) | 1401 | if (error) |
1412 | return error; | 1402 | return error; |
@@ -1420,7 +1410,7 @@ xfs_mountfs( | |||
1420 | */ | 1410 | */ |
1421 | error = xfs_log_mount_finish(mp); | 1411 | error = xfs_log_mount_finish(mp); |
1422 | if (error) { | 1412 | if (error) { |
1423 | cmn_err(CE_WARN, "XFS: log mount finish failed"); | 1413 | xfs_warn(mp, "log mount finish failed"); |
1424 | goto out_rtunmount; | 1414 | goto out_rtunmount; |
1425 | } | 1415 | } |
1426 | 1416 | ||
@@ -1449,8 +1439,8 @@ xfs_mountfs( | |||
1449 | resblks = xfs_default_resblks(mp); | 1439 | resblks = xfs_default_resblks(mp); |
1450 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1440 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1451 | if (error) | 1441 | if (error) |
1452 | cmn_err(CE_WARN, "XFS: Unable to allocate reserve " | 1442 | xfs_warn(mp, |
1453 | "blocks. Continuing without a reserve pool."); | 1443 | "Unable to allocate reserve blocks. Continuing without reserve pool."); |
1454 | } | 1444 | } |
1455 | 1445 | ||
1456 | return 0; | 1446 | return 0; |
@@ -1539,12 +1529,12 @@ xfs_unmountfs( | |||
1539 | resblks = 0; | 1529 | resblks = 0; |
1540 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1530 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1541 | if (error) | 1531 | if (error) |
1542 | cmn_err(CE_WARN, "XFS: Unable to free reserved block pool. " | 1532 | xfs_warn(mp, "Unable to free reserved block pool. " |
1543 | "Freespace may not be correct on next mount."); | 1533 | "Freespace may not be correct on next mount."); |
1544 | 1534 | ||
1545 | error = xfs_log_sbcount(mp, 1); | 1535 | error = xfs_log_sbcount(mp, 1); |
1546 | if (error) | 1536 | if (error) |
1547 | cmn_err(CE_WARN, "XFS: Unable to update superblock counters. " | 1537 | xfs_warn(mp, "Unable to update superblock counters. " |
1548 | "Freespace may not be correct on next mount."); | 1538 | "Freespace may not be correct on next mount."); |
1549 | xfs_unmountfs_writesb(mp); | 1539 | xfs_unmountfs_writesb(mp); |
1550 | xfs_unmountfs_wait(mp); /* wait for async bufs */ | 1540 | xfs_unmountfs_wait(mp); /* wait for async bufs */ |
@@ -2027,10 +2017,8 @@ xfs_dev_is_read_only( | |||
2027 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || | 2017 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || |
2028 | xfs_readonly_buftarg(mp->m_logdev_targp) || | 2018 | xfs_readonly_buftarg(mp->m_logdev_targp) || |
2029 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { | 2019 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { |
2030 | cmn_err(CE_NOTE, | 2020 | xfs_notice(mp, "%s required on read-only device.", message); |
2031 | "XFS: %s required on read-only device.", message); | 2021 | xfs_notice(mp, "write access unavailable, cannot proceed."); |
2032 | cmn_err(CE_NOTE, | ||
2033 | "XFS: write access unavailable, cannot proceed."); | ||
2034 | return EROFS; | 2022 | return EROFS; |
2035 | } | 2023 | } |
2036 | return 0; | 2024 | return 0; |