[PATCH 32/35] block: shrink bi_rw and bi_op

2016-02-24 Thread mchristi
From: Mike Christie 

There is no need for bi_op/op and bi_rw to be so large
now, so this patch shrinks them.

Signed-off-by: Mike Christie 
---
 block/blk-core.c   |  2 +-
 drivers/md/dm-flakey.c |  2 +-
 drivers/md/raid5.c | 13 +++--
 fs/btrfs/check-integrity.c |  4 ++--
 fs/btrfs/inode.c   |  2 +-
 include/linux/bio.h| 13 ++---
 include/linux/blk_types.h  | 11 +++
 include/linux/blkdev.h |  2 +-
 8 files changed, 18 insertions(+), 31 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index bba1a69..5436c19 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1853,7 +1853,7 @@ static void handle_bad_sector(struct bio *bio)
char b[BDEVNAME_SIZE];
 
printk(KERN_INFO "attempt to access beyond end of device\n");
-   printk(KERN_INFO "%s: rw=%d,%ld, want=%Lu, limit=%Lu\n",
+   printk(KERN_INFO "%s: rw=%d,%u, want=%Lu, limit=%Lu\n",
bdevname(bio->bi_bdev, b),
bio->bi_op, bio->bi_rw,
(unsigned long long)bio_end_sector(bio),
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index b7341de..29b99fb 100644
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -266,7 +266,7 @@ static void corrupt_bio_data(struct bio *bio, struct 
flakey_c *fc)
data[fc->corrupt_bio_byte - 1] = fc->corrupt_bio_value;
 
DMDEBUG("Corrupting data bio=%p by writing %u to byte %u "
-   "(rw=%c bi_rw=%lu bi_sector=%llu cur_bytes=%u)\n",
+   "(rw=%c bi_rw=%u bi_sector=%llu cur_bytes=%u)\n",
bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
(bio_data_dir(bio) == WRITE) ? 'w' : 'r', bio->bi_rw,
(unsigned long long)bio->bi_iter.bi_sector, bio_bytes);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 0c53ca2..e9bc323 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1015,9 +1015,9 @@ again:
: raid5_end_read_request;
bi->bi_private = sh;
 
-   pr_debug("%s: for %llu schedule op %ld on disc %d\n",
+   pr_debug("%s: for %llu schedule op %d,%u on disc %d\n",
__func__, (unsigned long long)sh->sector,
-   bi->bi_rw, i);
+   bi->bi_op, bi->bi_rw, i);
atomic_inc(>count);
if (sh != head_sh)
atomic_inc(_sh->count);
@@ -1067,10 +1067,10 @@ again:
rbi->bi_end_io = raid5_end_write_request;
rbi->bi_private = sh;
 
-   pr_debug("%s: for %llu schedule op %ld on "
+   pr_debug("%s: for %llu schedule op %d,%u on "
 "replacement disc %d\n",
__func__, (unsigned long long)sh->sector,
-   rbi->bi_rw, i);
+   rbi->bi_op, rbi->bi_rw, i);
atomic_inc(>count);
if (sh != head_sh)
atomic_inc(_sh->count);
@@ -1102,8 +1102,9 @@ again:
if (!rdev && !rrdev) {
if (op_is_write(op))
set_bit(STRIPE_DEGRADED, >state);
-   pr_debug("skip op %ld on disc %d for sector %llu\n",
-   bi->bi_rw, i, (unsigned long long)sh->sector);
+   pr_debug("skip op %d,%u on disc %d for sector %llu\n",
+bi->bi_op, bi->bi_rw, i,
+(unsigned long long)sh->sector);
clear_bit(R5_LOCKED, >dev[i].flags);
set_bit(STRIPE_HANDLE, >state);
}
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index d95c323..9dc4394 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -2941,7 +2941,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
if (dev_state->state->print_mask &
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
printk(KERN_INFO
-  "submit_bio(rw=%d,0x%lx, bi_vcnt=%u,"
+  "submit_bio(rw=%d,0x%x, bi_vcnt=%u,"
   " bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
   bio->bi_op, bio->bi_rw, bio->bi_vcnt,
   (unsigned long long)bio->bi_iter.bi_sector,
@@ -2984,7 +2984,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
if (dev_state->state->print_mask &
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
printk(KERN_INFO
-  

[PATCH 32/35] block: shrink bi_rw and bi_op

2016-01-05 Thread mchristi
From: Mike Christie 

There is no need for bi_op/op and bi_rw to be so large
now, so this patch shrinks them.

Signed-off-by: Mike Christie 
---
 block/blk-core.c   |  2 +-
 drivers/md/dm-flakey.c |  2 +-
 drivers/md/raid5.c | 13 +++--
 fs/btrfs/check-integrity.c |  4 ++--
 fs/btrfs/inode.c   |  2 +-
 include/linux/bio.h| 13 ++---
 include/linux/blk_types.h  | 11 +++
 include/linux/blkdev.h |  2 +-
 8 files changed, 18 insertions(+), 31 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 0f6cb5c..ae2afab 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1854,7 +1854,7 @@ static void handle_bad_sector(struct bio *bio)
char b[BDEVNAME_SIZE];
 
printk(KERN_INFO "attempt to access beyond end of device\n");
-   printk(KERN_INFO "%s: rw=%d,%ld, want=%Lu, limit=%Lu\n",
+   printk(KERN_INFO "%s: rw=%d,%u, want=%Lu, limit=%Lu\n",
bdevname(bio->bi_bdev, b),
bio->bi_op, bio->bi_rw,
(unsigned long long)bio_end_sector(bio),
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index 09e2afc..b831226 100644
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -266,7 +266,7 @@ static void corrupt_bio_data(struct bio *bio, struct 
flakey_c *fc)
data[fc->corrupt_bio_byte - 1] = fc->corrupt_bio_value;
 
DMDEBUG("Corrupting data bio=%p by writing %u to byte %u "
-   "(rw=%c bi_rw=%lu bi_sector=%llu cur_bytes=%u)\n",
+   "(rw=%c bi_rw=%u bi_sector=%llu cur_bytes=%u)\n",
bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
(bio_data_dir(bio) == WRITE) ? 'w' : 'r', bio->bi_rw,
(unsigned long long)bio->bi_iter.bi_sector, bio_bytes);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index fa4fe95..aafd49e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1015,9 +1015,9 @@ again:
: raid5_end_read_request;
bi->bi_private = sh;
 
-   pr_debug("%s: for %llu schedule op %ld on disc %d\n",
+   pr_debug("%s: for %llu schedule op %d,%u on disc %d\n",
__func__, (unsigned long long)sh->sector,
-   bi->bi_rw, i);
+   bi->bi_op, bi->bi_rw, i);
atomic_inc(>count);
if (sh != head_sh)
atomic_inc(_sh->count);
@@ -1067,10 +1067,10 @@ again:
rbi->bi_end_io = raid5_end_write_request;
rbi->bi_private = sh;
 
-   pr_debug("%s: for %llu schedule op %ld on "
+   pr_debug("%s: for %llu schedule op %d,%u on "
 "replacement disc %d\n",
__func__, (unsigned long long)sh->sector,
-   rbi->bi_rw, i);
+   rbi->bi_op, rbi->bi_rw, i);
atomic_inc(>count);
if (sh != head_sh)
atomic_inc(_sh->count);
@@ -1102,8 +1102,9 @@ again:
if (!rdev && !rrdev) {
if (op_is_write(op))
set_bit(STRIPE_DEGRADED, >state);
-   pr_debug("skip op %ld on disc %d for sector %llu\n",
-   bi->bi_rw, i, (unsigned long long)sh->sector);
+   pr_debug("skip op %d,%u on disc %d for sector %llu\n",
+bi->bi_op, bi->bi_rw, i,
+(unsigned long long)sh->sector);
clear_bit(R5_LOCKED, >dev[i].flags);
set_bit(STRIPE_HANDLE, >state);
}
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index e409d1f..1623d11 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -2985,7 +2985,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
if (dev_state->state->print_mask &
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
printk(KERN_INFO
-  "submit_bio(rw=%d,0x%lx, bi_vcnt=%u,"
+  "submit_bio(rw=%d,0x%x, bi_vcnt=%u,"
   " bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
   bio->bi_op, bio->bi_rw, bio->bi_vcnt,
   (unsigned long long)bio->bi_iter.bi_sector,
@@ -3028,7 +3028,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
if (dev_state->state->print_mask &
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
printk(KERN_INFO
-