aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/buffer_head_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/buffer_head_io.c')
-rw-r--r--fs/ocfs2/buffer_head_io.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index c23846dbfc8f..d1cf9abcd827 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -35,8 +35,8 @@
35#include "inode.h" 35#include "inode.h"
36#include "journal.h" 36#include "journal.h"
37#include "uptodate.h" 37#include "uptodate.h"
38
39#include "buffer_head_io.h" 38#include "buffer_head_io.h"
39#include "ocfs2_trace.h"
40 40
41/* 41/*
42 * Bits on bh->b_state used by ocfs2. 42 * Bits on bh->b_state used by ocfs2.
@@ -55,8 +55,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
55{ 55{
56 int ret = 0; 56 int ret = 0;
57 57
58 mlog(0, "(bh->b_blocknr = %llu, ci=%p)\n", 58 trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci);
59 (unsigned long long)bh->b_blocknr, ci);
60 59
61 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); 60 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO);
62 BUG_ON(buffer_jbd(bh)); 61 BUG_ON(buffer_jbd(bh));
@@ -107,10 +106,10 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
107 unsigned int i; 106 unsigned int i;
108 struct buffer_head *bh; 107 struct buffer_head *bh;
109 108
110 if (!nr) { 109 trace_ocfs2_read_blocks_sync((unsigned long long)block, nr);
111 mlog(ML_BH_IO, "No buffers will be read!\n"); 110
111 if (!nr)
112 goto bail; 112 goto bail;
113 }
114 113
115 for (i = 0 ; i < nr ; i++) { 114 for (i = 0 ; i < nr ; i++) {
116 if (bhs[i] == NULL) { 115 if (bhs[i] == NULL) {
@@ -124,10 +123,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
124 bh = bhs[i]; 123 bh = bhs[i];
125 124
126 if (buffer_jbd(bh)) { 125 if (buffer_jbd(bh)) {
127 mlog(ML_BH_IO, 126 trace_ocfs2_read_blocks_sync_jbd(
128 "trying to sync read a jbd " 127 (unsigned long long)bh->b_blocknr);
129 "managed bh (blocknr = %llu), skipping\n",
130 (unsigned long long)bh->b_blocknr);
131 continue; 128 continue;
132 } 129 }
133 130
@@ -187,8 +184,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
187 struct buffer_head *bh; 184 struct buffer_head *bh;
188 struct super_block *sb = ocfs2_metadata_cache_get_super(ci); 185 struct super_block *sb = ocfs2_metadata_cache_get_super(ci);
189 186
190 mlog(0, "(ci=%p, block=(%llu), nr=(%d), flags=%d)\n", 187 trace_ocfs2_read_blocks_begin(ci, (unsigned long long)block, nr, flags);
191 ci, (unsigned long long)block, nr, flags);
192 188
193 BUG_ON(!ci); 189 BUG_ON(!ci);
194 BUG_ON((flags & OCFS2_BH_READAHEAD) && 190 BUG_ON((flags & OCFS2_BH_READAHEAD) &&
@@ -208,7 +204,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
208 } 204 }
209 205
210 if (nr == 0) { 206 if (nr == 0) {
211 mlog(ML_BH_IO, "No buffers will be read!\n");
212 status = 0; 207 status = 0;
213 goto bail; 208 goto bail;
214 } 209 }
@@ -261,11 +256,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
261 ignore_cache = 1; 256 ignore_cache = 1;
262 } 257 }
263 258
259 trace_ocfs2_read_blocks_bh((unsigned long long)bh->b_blocknr,
260 ignore_cache, buffer_jbd(bh), buffer_dirty(bh));
261
264 if (buffer_jbd(bh)) { 262 if (buffer_jbd(bh)) {
265 if (ignore_cache)
266 mlog(ML_BH_IO, "trying to sync read a jbd "
267 "managed bh (blocknr = %llu)\n",
268 (unsigned long long)bh->b_blocknr);
269 continue; 263 continue;
270 } 264 }
271 265
@@ -273,9 +267,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
273 if (buffer_dirty(bh)) { 267 if (buffer_dirty(bh)) {
274 /* This should probably be a BUG, or 268 /* This should probably be a BUG, or
275 * at least return an error. */ 269 * at least return an error. */
276 mlog(ML_BH_IO, "asking me to sync read a dirty "
277 "buffer! (blocknr = %llu)\n",
278 (unsigned long long)bh->b_blocknr);
279 continue; 270 continue;
280 } 271 }
281 272
@@ -368,10 +359,8 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
368 } 359 }
369 ocfs2_metadata_cache_io_unlock(ci); 360 ocfs2_metadata_cache_io_unlock(ci);
370 361
371 mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n", 362 trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
372 (unsigned long long)block, nr, 363 flags, ignore_cache);
373 ((flags & OCFS2_BH_IGNORE_CACHE) || ignore_cache) ? "no" : "yes",
374 flags);
375 364
376bail: 365bail:
377 366