aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-02-22 09:24:57 -0500
committerTao Ma <boyu.mt@taobao.com>2011-02-22 09:24:57 -0500
commit64f3b2692724fdbe72697b77887685b5bd3f4a3c (patch)
treef741d846cd6895ea49e47278bcd765c5138a70ec
parent6218b90e7669d83cb8ad744f3400205d260597f2 (diff)
ocfs2: Remove masklog ML_INODE.
Remove mlog(0) from fs/ocfs2/inode.c and the masklog INODE. Signed-off-by: Tao Ma <boyu.mt@taobao.com>
-rw-r--r--fs/ocfs2/cluster/masklog.c1
-rw-r--r--fs/ocfs2/cluster/masklog.h1
-rw-r--r--fs/ocfs2/inode.c107
-rw-r--r--fs/ocfs2/ocfs2_trace.h136
4 files changed, 182 insertions, 63 deletions
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 036e8b8814f7..e18fb801633e 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -99,7 +99,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
99 define_mask(BH_IO), 99 define_mask(BH_IO),
100 define_mask(UPTODATE), 100 define_mask(UPTODATE),
101 define_mask(NAMEI), 101 define_mask(NAMEI),
102 define_mask(INODE),
103 define_mask(VOTE), 102 define_mask(VOTE),
104 define_mask(DCACHE), 103 define_mask(DCACHE),
105 define_mask(CONN), 104 define_mask(CONN),
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index d07780ab9f8f..b76d07786107 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -101,7 +101,6 @@
101#define ML_BH_IO 0x0000000000100000ULL /* ocfs2 buffer I/O */ 101#define ML_BH_IO 0x0000000000100000ULL /* ocfs2 buffer I/O */
102#define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */ 102#define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */
103#define ML_NAMEI 0x0000000000400000ULL /* ocfs2 directory / namespace */ 103#define ML_NAMEI 0x0000000000400000ULL /* ocfs2 directory / namespace */
104#define ML_INODE 0x0000000000800000ULL /* ocfs2 inode manipulation */
105#define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */ 104#define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */
106#define ML_DCACHE 0x0000000002000000ULL /* ocfs2 dcache operations */ 105#define ML_DCACHE 0x0000000002000000ULL /* ocfs2 dcache operations */
107#define ML_CONN 0x0000000004000000ULL /* net connection management */ 106#define ML_CONN 0x0000000004000000ULL /* net connection management */
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 8ec0cb01cb7c..177d3a6c2a5f 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -31,7 +31,6 @@
31 31
32#include <asm/byteorder.h> 32#include <asm/byteorder.h>
33 33
34#define MLOG_MASK_PREFIX ML_INODE
35#include <cluster/masklog.h> 34#include <cluster/masklog.h>
36 35
37#include "ocfs2.h" 36#include "ocfs2.h"
@@ -53,6 +52,7 @@
53#include "uptodate.h" 52#include "uptodate.h"
54#include "xattr.h" 53#include "xattr.h"
55#include "refcounttree.h" 54#include "refcounttree.h"
55#include "ocfs2_trace.h"
56 56
57#include "buffer_head_io.h" 57#include "buffer_head_io.h"
58 58
@@ -131,7 +131,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
131 struct super_block *sb = osb->sb; 131 struct super_block *sb = osb->sb;
132 struct ocfs2_find_inode_args args; 132 struct ocfs2_find_inode_args args;
133 133
134 mlog(0, "(blkno = %llu)\n", (unsigned long long)blkno); 134 trace_ocfs2_iget_begin((unsigned long long)blkno, flags,
135 sysfile_type);
135 136
136 /* Ok. By now we've either got the offsets passed to us by the 137 /* Ok. By now we've either got the offsets passed to us by the
137 * caller, or we just pulled them off the bh. Lets do some 138 * caller, or we just pulled them off the bh. Lets do some
@@ -157,8 +158,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
157 mlog_errno(PTR_ERR(inode)); 158 mlog_errno(PTR_ERR(inode));
158 goto bail; 159 goto bail;
159 } 160 }
161 trace_ocfs2_iget5_locked(inode->i_state);
160 if (inode->i_state & I_NEW) { 162 if (inode->i_state & I_NEW) {
161 mlog(0, "Inode was not in inode cache, reading it.\n");
162 ocfs2_read_locked_inode(inode, &args); 163 ocfs2_read_locked_inode(inode, &args);
163 unlock_new_inode(inode); 164 unlock_new_inode(inode);
164 } 165 }
@@ -170,9 +171,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
170 171
171bail: 172bail:
172 if (!IS_ERR(inode)) { 173 if (!IS_ERR(inode)) {
173 mlog(0, "returning inode with number %llu\n", 174 trace_ocfs2_iget_end(inode,
174 (unsigned long long)OCFS2_I(inode)->ip_blkno); 175 (unsigned long long)OCFS2_I(inode)->ip_blkno);
175 mlog(0, "inode %p\n", inode);
176 } 176 }
177 177
178 return inode; 178 return inode;
@@ -192,12 +192,12 @@ static int ocfs2_find_actor(struct inode *inode, void *opaque)
192 struct ocfs2_inode_info *oi = OCFS2_I(inode); 192 struct ocfs2_inode_info *oi = OCFS2_I(inode);
193 int ret = 0; 193 int ret = 0;
194 194
195 mlog(0, "(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
196
197 args = opaque; 195 args = opaque;
198 196
199 mlog_bug_on_msg(!inode, "No inode in find actor!\n"); 197 mlog_bug_on_msg(!inode, "No inode in find actor!\n");
200 198
199 trace_ocfs2_find_actor(inode, inode->i_ino, opaque, args->fi_blkno);
200
201 if (oi->ip_blkno != args->fi_blkno) 201 if (oi->ip_blkno != args->fi_blkno)
202 goto bail; 202 goto bail;
203 203
@@ -217,8 +217,6 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque)
217 static struct lock_class_key ocfs2_quota_ip_alloc_sem_key, 217 static struct lock_class_key ocfs2_quota_ip_alloc_sem_key,
218 ocfs2_file_ip_alloc_sem_key; 218 ocfs2_file_ip_alloc_sem_key;
219 219
220 mlog(0, "inode = %p, opaque = %p\n", inode, opaque);
221
222 inode->i_ino = args->fi_ino; 220 inode->i_ino = args->fi_ino;
223 OCFS2_I(inode)->ip_blkno = args->fi_blkno; 221 OCFS2_I(inode)->ip_blkno = args->fi_blkno;
224 if (args->fi_sysfile_type != 0) 222 if (args->fi_sysfile_type != 0)
@@ -244,9 +242,6 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
244 struct ocfs2_super *osb; 242 struct ocfs2_super *osb;
245 int use_plocks = 1; 243 int use_plocks = 1;
246 244
247 mlog(0, "(0x%p, size:%llu)\n", inode,
248 (unsigned long long)le64_to_cpu(fe->i_size));
249
250 sb = inode->i_sb; 245 sb = inode->i_sb;
251 osb = OCFS2_SB(sb); 246 osb = OCFS2_SB(sb);
252 247
@@ -298,20 +293,20 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
298 293
299 inode->i_nlink = ocfs2_read_links_count(fe); 294 inode->i_nlink = ocfs2_read_links_count(fe);
300 295
296 trace_ocfs2_populate_inode(OCFS2_I(inode)->ip_blkno,
297 le32_to_cpu(fe->i_flags));
301 if (fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL)) { 298 if (fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL)) {
302 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SYSTEM_FILE; 299 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SYSTEM_FILE;
303 inode->i_flags |= S_NOQUOTA; 300 inode->i_flags |= S_NOQUOTA;
304 } 301 }
305 302
306 if (fe->i_flags & cpu_to_le32(OCFS2_LOCAL_ALLOC_FL)) { 303 if (fe->i_flags & cpu_to_le32(OCFS2_LOCAL_ALLOC_FL)) {
307 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP; 304 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
308 mlog(0, "local alloc inode: i_ino=%lu\n", inode->i_ino);
309 } else if (fe->i_flags & cpu_to_le32(OCFS2_BITMAP_FL)) { 305 } else if (fe->i_flags & cpu_to_le32(OCFS2_BITMAP_FL)) {
310 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP; 306 OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
311 } else if (fe->i_flags & cpu_to_le32(OCFS2_QUOTA_FL)) { 307 } else if (fe->i_flags & cpu_to_le32(OCFS2_QUOTA_FL)) {
312 inode->i_flags |= S_NOQUOTA; 308 inode->i_flags |= S_NOQUOTA;
313 } else if (fe->i_flags & cpu_to_le32(OCFS2_SUPER_BLOCK_FL)) { 309 } else if (fe->i_flags & cpu_to_le32(OCFS2_SUPER_BLOCK_FL)) {
314 mlog(0, "superblock inode: i_ino=%lu\n", inode->i_ino);
315 /* we can't actually hit this as read_inode can't 310 /* we can't actually hit this as read_inode can't
316 * handle superblocks today ;-) */ 311 * handle superblocks today ;-) */
317 BUG(); 312 BUG();
@@ -391,8 +386,6 @@ static int ocfs2_read_locked_inode(struct inode *inode,
391 int status, can_lock; 386 int status, can_lock;
392 u32 generation = 0; 387 u32 generation = 0;
393 388
394 mlog(0, "(0x%p, 0x%p)\n", inode, args);
395
396 status = -EINVAL; 389 status = -EINVAL;
397 if (inode == NULL || inode->i_sb == NULL) { 390 if (inode == NULL || inode->i_sb == NULL) {
398 mlog(ML_ERROR, "bad inode\n"); 391 mlog(ML_ERROR, "bad inode\n");
@@ -440,6 +433,9 @@ static int ocfs2_read_locked_inode(struct inode *inode,
440 && !(args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY) 433 && !(args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY)
441 && !ocfs2_mount_local(osb); 434 && !ocfs2_mount_local(osb);
442 435
436 trace_ocfs2_read_locked_inode(
437 (unsigned long long)OCFS2_I(inode)->ip_blkno, can_lock);
438
443 /* 439 /*
444 * To maintain backwards compatibility with older versions of 440 * To maintain backwards compatibility with older versions of
445 * ocfs2-tools, we still store the generation value for system 441 * ocfs2-tools, we still store the generation value for system
@@ -689,8 +685,6 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
689 685
690 spin_lock(&osb->osb_lock); 686 spin_lock(&osb->osb_lock);
691 if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) { 687 if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) {
692 mlog(0, "Recovery is happening on orphan dir %d, will skip "
693 "this inode\n", slot);
694 ret = -EDEADLK; 688 ret = -EDEADLK;
695 goto out; 689 goto out;
696 } 690 }
@@ -699,6 +693,7 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
699 osb->osb_orphan_wipes[slot]++; 693 osb->osb_orphan_wipes[slot]++;
700out: 694out:
701 spin_unlock(&osb->osb_lock); 695 spin_unlock(&osb->osb_lock);
696 trace_ocfs2_check_orphan_recovery_state(slot, ret);
702 return ret; 697 return ret;
703} 698}
704 699
@@ -809,6 +804,10 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
809 struct ocfs2_inode_info *oi = OCFS2_I(inode); 804 struct ocfs2_inode_info *oi = OCFS2_I(inode);
810 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 805 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
811 806
807 trace_ocfs2_inode_is_valid_to_delete(current, osb->dc_task,
808 (unsigned long long)oi->ip_blkno,
809 oi->ip_flags);
810
812 /* We shouldn't be getting here for the root directory 811 /* We shouldn't be getting here for the root directory
813 * inode.. */ 812 * inode.. */
814 if (inode == osb->root_inode) { 813 if (inode == osb->root_inode) {
@@ -821,11 +820,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
821 * have to skip deleting this guy. That's OK though because 820 * have to skip deleting this guy. That's OK though because
822 * the node who's doing the actual deleting should handle it 821 * the node who's doing the actual deleting should handle it
823 * anyway. */ 822 * anyway. */
824 if (current == osb->dc_task) { 823 if (current == osb->dc_task)
825 mlog(0, "Skipping delete of %lu because we're currently "
826 "in downconvert\n", inode->i_ino);
827 goto bail; 824 goto bail;
828 }
829 825
830 spin_lock(&oi->ip_lock); 826 spin_lock(&oi->ip_lock);
831 /* OCFS2 *never* deletes system files. This should technically 827 /* OCFS2 *never* deletes system files. This should technically
@@ -840,11 +836,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
840 /* If we have allowd wipe of this inode for another node, it 836 /* If we have allowd wipe of this inode for another node, it
841 * will be marked here so we can safely skip it. Recovery will 837 * will be marked here so we can safely skip it. Recovery will
842 * cleanup any inodes we might inadvertantly skip here. */ 838 * cleanup any inodes we might inadvertantly skip here. */
843 if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE) { 839 if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE)
844 mlog(0, "Skipping delete of %lu because another node "
845 "has done this for us.\n", inode->i_ino);
846 goto bail_unlock; 840 goto bail_unlock;
847 }
848 841
849 ret = 1; 842 ret = 1;
850bail_unlock: 843bail_unlock:
@@ -861,28 +854,27 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
861 struct buffer_head *di_bh, 854 struct buffer_head *di_bh,
862 int *wipe) 855 int *wipe)
863{ 856{
864 int status = 0; 857 int status = 0, reason = 0;
865 struct ocfs2_inode_info *oi = OCFS2_I(inode); 858 struct ocfs2_inode_info *oi = OCFS2_I(inode);
866 struct ocfs2_dinode *di; 859 struct ocfs2_dinode *di;
867 860
868 *wipe = 0; 861 *wipe = 0;
869 862
863 trace_ocfs2_query_inode_wipe_begin((unsigned long long)oi->ip_blkno,
864 inode->i_nlink);
865
870 /* While we were waiting for the cluster lock in 866 /* While we were waiting for the cluster lock in
871 * ocfs2_delete_inode, another node might have asked to delete 867 * ocfs2_delete_inode, another node might have asked to delete
872 * the inode. Recheck our flags to catch this. */ 868 * the inode. Recheck our flags to catch this. */
873 if (!ocfs2_inode_is_valid_to_delete(inode)) { 869 if (!ocfs2_inode_is_valid_to_delete(inode)) {
874 mlog(0, "Skipping delete of %llu because flags changed\n", 870 reason = 1;
875 (unsigned long long)oi->ip_blkno);
876 goto bail; 871 goto bail;
877 } 872 }
878 873
879 /* Now that we have an up to date inode, we can double check 874 /* Now that we have an up to date inode, we can double check
880 * the link count. */ 875 * the link count. */
881 if (inode->i_nlink) { 876 if (inode->i_nlink)
882 mlog(0, "Skipping delete of %llu because nlink = %u\n",
883 (unsigned long long)oi->ip_blkno, inode->i_nlink);
884 goto bail; 877 goto bail;
885 }
886 878
887 /* Do some basic inode verification... */ 879 /* Do some basic inode verification... */
888 di = (struct ocfs2_dinode *) di_bh->b_data; 880 di = (struct ocfs2_dinode *) di_bh->b_data;
@@ -897,9 +889,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
897 * ORPHANED_FL not. 889 * ORPHANED_FL not.
898 */ 890 */
899 if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) { 891 if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) {
900 mlog(0, "Reflinked inode %llu is no longer orphaned. " 892 reason = 2;
901 "it shouldn't be deleted\n",
902 (unsigned long long)oi->ip_blkno);
903 goto bail; 893 goto bail;
904 } 894 }
905 895
@@ -936,8 +926,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
936 status = ocfs2_try_open_lock(inode, 1); 926 status = ocfs2_try_open_lock(inode, 1);
937 if (status == -EAGAIN) { 927 if (status == -EAGAIN) {
938 status = 0; 928 status = 0;
939 mlog(0, "Skipping delete of %llu because it is in use on " 929 reason = 3;
940 "other nodes\n", (unsigned long long)oi->ip_blkno);
941 goto bail; 930 goto bail;
942 } 931 }
943 if (status < 0) { 932 if (status < 0) {
@@ -946,11 +935,10 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
946 } 935 }
947 936
948 *wipe = 1; 937 *wipe = 1;
949 mlog(0, "Inode %llu is ok to wipe from orphan dir %u\n", 938 trace_ocfs2_query_inode_wipe_succ(le16_to_cpu(di->i_orphaned_slot));
950 (unsigned long long)oi->ip_blkno,
951 le16_to_cpu(di->i_orphaned_slot));
952 939
953bail: 940bail:
941 trace_ocfs2_query_inode_wipe_end(status, reason);
954 return status; 942 return status;
955} 943}
956 944
@@ -960,8 +948,8 @@ bail:
960static void ocfs2_cleanup_delete_inode(struct inode *inode, 948static void ocfs2_cleanup_delete_inode(struct inode *inode,
961 int sync_data) 949 int sync_data)
962{ 950{
963 mlog(0, "Cleanup inode %llu, sync = %d\n", 951 trace_ocfs2_cleanup_delete_inode(
964 (unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data); 952 (unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data);
965 if (sync_data) 953 if (sync_data)
966 write_inode_now(inode, 1); 954 write_inode_now(inode, 1);
967 truncate_inode_pages(&inode->i_data, 0); 955 truncate_inode_pages(&inode->i_data, 0);
@@ -973,15 +961,15 @@ static void ocfs2_delete_inode(struct inode *inode)
973 sigset_t oldset; 961 sigset_t oldset;
974 struct buffer_head *di_bh = NULL; 962 struct buffer_head *di_bh = NULL;
975 963
976 mlog(0, "(inode->i_ino = %lu)\n", inode->i_ino); 964 trace_ocfs2_delete_inode(inode->i_ino,
965 (unsigned long long)OCFS2_I(inode)->ip_blkno,
966 is_bad_inode(inode));
977 967
978 /* When we fail in read_inode() we mark inode as bad. The second test 968 /* When we fail in read_inode() we mark inode as bad. The second test
979 * catches the case when inode allocation fails before allocating 969 * catches the case when inode allocation fails before allocating
980 * a block for inode. */ 970 * a block for inode. */
981 if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno) { 971 if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno)
982 mlog(0, "Skipping delete of bad inode\n");
983 goto bail; 972 goto bail;
984 }
985 973
986 dquot_initialize(inode); 974 dquot_initialize(inode);
987 975
@@ -1082,8 +1070,8 @@ static void ocfs2_clear_inode(struct inode *inode)
1082 struct ocfs2_inode_info *oi = OCFS2_I(inode); 1070 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1083 1071
1084 end_writeback(inode); 1072 end_writeback(inode);
1085 mlog(0, "Clearing inode: %llu, nlink = %u\n", 1073 trace_ocfs2_clear_inode((unsigned long long)oi->ip_blkno,
1086 (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); 1074 inode->i_nlink);
1087 1075
1088 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, 1076 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
1089 "Inode=%lu\n", inode->i_ino); 1077 "Inode=%lu\n", inode->i_ino);
@@ -1193,8 +1181,8 @@ int ocfs2_drop_inode(struct inode *inode)
1193 struct ocfs2_inode_info *oi = OCFS2_I(inode); 1181 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1194 int res; 1182 int res;
1195 1183
1196 mlog(0, "Drop inode %llu, nlink = %u, ip_flags = 0x%x\n", 1184 trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno,
1197 (unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); 1185 inode->i_nlink, oi->ip_flags);
1198 1186
1199 if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED) 1187 if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)
1200 res = 1; 1188 res = 1;
@@ -1212,11 +1200,11 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
1212 struct inode *inode = dentry->d_inode; 1200 struct inode *inode = dentry->d_inode;
1213 int status = 0; 1201 int status = 0;
1214 1202
1215 mlog(0, "(inode = 0x%p, ino = %llu)\n", inode, 1203 trace_ocfs2_inode_revalidate(inode,
1216 inode ? (unsigned long long)OCFS2_I(inode)->ip_blkno : 0ULL); 1204 inode ? (unsigned long long)OCFS2_I(inode)->ip_blkno : 0ULL,
1205 inode ? (unsigned long long)OCFS2_I(inode)->ip_flags : 0);
1217 1206
1218 if (!inode) { 1207 if (!inode) {
1219 mlog(0, "eep, no inode!\n");
1220 status = -ENOENT; 1208 status = -ENOENT;
1221 goto bail; 1209 goto bail;
1222 } 1210 }
@@ -1224,7 +1212,6 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
1224 spin_lock(&OCFS2_I(inode)->ip_lock); 1212 spin_lock(&OCFS2_I(inode)->ip_lock);
1225 if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) { 1213 if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) {
1226 spin_unlock(&OCFS2_I(inode)->ip_lock); 1214 spin_unlock(&OCFS2_I(inode)->ip_lock);
1227 mlog(0, "inode deleted!\n");
1228 status = -ENOENT; 1215 status = -ENOENT;
1229 goto bail; 1216 goto bail;
1230 } 1217 }
@@ -1255,8 +1242,7 @@ int ocfs2_mark_inode_dirty(handle_t *handle,
1255 int status; 1242 int status;
1256 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bh->b_data; 1243 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bh->b_data;
1257 1244
1258 mlog(0, "(inode %llu)\n", 1245 trace_ocfs2_mark_inode_dirty((unsigned long long)OCFS2_I(inode)->ip_blkno);
1259 (unsigned long long)OCFS2_I(inode)->ip_blkno);
1260 1246
1261 status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh, 1247 status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh,
1262 OCFS2_JOURNAL_ACCESS_WRITE); 1248 OCFS2_JOURNAL_ACCESS_WRITE);
@@ -1328,8 +1314,7 @@ int ocfs2_validate_inode_block(struct super_block *sb,
1328 int rc; 1314 int rc;
1329 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; 1315 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
1330 1316
1331 mlog(0, "Validating dinode %llu\n", 1317 trace_ocfs2_validate_inode_block((unsigned long long)bh->b_blocknr);
1332 (unsigned long long)bh->b_blocknr);
1333 1318
1334 BUG_ON(!buffer_uptodate(bh)); 1319 BUG_ON(!buffer_uptodate(bh));
1335 1320
diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 16013b5588c6..052057a01ea8 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -114,6 +114,25 @@ DEFINE_EVENT(ocfs2__ull_uint, name, \
114 TP_PROTO(unsigned long long val1, unsigned int val2), \ 114 TP_PROTO(unsigned long long val1, unsigned int val2), \
115 TP_ARGS(val1, val2)) 115 TP_ARGS(val1, val2))
116 116
117DECLARE_EVENT_CLASS(ocfs2__ull_int,
118 TP_PROTO(unsigned long long value1, int value2),
119 TP_ARGS(value1, value2),
120 TP_STRUCT__entry(
121 __field(unsigned long long, value1)
122 __field(int, value2)
123 ),
124 TP_fast_assign(
125 __entry->value1 = value1;
126 __entry->value2 = value2;
127 ),
128 TP_printk("%llu %d", __entry->value1, __entry->value2)
129);
130
131#define DEFINE_OCFS2_ULL_INT_EVENT(name) \
132DEFINE_EVENT(ocfs2__ull_int, name, \
133 TP_PROTO(unsigned long long val1, int val2), \
134 TP_ARGS(val1, val2))
135
117DECLARE_EVENT_CLASS(ocfs2__ull_ull, 136DECLARE_EVENT_CLASS(ocfs2__ull_ull,
118 TP_PROTO(unsigned long long value1, unsigned long long value2), 137 TP_PROTO(unsigned long long value1, unsigned long long value2),
119 TP_ARGS(value1, value2), 138 TP_ARGS(value1, value2),
@@ -1354,6 +1373,123 @@ DEFINE_OCFS2_INT_EVENT(generic_file_aio_read_ret);
1354 1373
1355/* End of trace events for fs/ocfs2/file.c. */ 1374/* End of trace events for fs/ocfs2/file.c. */
1356 1375
1376/* Trace events for fs/ocfs2/inode.c. */
1377
1378TRACE_EVENT(ocfs2_iget_begin,
1379 TP_PROTO(unsigned long long ino, unsigned int flags, int sysfile_type),
1380 TP_ARGS(ino, flags, sysfile_type),
1381 TP_STRUCT__entry(
1382 __field(unsigned long long, ino)
1383 __field(unsigned int, flags)
1384 __field(int, sysfile_type)
1385 ),
1386 TP_fast_assign(
1387 __entry->ino = ino;
1388 __entry->flags = flags;
1389 __entry->sysfile_type = sysfile_type;
1390 ),
1391 TP_printk("%llu %u %d", __entry->ino,
1392 __entry->flags, __entry->sysfile_type)
1393);
1394
1395DEFINE_OCFS2_ULL_EVENT(ocfs2_iget5_locked);
1396
1397TRACE_EVENT(ocfs2_iget_end,
1398 TP_PROTO(void *inode, unsigned long long ino),
1399 TP_ARGS(inode, ino),
1400 TP_STRUCT__entry(
1401 __field(void *, inode)
1402 __field(unsigned long long, ino)
1403 ),
1404 TP_fast_assign(
1405 __entry->inode = inode;
1406 __entry->ino = ino;
1407 ),
1408 TP_printk("%p %llu", __entry->inode, __entry->ino)
1409);
1410
1411TRACE_EVENT(ocfs2_find_actor,
1412 TP_PROTO(void *inode, unsigned long long ino,
1413 void *args, unsigned long long fi_blkno),
1414 TP_ARGS(inode, ino, args, fi_blkno),
1415 TP_STRUCT__entry(
1416 __field(void *, inode)
1417 __field(unsigned long long, ino)
1418 __field(void *, args)
1419 __field(unsigned long long, fi_blkno)
1420 ),
1421 TP_fast_assign(
1422 __entry->inode = inode;
1423 __entry->ino = ino;
1424 __entry->args = args;
1425 __entry->fi_blkno = fi_blkno;
1426 ),
1427 TP_printk("%p %llu %p %llu", __entry->inode, __entry->ino,
1428 __entry->args, __entry->fi_blkno)
1429);
1430
1431DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_populate_inode);
1432
1433DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_read_locked_inode);
1434
1435DEFINE_OCFS2_INT_INT_EVENT(ocfs2_check_orphan_recovery_state);
1436
1437DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_inode_block);
1438
1439TRACE_EVENT(ocfs2_inode_is_valid_to_delete,
1440 TP_PROTO(void *task, void *dc_task, unsigned long long ino,
1441 unsigned int flags),
1442 TP_ARGS(task, dc_task, ino, flags),
1443 TP_STRUCT__entry(
1444 __field(void *, task)
1445 __field(void *, dc_task)
1446 __field(unsigned long long, ino)
1447 __field(unsigned int, flags)
1448 ),
1449 TP_fast_assign(
1450 __entry->task = task;
1451 __entry->dc_task = dc_task;
1452 __entry->ino = ino;
1453 __entry->flags = flags;
1454 ),
1455 TP_printk("%p %p %llu %u", __entry->task, __entry->dc_task,
1456 __entry->ino, __entry->flags)
1457);
1458
1459DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_query_inode_wipe_begin);
1460
1461DEFINE_OCFS2_UINT_EVENT(ocfs2_query_inode_wipe_succ);
1462
1463DEFINE_OCFS2_INT_INT_EVENT(ocfs2_query_inode_wipe_end);
1464
1465DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_cleanup_delete_inode);
1466
1467DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_delete_inode);
1468
1469DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_clear_inode);
1470
1471DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_drop_inode);
1472
1473TRACE_EVENT(ocfs2_inode_revalidate,
1474 TP_PROTO(void *inode, unsigned long long ino,
1475 unsigned int flags),
1476 TP_ARGS(inode, ino, flags),
1477 TP_STRUCT__entry(
1478 __field(void *, inode)
1479 __field(unsigned long long, ino)
1480 __field(unsigned int, flags)
1481 ),
1482 TP_fast_assign(
1483 __entry->inode = inode;
1484 __entry->ino = ino;
1485 __entry->flags = flags;
1486 ),
1487 TP_printk("%p %llu %u", __entry->inode, __entry->ino, __entry->flags)
1488);
1489
1490DEFINE_OCFS2_ULL_EVENT(ocfs2_mark_inode_dirty);
1491
1492/* End of trace events for fs/ocfs2/inode.c. */
1357#endif /* _TRACE_OCFS2_H */ 1493#endif /* _TRACE_OCFS2_H */
1358 1494
1359/* This part must be outside protection */ 1495/* This part must be outside protection */