aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-03-07 03:43:21 -0500
committerTao Ma <boyu.mt@taobao.com>2011-03-07 03:43:21 -0500
commitc1e8d35ef5ffb393b94a192034b5e3541e005d75 (patch)
treeb9a7f089acd3408c2835a3dfd6aa7bb0407587b3 /fs/ocfs2/dlmglue.c
parentef6b689b63b9f5227ccee6f16dd9ee3faf58a464 (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/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c71
1 files changed, 6 insertions, 65 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index c2f3fa1c4722..7eb4b8da5cbc 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -406,8 +406,6 @@ static void ocfs2_build_lock_name(enum ocfs2_lock_type type,
406 BUG_ON(len != (OCFS2_LOCK_ID_MAX_LEN - 1)); 406 BUG_ON(len != (OCFS2_LOCK_ID_MAX_LEN - 1));
407 407
408 mlog(0, "built lock resource with name: %s\n", name); 408 mlog(0, "built lock resource with name: %s\n", name);
409
410 mlog_exit_void();
411} 409}
412 410
413static DEFINE_SPINLOCK(ocfs2_dlm_tracking_lock); 411static DEFINE_SPINLOCK(ocfs2_dlm_tracking_lock);
@@ -752,7 +750,6 @@ void ocfs2_lock_res_free(struct ocfs2_lock_res *res)
752 memset(&res->l_lksb, 0, sizeof(res->l_lksb)); 750 memset(&res->l_lksb, 0, sizeof(res->l_lksb));
753 751
754 res->l_flags = 0UL; 752 res->l_flags = 0UL;
755 mlog_exit_void();
756} 753}
757 754
758static inline void ocfs2_inc_holders(struct ocfs2_lock_res *lockres, 755static inline void ocfs2_inc_holders(struct ocfs2_lock_res *lockres,
@@ -770,8 +767,6 @@ static inline void ocfs2_inc_holders(struct ocfs2_lock_res *lockres,
770 default: 767 default:
771 BUG(); 768 BUG();
772 } 769 }
773
774 mlog_exit_void();
775} 770}
776 771
777static inline void ocfs2_dec_holders(struct ocfs2_lock_res *lockres, 772static inline void ocfs2_dec_holders(struct ocfs2_lock_res *lockres,
@@ -791,7 +786,6 @@ static inline void ocfs2_dec_holders(struct ocfs2_lock_res *lockres,
791 default: 786 default:
792 BUG(); 787 BUG();
793 } 788 }
794 mlog_exit_void();
795} 789}
796 790
797/* WARNING: This function lives in a world where the only three lock 791/* WARNING: This function lives in a world where the only three lock
@@ -850,8 +844,6 @@ static inline void ocfs2_generic_handle_downconvert_action(struct ocfs2_lock_res
850 lockres_clear_flags(lockres, OCFS2_LOCK_BLOCKED); 844 lockres_clear_flags(lockres, OCFS2_LOCK_BLOCKED);
851 } 845 }
852 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY); 846 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
853
854 mlog_exit_void();
855} 847}
856 848
857static inline void ocfs2_generic_handle_convert_action(struct ocfs2_lock_res *lockres) 849static inline void ocfs2_generic_handle_convert_action(struct ocfs2_lock_res *lockres)
@@ -877,8 +869,6 @@ static inline void ocfs2_generic_handle_convert_action(struct ocfs2_lock_res *lo
877 lockres_or_flags(lockres, OCFS2_LOCK_UPCONVERT_FINISHING); 869 lockres_or_flags(lockres, OCFS2_LOCK_UPCONVERT_FINISHING);
878 870
879 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY); 871 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
880
881 mlog_exit_void();
882} 872}
883 873
884static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *lockres) 874static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *lockres)
@@ -894,8 +884,6 @@ static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *loc
894 lockres->l_level = lockres->l_requested; 884 lockres->l_level = lockres->l_requested;
895 lockres_or_flags(lockres, OCFS2_LOCK_ATTACHED); 885 lockres_or_flags(lockres, OCFS2_LOCK_ATTACHED);
896 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY); 886 lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
897
898 mlog_exit_void();
899} 887}
900 888
901static int ocfs2_generic_handle_bast(struct ocfs2_lock_res *lockres, 889static int ocfs2_generic_handle_bast(struct ocfs2_lock_res *lockres,
@@ -923,8 +911,7 @@ static int ocfs2_generic_handle_bast(struct ocfs2_lock_res *lockres,
923 911
924 if (needs_downconvert) 912 if (needs_downconvert)
925 lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED); 913 lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED);
926 914 mlog(0, "needs_downconvert = %d\n", needs_downconvert);
927 mlog_exit(needs_downconvert);
928 return needs_downconvert; 915 return needs_downconvert;
929} 916}
930 917
@@ -1145,7 +1132,6 @@ static void ocfs2_unlock_ast(struct ocfs2_dlm_lksb *lksb, int error)
1145 "unlock_action %d\n", error, lockres->l_name, 1132 "unlock_action %d\n", error, lockres->l_name,
1146 lockres->l_unlock_action); 1133 lockres->l_unlock_action);
1147 spin_unlock_irqrestore(&lockres->l_lock, flags); 1134 spin_unlock_irqrestore(&lockres->l_lock, flags);
1148 mlog_exit_void();
1149 return; 1135 return;
1150 } 1136 }
1151 1137
@@ -1169,8 +1155,6 @@ static void ocfs2_unlock_ast(struct ocfs2_dlm_lksb *lksb, int error)
1169 lockres->l_unlock_action = OCFS2_UNLOCK_INVALID; 1155 lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
1170 wake_up(&lockres->l_event); 1156 wake_up(&lockres->l_event);
1171 spin_unlock_irqrestore(&lockres->l_lock, flags); 1157 spin_unlock_irqrestore(&lockres->l_lock, flags);
1172
1173 mlog_exit_void();
1174} 1158}
1175 1159
1176/* 1160/*
@@ -1226,7 +1210,6 @@ static inline void ocfs2_recover_from_dlm_error(struct ocfs2_lock_res *lockres,
1226 spin_unlock_irqrestore(&lockres->l_lock, flags); 1210 spin_unlock_irqrestore(&lockres->l_lock, flags);
1227 1211
1228 wake_up(&lockres->l_event); 1212 wake_up(&lockres->l_event);
1229 mlog_exit_void();
1230} 1213}
1231 1214
1232/* Note: If we detect another process working on the lock (i.e., 1215/* Note: If we detect another process working on the lock (i.e.,
@@ -1273,7 +1256,6 @@ static int ocfs2_lock_create(struct ocfs2_super *osb,
1273 mlog(0, "lock %s, return from ocfs2_dlm_lock\n", lockres->l_name); 1256 mlog(0, "lock %s, return from ocfs2_dlm_lock\n", lockres->l_name);
1274 1257
1275bail: 1258bail:
1276 mlog_exit(ret);
1277 return ret; 1259 return ret;
1278} 1260}
1279 1261
@@ -1561,7 +1543,6 @@ out:
1561 caller_ip); 1543 caller_ip);
1562 } 1544 }
1563#endif 1545#endif
1564 mlog_exit(ret);
1565 return ret; 1546 return ret;
1566} 1547}
1567 1548
@@ -1591,7 +1572,6 @@ static void __ocfs2_cluster_unlock(struct ocfs2_super *osb,
1591 if (lockres->l_lockdep_map.key != NULL) 1572 if (lockres->l_lockdep_map.key != NULL)
1592 rwsem_release(&lockres->l_lockdep_map, 1, caller_ip); 1573 rwsem_release(&lockres->l_lockdep_map, 1, caller_ip);
1593#endif 1574#endif
1594 mlog_exit_void();
1595} 1575}
1596 1576
1597static int ocfs2_create_new_lock(struct ocfs2_super *osb, 1577static int ocfs2_create_new_lock(struct ocfs2_super *osb,
@@ -1658,7 +1638,6 @@ int ocfs2_create_new_inode_locks(struct inode *inode)
1658 } 1638 }
1659 1639
1660bail: 1640bail:
1661 mlog_exit(ret);
1662 return ret; 1641 return ret;
1663} 1642}
1664 1643
@@ -1674,10 +1653,8 @@ int ocfs2_rw_lock(struct inode *inode, int write)
1674 (unsigned long long)OCFS2_I(inode)->ip_blkno, 1653 (unsigned long long)OCFS2_I(inode)->ip_blkno,
1675 write ? "EXMODE" : "PRMODE"); 1654 write ? "EXMODE" : "PRMODE");
1676 1655
1677 if (ocfs2_mount_local(osb)) { 1656 if (ocfs2_mount_local(osb))
1678 mlog_exit(0);
1679 return 0; 1657 return 0;
1680 }
1681 1658
1682 lockres = &OCFS2_I(inode)->ip_rw_lockres; 1659 lockres = &OCFS2_I(inode)->ip_rw_lockres;
1683 1660
@@ -1688,7 +1665,6 @@ int ocfs2_rw_lock(struct inode *inode, int write)
1688 if (status < 0) 1665 if (status < 0)
1689 mlog_errno(status); 1666 mlog_errno(status);
1690 1667
1691 mlog_exit(status);
1692 return status; 1668 return status;
1693} 1669}
1694 1670
@@ -1704,8 +1680,6 @@ void ocfs2_rw_unlock(struct inode *inode, int write)
1704 1680
1705 if (!ocfs2_mount_local(osb)) 1681 if (!ocfs2_mount_local(osb))
1706 ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level); 1682 ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
1707
1708 mlog_exit_void();
1709} 1683}
1710 1684
1711/* 1685/*
@@ -1733,7 +1707,6 @@ int ocfs2_open_lock(struct inode *inode)
1733 mlog_errno(status); 1707 mlog_errno(status);
1734 1708
1735out: 1709out:
1736 mlog_exit(status);
1737 return status; 1710 return status;
1738} 1711}
1739 1712
@@ -1766,7 +1739,6 @@ int ocfs2_try_open_lock(struct inode *inode, int write)
1766 level, DLM_LKF_NOQUEUE, 0); 1739 level, DLM_LKF_NOQUEUE, 0);
1767 1740
1768out: 1741out:
1769 mlog_exit(status);
1770 return status; 1742 return status;
1771} 1743}
1772 1744
@@ -1792,7 +1764,7 @@ void ocfs2_open_unlock(struct inode *inode)
1792 DLM_LOCK_EX); 1764 DLM_LOCK_EX);
1793 1765
1794out: 1766out:
1795 mlog_exit_void(); 1767 return;
1796} 1768}
1797 1769
1798static int ocfs2_flock_handle_signal(struct ocfs2_lock_res *lockres, 1770static int ocfs2_flock_handle_signal(struct ocfs2_lock_res *lockres,
@@ -2028,8 +2000,6 @@ static void ocfs2_downconvert_on_unlock(struct ocfs2_super *osb,
2028 2000
2029 if (kick) 2001 if (kick)
2030 ocfs2_wake_downconvert_thread(osb); 2002 ocfs2_wake_downconvert_thread(osb);
2031
2032 mlog_exit_void();
2033} 2003}
2034 2004
2035#define OCFS2_SEC_BITS 34 2005#define OCFS2_SEC_BITS 34
@@ -2089,8 +2059,6 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
2089 2059
2090out: 2060out:
2091 mlog_meta_lvb(0, lockres); 2061 mlog_meta_lvb(0, lockres);
2092
2093 mlog_exit_void();
2094} 2062}
2095 2063
2096static void ocfs2_unpack_timespec(struct timespec *spec, 2064static void ocfs2_unpack_timespec(struct timespec *spec,
@@ -2136,8 +2104,6 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
2136 ocfs2_unpack_timespec(&inode->i_ctime, 2104 ocfs2_unpack_timespec(&inode->i_ctime,
2137 be64_to_cpu(lvb->lvb_ictime_packed)); 2105 be64_to_cpu(lvb->lvb_ictime_packed));
2138 spin_unlock(&oi->ip_lock); 2106 spin_unlock(&oi->ip_lock);
2139
2140 mlog_exit_void();
2141} 2107}
2142 2108
2143static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode, 2109static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode,
@@ -2184,7 +2150,7 @@ refresh_check:
2184 2150
2185 status = 1; 2151 status = 1;
2186bail: 2152bail:
2187 mlog_exit(status); 2153 mlog(0, "status %d\n", status);
2188 return status; 2154 return status;
2189} 2155}
2190 2156
@@ -2202,8 +2168,6 @@ static inline void ocfs2_complete_lock_res_refresh(struct ocfs2_lock_res *lockre
2202 spin_unlock_irqrestore(&lockres->l_lock, flags); 2168 spin_unlock_irqrestore(&lockres->l_lock, flags);
2203 2169
2204 wake_up(&lockres->l_event); 2170 wake_up(&lockres->l_event);
2205
2206 mlog_exit_void();
2207} 2171}
2208 2172
2209/* may or may not return a bh if it went to disk. */ 2173/* may or may not return a bh if it went to disk. */
@@ -2284,7 +2248,6 @@ static int ocfs2_inode_lock_update(struct inode *inode,
2284bail_refresh: 2248bail_refresh:
2285 ocfs2_complete_lock_res_refresh(lockres, status); 2249 ocfs2_complete_lock_res_refresh(lockres, status);
2286bail: 2250bail:
2287 mlog_exit(status);
2288 return status; 2251 return status;
2289} 2252}
2290 2253
@@ -2419,7 +2382,6 @@ bail:
2419 if (local_bh) 2382 if (local_bh)
2420 brelse(local_bh); 2383 brelse(local_bh);
2421 2384
2422 mlog_exit(status);
2423 return status; 2385 return status;
2424} 2386}
2425 2387
@@ -2496,7 +2458,6 @@ int ocfs2_inode_lock_atime(struct inode *inode,
2496 } else 2458 } else
2497 *level = 0; 2459 *level = 0;
2498 2460
2499 mlog_exit(ret);
2500 return ret; 2461 return ret;
2501} 2462}
2502 2463
@@ -2514,8 +2475,6 @@ void ocfs2_inode_unlock(struct inode *inode,
2514 if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb)) && 2475 if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb)) &&
2515 !ocfs2_mount_local(osb)) 2476 !ocfs2_mount_local(osb))
2516 ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level); 2477 ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
2517
2518 mlog_exit_void();
2519} 2478}
2520 2479
2521int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno) 2480int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno)
@@ -2597,7 +2556,6 @@ int ocfs2_super_lock(struct ocfs2_super *osb,
2597 ocfs2_track_lock_refresh(lockres); 2556 ocfs2_track_lock_refresh(lockres);
2598 } 2557 }
2599bail: 2558bail:
2600 mlog_exit(status);
2601 return status; 2559 return status;
2602} 2560}
2603 2561
@@ -3057,7 +3015,6 @@ bail:
3057 kthread_stop(osb->dc_task); 3015 kthread_stop(osb->dc_task);
3058 } 3016 }
3059 3017
3060 mlog_exit(status);
3061 return status; 3018 return status;
3062} 3019}
3063 3020
@@ -3086,8 +3043,6 @@ void ocfs2_dlm_shutdown(struct ocfs2_super *osb,
3086 osb->cconn = NULL; 3043 osb->cconn = NULL;
3087 3044
3088 ocfs2_dlm_shutdown_debug(osb); 3045 ocfs2_dlm_shutdown_debug(osb);
3089
3090 mlog_exit_void();
3091} 3046}
3092 3047
3093static int ocfs2_drop_lock(struct ocfs2_super *osb, 3048static int ocfs2_drop_lock(struct ocfs2_super *osb,
@@ -3169,7 +3124,6 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
3169 3124
3170 ocfs2_wait_on_busy_lock(lockres); 3125 ocfs2_wait_on_busy_lock(lockres);
3171out: 3126out:
3172 mlog_exit(0);
3173 return 0; 3127 return 0;
3174} 3128}
3175 3129
@@ -3251,7 +3205,6 @@ int ocfs2_drop_inode_locks(struct inode *inode)
3251 if (err < 0 && !status) 3205 if (err < 0 && !status)
3252 status = err; 3206 status = err;
3253 3207
3254 mlog_exit(status);
3255 return status; 3208 return status;
3256} 3209}
3257 3210
@@ -3314,7 +3267,6 @@ static int ocfs2_downconvert_lock(struct ocfs2_super *osb,
3314 3267
3315 ret = 0; 3268 ret = 0;
3316bail: 3269bail:
3317 mlog_exit(ret);
3318 return ret; 3270 return ret;
3319} 3271}
3320 3272
@@ -3362,7 +3314,6 @@ static int ocfs2_cancel_convert(struct ocfs2_super *osb,
3362 3314
3363 mlog(ML_BASTS, "lockres %s\n", lockres->l_name); 3315 mlog(ML_BASTS, "lockres %s\n", lockres->l_name);
3364 3316
3365 mlog_exit(ret);
3366 return ret; 3317 return ret;
3367} 3318}
3368 3319
@@ -3552,14 +3503,14 @@ downconvert:
3552 gen); 3503 gen);
3553 3504
3554leave: 3505leave:
3555 mlog_exit(ret); 3506 if (ret)
3507 mlog_errno(ret);
3556 return ret; 3508 return ret;
3557 3509
3558leave_requeue: 3510leave_requeue:
3559 spin_unlock_irqrestore(&lockres->l_lock, flags); 3511 spin_unlock_irqrestore(&lockres->l_lock, flags);
3560 ctl->requeue = 1; 3512 ctl->requeue = 1;
3561 3513
3562 mlog_exit(0);
3563 return 0; 3514 return 0;
3564} 3515}
3565 3516
@@ -3800,8 +3751,6 @@ static void ocfs2_set_qinfo_lvb(struct ocfs2_lock_res *lockres)
3800 lvb->lvb_blocks = cpu_to_be32(oinfo->dqi_gi.dqi_blocks); 3751 lvb->lvb_blocks = cpu_to_be32(oinfo->dqi_gi.dqi_blocks);
3801 lvb->lvb_free_blk = cpu_to_be32(oinfo->dqi_gi.dqi_free_blk); 3752 lvb->lvb_free_blk = cpu_to_be32(oinfo->dqi_gi.dqi_free_blk);
3802 lvb->lvb_free_entry = cpu_to_be32(oinfo->dqi_gi.dqi_free_entry); 3753 lvb->lvb_free_entry = cpu_to_be32(oinfo->dqi_gi.dqi_free_entry);
3803
3804 mlog_exit_void();
3805} 3754}
3806 3755
3807void ocfs2_qinfo_unlock(struct ocfs2_mem_dqinfo *oinfo, int ex) 3756void ocfs2_qinfo_unlock(struct ocfs2_mem_dqinfo *oinfo, int ex)
@@ -3812,7 +3761,6 @@ void ocfs2_qinfo_unlock(struct ocfs2_mem_dqinfo *oinfo, int ex)
3812 3761
3813 if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb)) 3762 if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb))
3814 ocfs2_cluster_unlock(osb, lockres, level); 3763 ocfs2_cluster_unlock(osb, lockres, level);
3815 mlog_exit_void();
3816} 3764}
3817 3765
3818static int ocfs2_refresh_qinfo(struct ocfs2_mem_dqinfo *oinfo) 3766static int ocfs2_refresh_qinfo(struct ocfs2_mem_dqinfo *oinfo)
@@ -3889,7 +3837,6 @@ int ocfs2_qinfo_lock(struct ocfs2_mem_dqinfo *oinfo, int ex)
3889 ocfs2_qinfo_unlock(oinfo, ex); 3837 ocfs2_qinfo_unlock(oinfo, ex);
3890 ocfs2_complete_lock_res_refresh(lockres, status); 3838 ocfs2_complete_lock_res_refresh(lockres, status);
3891bail: 3839bail:
3892 mlog_exit(status);
3893 return status; 3840 return status;
3894} 3841}
3895 3842
@@ -3968,8 +3915,6 @@ unqueue:
3968 if (ctl.unblock_action != UNBLOCK_CONTINUE 3915 if (ctl.unblock_action != UNBLOCK_CONTINUE
3969 && lockres->l_ops->post_unlock) 3916 && lockres->l_ops->post_unlock)
3970 lockres->l_ops->post_unlock(osb, lockres); 3917 lockres->l_ops->post_unlock(osb, lockres);
3971
3972 mlog_exit_void();
3973} 3918}
3974 3919
3975static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, 3920static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb,
@@ -3995,8 +3940,6 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb,
3995 osb->blocked_lock_count++; 3940 osb->blocked_lock_count++;
3996 } 3941 }
3997 spin_unlock(&osb->dc_task_lock); 3942 spin_unlock(&osb->dc_task_lock);
3998
3999 mlog_exit_void();
4000} 3943}
4001 3944
4002static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) 3945static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb)
@@ -4027,8 +3970,6 @@ static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb)
4027 spin_lock(&osb->dc_task_lock); 3970 spin_lock(&osb->dc_task_lock);
4028 } 3971 }
4029 spin_unlock(&osb->dc_task_lock); 3972 spin_unlock(&osb->dc_task_lock);
4030
4031 mlog_exit_void();
4032} 3973}
4033 3974
4034static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb) 3975static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb)