aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trace.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:58:51 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:47 -0400
commit4e94b71b7068b4bd9c615301197e09dbf0c3b770 (patch)
treefc441ec17202a749a6b1a3d5b70ba37101b595da /fs/xfs/xfs_trace.h
parentde1cbee46269a3b707eb99b37f33afdd4cfaaea4 (diff)
xfs: use blocks for counting length of buffers
Now that we pass block counts everywhere, and index buffers by block number, track the length of the buffer in units of blocks rather than bytes. Convert the code to use block counts, and those that need byte counts get converted at the time of use. Also, remove the XFS_BUF_{SET_}SIZE() macros that are just wrappers around the buffer length. They only serve to make the code shouty loud and don't actually add any real value. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_trace.h')
-rw-r--r--fs/xfs/xfs_trace.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 2e41756e263a..900764c450a8 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -281,7 +281,7 @@ DECLARE_EVENT_CLASS(xfs_buf_class,
281 TP_STRUCT__entry( 281 TP_STRUCT__entry(
282 __field(dev_t, dev) 282 __field(dev_t, dev)
283 __field(xfs_daddr_t, bno) 283 __field(xfs_daddr_t, bno)
284 __field(size_t, buffer_length) 284 __field(int, nblks)
285 __field(int, hold) 285 __field(int, hold)
286 __field(int, pincount) 286 __field(int, pincount)
287 __field(unsigned, lockval) 287 __field(unsigned, lockval)
@@ -291,18 +291,18 @@ DECLARE_EVENT_CLASS(xfs_buf_class,
291 TP_fast_assign( 291 TP_fast_assign(
292 __entry->dev = bp->b_target->bt_dev; 292 __entry->dev = bp->b_target->bt_dev;
293 __entry->bno = bp->b_bn; 293 __entry->bno = bp->b_bn;
294 __entry->buffer_length = bp->b_buffer_length; 294 __entry->nblks = bp->b_length;
295 __entry->hold = atomic_read(&bp->b_hold); 295 __entry->hold = atomic_read(&bp->b_hold);
296 __entry->pincount = atomic_read(&bp->b_pin_count); 296 __entry->pincount = atomic_read(&bp->b_pin_count);
297 __entry->lockval = bp->b_sema.count; 297 __entry->lockval = bp->b_sema.count;
298 __entry->flags = bp->b_flags; 298 __entry->flags = bp->b_flags;
299 __entry->caller_ip = caller_ip; 299 __entry->caller_ip = caller_ip;
300 ), 300 ),
301 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " 301 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
302 "lock %d flags %s caller %pf", 302 "lock %d flags %s caller %pf",
303 MAJOR(__entry->dev), MINOR(__entry->dev), 303 MAJOR(__entry->dev), MINOR(__entry->dev),
304 (unsigned long long)__entry->bno, 304 (unsigned long long)__entry->bno,
305 __entry->buffer_length, 305 __entry->nblks,
306 __entry->hold, 306 __entry->hold,
307 __entry->pincount, 307 __entry->pincount,
308 __entry->lockval, 308 __entry->lockval,
@@ -362,7 +362,7 @@ DECLARE_EVENT_CLASS(xfs_buf_flags_class,
362 TP_fast_assign( 362 TP_fast_assign(
363 __entry->dev = bp->b_target->bt_dev; 363 __entry->dev = bp->b_target->bt_dev;
364 __entry->bno = bp->b_bn; 364 __entry->bno = bp->b_bn;
365 __entry->buffer_length = bp->b_buffer_length; 365 __entry->buffer_length = BBTOB(bp->b_length);
366 __entry->flags = flags; 366 __entry->flags = flags;
367 __entry->hold = atomic_read(&bp->b_hold); 367 __entry->hold = atomic_read(&bp->b_hold);
368 __entry->pincount = atomic_read(&bp->b_pin_count); 368 __entry->pincount = atomic_read(&bp->b_pin_count);
@@ -406,7 +406,7 @@ TRACE_EVENT(xfs_buf_ioerror,
406 TP_fast_assign( 406 TP_fast_assign(
407 __entry->dev = bp->b_target->bt_dev; 407 __entry->dev = bp->b_target->bt_dev;
408 __entry->bno = bp->b_bn; 408 __entry->bno = bp->b_bn;
409 __entry->buffer_length = bp->b_buffer_length; 409 __entry->buffer_length = BBTOB(bp->b_length);
410 __entry->hold = atomic_read(&bp->b_hold); 410 __entry->hold = atomic_read(&bp->b_hold);
411 __entry->pincount = atomic_read(&bp->b_pin_count); 411 __entry->pincount = atomic_read(&bp->b_pin_count);
412 __entry->lockval = bp->b_sema.count; 412 __entry->lockval = bp->b_sema.count;
@@ -450,7 +450,7 @@ DECLARE_EVENT_CLASS(xfs_buf_item_class,
450 __entry->bli_recur = bip->bli_recur; 450 __entry->bli_recur = bip->bli_recur;
451 __entry->bli_refcount = atomic_read(&bip->bli_refcount); 451 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
452 __entry->buf_bno = bip->bli_buf->b_bn; 452 __entry->buf_bno = bip->bli_buf->b_bn;
453 __entry->buf_len = bip->bli_buf->b_buffer_length; 453 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
454 __entry->buf_flags = bip->bli_buf->b_flags; 454 __entry->buf_flags = bip->bli_buf->b_flags;
455 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); 455 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
456 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); 456 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);