Skip to content

Commit

Permalink
Merge branch 'blktrace' of git://brick.kernel.dk/data/git/linux-2.6-b…
Browse files Browse the repository at this point in the history
…lock

* 'blktrace' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [PATCH] Only the first two bits in bio->bi_rw and rq->flags match
  [PATCH] blktrace: readahead support
  [PATCH] blktrace: fix barrier vs sync typo
  • Loading branch information
Linus Torvalds committed Jul 9, 2006
2 parents 953969d + 1959d21 commit 84e74f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
/*
* Bio action bits of interest
*/
static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC) };
static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC), 0, BLK_TC_ACT(BLK_TC_AHEAD) };

/*
* More could be added as needed, taking care to increment the decrementer
Expand All @@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
(((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
#define trace_sync_bit(rw) \
(((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
#define trace_ahead_bit(rw) \
(((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))

/*
* The worker for the various blk_add_trace*() types. Fills out a
Expand All @@ -100,6 +102,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
what |= ddir_act[rw & WRITE];
what |= bio_act[trace_barrier_bit(rw)];
what |= bio_act[trace_sync_bit(rw)];
what |= bio_act[trace_ahead_bit(rw)];

pid = tsk->pid;
if (unlikely(act_log_check(bt, what, sector, pid)))
Expand Down
4 changes: 2 additions & 2 deletions block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3491,8 +3491,8 @@ EXPORT_SYMBOL(end_request);

void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio)
{
/* first three bits are identical in rq->flags and bio->bi_rw */
rq->flags |= (bio->bi_rw & 7);
/* first two bits are identical in rq->flags and bio->bi_rw */
rq->flags |= (bio->bi_rw & 3);

rq->nr_phys_segments = bio_phys_segments(q, bio);
rq->nr_hw_segments = bio_hw_segments(q, bio);
Expand Down
5 changes: 3 additions & 2 deletions include/linux/blktrace_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ enum blktrace_cat {
BLK_TC_READ = 1 << 0, /* reads */
BLK_TC_WRITE = 1 << 1, /* writes */
BLK_TC_BARRIER = 1 << 2, /* barrier */
BLK_TC_SYNC = 1 << 3, /* barrier */
BLK_TC_SYNC = 1 << 3, /* sync IO */
BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
BLK_TC_REQUEUE = 1 << 5, /* requeueing */
BLK_TC_ISSUE = 1 << 6, /* issue */
BLK_TC_COMPLETE = 1 << 7, /* completions */
BLK_TC_FS = 1 << 8, /* fs requests */
BLK_TC_PC = 1 << 9, /* pc requests */
BLK_TC_NOTIFY = 1 << 10, /* special message */
BLK_TC_AHEAD = 1 << 11, /* readahead */

BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
};
Expand Down Expand Up @@ -147,7 +148,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
u32 what)
{
struct blk_trace *bt = q->blk_trace;
int rw = rq->flags & 0x07;
int rw = rq->flags & 0x03;

if (likely(!bt))
return;
Expand Down

0 comments on commit 84e74f6

Please sign in to comment.