diff options
author | Tao Ma <boyu.mt@taobao.com> | 2011-03-07 03:43:21 -0500 |
---|---|---|
committer | Tao Ma <boyu.mt@taobao.com> | 2011-03-07 03:43:21 -0500 |
commit | c1e8d35ef5ffb393b94a192034b5e3541e005d75 (patch) | |
tree | b9a7f089acd3408c2835a3dfd6aa7bb0407587b3 /fs/ocfs2/super.c | |
parent | ef6b689b63b9f5227ccee6f16dd9ee3faf58a464 (diff) |
ocfs2: Remove EXIT from masklog.
mlog_exit is used to record the exit status of a function.
But because it is added in so many functions, if we enable it,
the system logs get filled up quickly and cause too much I/O.
So actually no one can open it for a production system or even
for a test.
This patch just try to remove it or change it. So:
1. if all the error paths already use mlog_errno, it is just removed.
Otherwise, it will be replaced by mlog_errno.
2. if it is used to print some return value, it is replaced with
mlog(0,...).
mlog_exit_ptr is changed to mlog(0.
All those mlog(0,...) will be replaced with trace events later.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 21c4bfdfd739..b21b702c5603 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -476,7 +476,8 @@ static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb) | |||
476 | } | 476 | } |
477 | 477 | ||
478 | bail: | 478 | bail: |
479 | mlog_exit(status); | 479 | if (status) |
480 | mlog_errno(status); | ||
480 | return status; | 481 | return status; |
481 | } | 482 | } |
482 | 483 | ||
@@ -504,7 +505,8 @@ static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb) | |||
504 | } | 505 | } |
505 | 506 | ||
506 | bail: | 507 | bail: |
507 | mlog_exit(status); | 508 | if (status) |
509 | mlog_errno(status); | ||
508 | return status; | 510 | return status; |
509 | } | 511 | } |
510 | 512 | ||
@@ -534,7 +536,7 @@ static void ocfs2_release_system_inodes(struct ocfs2_super *osb) | |||
534 | } | 536 | } |
535 | 537 | ||
536 | if (!osb->local_system_inodes) | 538 | if (!osb->local_system_inodes) |
537 | goto out; | 539 | return; |
538 | 540 | ||
539 | for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) { | 541 | for (i = 0; i < NUM_LOCAL_SYSTEM_INODES * osb->max_slots; i++) { |
540 | if (osb->local_system_inodes[i]) { | 542 | if (osb->local_system_inodes[i]) { |
@@ -545,9 +547,6 @@ static void ocfs2_release_system_inodes(struct ocfs2_super *osb) | |||
545 | 547 | ||
546 | kfree(osb->local_system_inodes); | 548 | kfree(osb->local_system_inodes); |
547 | osb->local_system_inodes = NULL; | 549 | osb->local_system_inodes = NULL; |
548 | |||
549 | out: | ||
550 | mlog_exit(0); | ||
551 | } | 550 | } |
552 | 551 | ||
553 | /* We're allocating fs objects, use GFP_NOFS */ | 552 | /* We're allocating fs objects, use GFP_NOFS */ |
@@ -1202,7 +1201,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1202 | mlog_errno(status); | 1201 | mlog_errno(status); |
1203 | atomic_set(&osb->vol_state, VOLUME_DISABLED); | 1202 | atomic_set(&osb->vol_state, VOLUME_DISABLED); |
1204 | wake_up(&osb->osb_mount_event); | 1203 | wake_up(&osb->osb_mount_event); |
1205 | mlog_exit(status); | ||
1206 | return status; | 1204 | return status; |
1207 | } | 1205 | } |
1208 | } | 1206 | } |
@@ -1216,7 +1214,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1216 | /* Start this when the mount is almost sure of being successful */ | 1214 | /* Start this when the mount is almost sure of being successful */ |
1217 | ocfs2_orphan_scan_start(osb); | 1215 | ocfs2_orphan_scan_start(osb); |
1218 | 1216 | ||
1219 | mlog_exit(status); | ||
1220 | return status; | 1217 | return status; |
1221 | 1218 | ||
1222 | read_super_error: | 1219 | read_super_error: |
@@ -1231,7 +1228,8 @@ read_super_error: | |||
1231 | ocfs2_dismount_volume(sb, 1); | 1228 | ocfs2_dismount_volume(sb, 1); |
1232 | } | 1229 | } |
1233 | 1230 | ||
1234 | mlog_exit(status); | 1231 | if (status) |
1232 | mlog_errno(status); | ||
1235 | return status; | 1233 | return status; |
1236 | } | 1234 | } |
1237 | 1235 | ||
@@ -1532,7 +1530,6 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
1532 | status = 1; | 1530 | status = 1; |
1533 | 1531 | ||
1534 | bail: | 1532 | bail: |
1535 | mlog_exit(status); | ||
1536 | return status; | 1533 | return status; |
1537 | } | 1534 | } |
1538 | 1535 | ||
@@ -1661,10 +1658,9 @@ leave: | |||
1661 | ocfs2_quota_shutdown(); | 1658 | ocfs2_quota_shutdown(); |
1662 | ocfs2_free_mem_caches(); | 1659 | ocfs2_free_mem_caches(); |
1663 | exit_ocfs2_uptodate_cache(); | 1660 | exit_ocfs2_uptodate_cache(); |
1661 | mlog_errno(status); | ||
1664 | } | 1662 | } |
1665 | 1663 | ||
1666 | mlog_exit(status); | ||
1667 | |||
1668 | if (status >= 0) { | 1664 | if (status >= 0) { |
1669 | return register_filesystem(&ocfs2_fs_type); | 1665 | return register_filesystem(&ocfs2_fs_type); |
1670 | } else | 1666 | } else |
@@ -1689,8 +1685,6 @@ static void __exit ocfs2_exit(void) | |||
1689 | unregister_filesystem(&ocfs2_fs_type); | 1685 | unregister_filesystem(&ocfs2_fs_type); |
1690 | 1686 | ||
1691 | exit_ocfs2_uptodate_cache(); | 1687 | exit_ocfs2_uptodate_cache(); |
1692 | |||
1693 | mlog_exit_void(); | ||
1694 | } | 1688 | } |
1695 | 1689 | ||
1696 | static void ocfs2_put_super(struct super_block *sb) | 1690 | static void ocfs2_put_super(struct super_block *sb) |
@@ -1699,8 +1693,6 @@ static void ocfs2_put_super(struct super_block *sb) | |||
1699 | 1693 | ||
1700 | ocfs2_sync_blockdev(sb); | 1694 | ocfs2_sync_blockdev(sb); |
1701 | ocfs2_dismount_volume(sb, 0); | 1695 | ocfs2_dismount_volume(sb, 0); |
1702 | |||
1703 | mlog_exit_void(); | ||
1704 | } | 1696 | } |
1705 | 1697 | ||
1706 | static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) | 1698 | static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) |
@@ -1759,7 +1751,8 @@ bail: | |||
1759 | if (inode) | 1751 | if (inode) |
1760 | iput(inode); | 1752 | iput(inode); |
1761 | 1753 | ||
1762 | mlog_exit(status); | 1754 | if (status) |
1755 | mlog_errno(status); | ||
1763 | 1756 | ||
1764 | return status; | 1757 | return status; |
1765 | } | 1758 | } |
@@ -1923,7 +1916,6 @@ leave: | |||
1923 | if (unlock_super) | 1916 | if (unlock_super) |
1924 | ocfs2_super_unlock(osb, 1); | 1917 | ocfs2_super_unlock(osb, 1); |
1925 | 1918 | ||
1926 | mlog_exit(status); | ||
1927 | return status; | 1919 | return status; |
1928 | } | 1920 | } |
1929 | 1921 | ||
@@ -2373,7 +2365,6 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
2373 | } | 2365 | } |
2374 | 2366 | ||
2375 | bail: | 2367 | bail: |
2376 | mlog_exit(status); | ||
2377 | return status; | 2368 | return status; |
2378 | } | 2369 | } |
2379 | 2370 | ||
@@ -2443,7 +2434,8 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di, | |||
2443 | } | 2434 | } |
2444 | 2435 | ||
2445 | out: | 2436 | out: |
2446 | mlog_exit(status); | 2437 | if (status && status != -EAGAIN) |
2438 | mlog_errno(status); | ||
2447 | return status; | 2439 | return status; |
2448 | } | 2440 | } |
2449 | 2441 | ||
@@ -2538,7 +2530,8 @@ finally: | |||
2538 | if (local_alloc) | 2530 | if (local_alloc) |
2539 | kfree(local_alloc); | 2531 | kfree(local_alloc); |
2540 | 2532 | ||
2541 | mlog_exit(status); | 2533 | if (status) |
2534 | mlog_errno(status); | ||
2542 | return status; | 2535 | return status; |
2543 | } | 2536 | } |
2544 | 2537 | ||
@@ -2567,8 +2560,6 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb) | |||
2567 | kfree(osb->uuid_str); | 2560 | kfree(osb->uuid_str); |
2568 | ocfs2_put_dlm_debug(osb->osb_dlm_debug); | 2561 | ocfs2_put_dlm_debug(osb->osb_dlm_debug); |
2569 | memset(osb, 0, sizeof(struct ocfs2_super)); | 2562 | memset(osb, 0, sizeof(struct ocfs2_super)); |
2570 | |||
2571 | mlog_exit_void(); | ||
2572 | } | 2563 | } |
2573 | 2564 | ||
2574 | /* Put OCFS2 into a readonly state, or (if the user specifies it), | 2565 | /* Put OCFS2 into a readonly state, or (if the user specifies it), |