aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blktrace.c5
-rw-r--r--block/ioctl.c4
-rw-r--r--block/ll_rw_blk.c4
3 files changed, 8 insertions, 5 deletions
diff --git a/block/blktrace.c b/block/blktrace.c
index 92925e7d9e6c..b8c0702777ff 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
69/* 69/*
70 * Bio action bits of interest 70 * Bio action bits of interest
71 */ 71 */
72static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC) }; 72static 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) };
73 73
74/* 74/*
75 * More could be added as needed, taking care to increment the decrementer 75 * More could be added as needed, taking care to increment the decrementer
@@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
79 (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0)) 79 (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
80#define trace_sync_bit(rw) \ 80#define trace_sync_bit(rw) \
81 (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1)) 81 (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
82#define trace_ahead_bit(rw) \
83 (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
82 84
83/* 85/*
84 * The worker for the various blk_add_trace*() types. Fills out a 86 * The worker for the various blk_add_trace*() types. Fills out a
@@ -100,6 +102,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
100 what |= ddir_act[rw & WRITE]; 102 what |= ddir_act[rw & WRITE];
101 what |= bio_act[trace_barrier_bit(rw)]; 103 what |= bio_act[trace_barrier_bit(rw)];
102 what |= bio_act[trace_sync_bit(rw)]; 104 what |= bio_act[trace_sync_bit(rw)];
105 what |= bio_act[trace_ahead_bit(rw)];
103 106
104 pid = tsk->pid; 107 pid = tsk->pid;
105 if (unlikely(act_log_check(bt, what, sector, pid))) 108 if (unlikely(act_log_check(bt, what, sector, pid)))
diff --git a/block/ioctl.c b/block/ioctl.c
index 9cfa2e1ecb24..309760b7e37f 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
72 bdevp = bdget_disk(disk, part); 72 bdevp = bdget_disk(disk, part);
73 if (!bdevp) 73 if (!bdevp)
74 return -ENOMEM; 74 return -ENOMEM;
75 mutex_lock(&bdevp->bd_mutex); 75 mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
76 if (bdevp->bd_openers) { 76 if (bdevp->bd_openers) {
77 mutex_unlock(&bdevp->bd_mutex); 77 mutex_unlock(&bdevp->bd_mutex);
78 bdput(bdevp); 78 bdput(bdevp);
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
82 fsync_bdev(bdevp); 82 fsync_bdev(bdevp);
83 invalidate_bdev(bdevp, 0); 83 invalidate_bdev(bdevp, 0);
84 84
85 mutex_lock(&bdev->bd_mutex); 85 mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
86 delete_partition(disk, part); 86 delete_partition(disk, part);
87 mutex_unlock(&bdev->bd_mutex); 87 mutex_unlock(&bdev->bd_mutex);
88 mutex_unlock(&bdevp->bd_mutex); 88 mutex_unlock(&bdevp->bd_mutex);
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index ab17c7224bb6..61d6b3c65b66 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3491,8 +3491,8 @@ EXPORT_SYMBOL(end_request);
3491 3491
3492void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio) 3492void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio)
3493{ 3493{
3494 /* first three bits are identical in rq->flags and bio->bi_rw */ 3494 /* first two bits are identical in rq->flags and bio->bi_rw */
3495 rq->flags |= (bio->bi_rw & 7); 3495 rq->flags |= (bio->bi_rw & 3);
3496 3496
3497 rq->nr_phys_segments = bio_phys_segments(q, bio); 3497 rq->nr_phys_segments = bio_phys_segments(q, bio);
3498 rq->nr_hw_segments = bio_hw_segments(q, bio); 3498 rq->nr_hw_segments = bio_hw_segments(q, bio);