All of lore.kernel.org
 help / color / mirror / Atom feed
From: mchristi@redhat.com
To: linux-f2fs-devel@lists.sourceforge.net,
	linux-ext4@vger.kernel.org, konrad.wilk@oracle.com,
	drbd-dev@lists.linbit.com, philipp.reisner@linbit.com,
	lars.ellenberg@linbit.com, linux-raid@vger.kernel.org,
	dm-devel@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-mtd@lists.infradead.org, target-devel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, osd-dev@open-osd.org,
	xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com
Cc: Mike Christie <mchristi@redhat.com>
Subject: [PATCH 32/35] block: shrink bi_rw and bi_op
Date: Tue,  5 Jan 2016 14:53:35 -0600	[thread overview]
Message-ID: <1452027218-32303-33-git-send-email-mchristi@redhat.com> (raw)
In-Reply-To: <1452027218-32303-1-git-send-email-mchristi@redhat.com>

From: Mike Christie <mchristi@redhat.com>

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 <mchristi@redhat.com>
---
 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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_sh->count);
@@ -1102,8 +1102,9 @@ again:
 		if (!rdev && !rrdev) {
 			if (op_is_write(op))
 				set_bit(STRIPE_DEGRADED, &sh->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, &sh->dev[i].flags);
 			set_bit(STRIPE_HANDLE, &sh->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
-			       "submit_bio(rw=%d,0x%lx FLUSH, bdev=%p)\n",
+			       "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
 			       bio->bi_op, bio->bi_rw, bio->bi_bdev);
 		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 			if ((dev_state->state->print_mask &
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a96984f..b9c3799 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8061,7 +8061,7 @@ static void btrfs_end_dio_bio(struct bio *bio)
 
 	if (err)
 		btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
-			   "direct IO failed ino %llu rw %d,%lu sector %#Lx len %u err no %d",
+			   "direct IO failed ino %llu rw %d,0x%x sector %#Lx len %u err no %d",
 			   btrfs_ino(dip->inode), bio->bi_op, bio->bi_rw,
 			   (unsigned long long)bio->bi_iter.bi_sector,
 			   bio->bi_iter.bi_size, err);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 1e4b3b5..c91afc1 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -44,18 +44,9 @@
 #define BIO_MAX_SIZE		(BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
 #define BIO_MAX_SECTORS		(BIO_MAX_SIZE >> 9)
 
-/*
- * upper 16 bits of bi_rw define the io priority of this bio
- */
-#define BIO_PRIO_SHIFT	(8 * sizeof(unsigned long) - IOPRIO_BITS)
-#define bio_prio(bio)	((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio(bio)		(bio)->bi_ioprio
 #define bio_prio_valid(bio)	ioprio_valid(bio_prio(bio))
-
-#define bio_set_prio(bio, prio)		do {			\
-	WARN_ON(prio >= (1 << IOPRIO_BITS));			\
-	(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);		\
-	(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);	\
-} while (0)
+#define bio_set_prio(bio, prio)	((bio)->bi_ioprio = prio)
 
 /*
  * various member access, note that bio_data should of course not be used
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index bb30c2b..5d19b393 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -48,14 +48,9 @@ struct bio {
 	struct block_device	*bi_bdev;
 	unsigned int		bi_flags;	/* status, command, etc */
 	int			bi_error;
-	unsigned long		bi_rw;		/* bottom bits rq_flags_bits
-						 * top bits priority
-						 */
-	/*
-	 * this will be a u8 in the next patches and bi_rw can be shrunk to
-	 * a u32. For compat in these transistional patches op is a int here.
-	 */
-	int			bi_op;		/* REQ_OP */
+	unsigned int		bi_rw;		/* rq_flag_bits */
+	unsigned short		bi_ioprio;
+	u8			bi_op;		/* REQ_OP */
 
 
 	struct bvec_iter	bi_iter;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bc024c7..83d6f033 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -96,7 +96,7 @@ struct request {
 	struct request_queue *q;
 	struct blk_mq_ctx *mq_ctx;
 
-	int op;
+	u8 op;
 	u64 cmd_flags;
 	unsigned cmd_type;
 	unsigned long atomic_flags;
-- 
1.8.3.1


WARNING: multiple messages have this Message-ID (diff)
From: mchristi@redhat.com
To: linux-f2fs-devel@lists.sourceforge.net,
	linux-ext4@vger.kernel.org, konrad.wilk@oracle.com,
	drbd-dev@lists.linbit.com, philipp.reisner@linbit.com,
	lars.ellenberg@linbit.com, linux-raid@vger.kernel.org,
	dm-devel@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-mtd@lists.infradead.org, target-devel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, osd-dev@open-osd.org,
	xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com
Cc: Mike Christie <mchristi@redhat.com>
Subject: [PATCH 32/35] block: shrink bi_rw and bi_op
Date: Tue,  5 Jan 2016 14:53:35 -0600	[thread overview]
Message-ID: <1452027218-32303-33-git-send-email-mchristi@redhat.com> (raw)
In-Reply-To: <1452027218-32303-1-git-send-email-mchristi@redhat.com>

From: Mike Christie <mchristi@redhat.com>

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 <mchristi@redhat.com>
---
 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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_sh->count);
@@ -1102,8 +1102,9 @@ again:
 		if (!rdev && !rrdev) {
 			if (op_is_write(op))
 				set_bit(STRIPE_DEGRADED, &sh->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, &sh->dev[i].flags);
 			set_bit(STRIPE_HANDLE, &sh->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
-			       "submit_bio(rw=%d,0x%lx FLUSH, bdev=%p)\n",
+			       "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
 			       bio->bi_op, bio->bi_rw, bio->bi_bdev);
 		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 			if ((dev_state->state->print_mask &
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a96984f..b9c3799 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8061,7 +8061,7 @@ static void btrfs_end_dio_bio(struct bio *bio)
 
 	if (err)
 		btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
-			   "direct IO failed ino %llu rw %d,%lu sector %#Lx len %u err no %d",
+			   "direct IO failed ino %llu rw %d,0x%x sector %#Lx len %u err no %d",
 			   btrfs_ino(dip->inode), bio->bi_op, bio->bi_rw,
 			   (unsigned long long)bio->bi_iter.bi_sector,
 			   bio->bi_iter.bi_size, err);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 1e4b3b5..c91afc1 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -44,18 +44,9 @@
 #define BIO_MAX_SIZE		(BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
 #define BIO_MAX_SECTORS		(BIO_MAX_SIZE >> 9)
 
-/*
- * upper 16 bits of bi_rw define the io priority of this bio
- */
-#define BIO_PRIO_SHIFT	(8 * sizeof(unsigned long) - IOPRIO_BITS)
-#define bio_prio(bio)	((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio(bio)		(bio)->bi_ioprio
 #define bio_prio_valid(bio)	ioprio_valid(bio_prio(bio))
-
-#define bio_set_prio(bio, prio)		do {			\
-	WARN_ON(prio >= (1 << IOPRIO_BITS));			\
-	(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);		\
-	(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);	\
-} while (0)
+#define bio_set_prio(bio, prio)	((bio)->bi_ioprio = prio)
 
 /*
  * various member access, note that bio_data should of course not be used
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index bb30c2b..5d19b393 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -48,14 +48,9 @@ struct bio {
 	struct block_device	*bi_bdev;
 	unsigned int		bi_flags;	/* status, command, etc */
 	int			bi_error;
-	unsigned long		bi_rw;		/* bottom bits rq_flags_bits
-						 * top bits priority
-						 */
-	/*
-	 * this will be a u8 in the next patches and bi_rw can be shrunk to
-	 * a u32. For compat in these transistional patches op is a int here.
-	 */
-	int			bi_op;		/* REQ_OP */
+	unsigned int		bi_rw;		/* rq_flag_bits */
+	unsigned short		bi_ioprio;
+	u8			bi_op;		/* REQ_OP */
 
 
 	struct bvec_iter	bi_iter;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bc024c7..83d6f033 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -96,7 +96,7 @@ struct request {
 	struct request_queue *q;
 	struct blk_mq_ctx *mq_ctx;
 
-	int op;
+	u8 op;
 	u64 cmd_flags;
 	unsigned cmd_type;
 	unsigned long atomic_flags;
-- 
1.8.3.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: mchristi at redhat.com <mchristi@redhat.com>
To: linux-f2fs-devel@lists.sourceforge.net,
	linux-ext4@vger.kernel.org, konrad.wilk@oracle.com,
	drbd-dev@lists.linbit.com, philipp.reisner@linbit.com,
	lars.ellenberg@linbit.com, linux-raid@vger.kernel.org,
	dm-devel@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-mtd@lists.infradead.org, target-devel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, osd-dev@open-osd.org,
	xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com
Cc: Mike Christie <mchristi@redhat.com>
Subject: [Ocfs2-devel] [PATCH 32/35] block: shrink bi_rw and bi_op
Date: Tue,  5 Jan 2016 14:53:35 -0600	[thread overview]
Message-ID: <1452027218-32303-33-git-send-email-mchristi@redhat.com> (raw)
In-Reply-To: <1452027218-32303-1-git-send-email-mchristi@redhat.com>

From: Mike Christie <mchristi@redhat.com>

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 <mchristi@redhat.com>
---
 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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_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(&sh->count);
 			if (sh != head_sh)
 				atomic_inc(&head_sh->count);
@@ -1102,8 +1102,9 @@ again:
 		if (!rdev && !rrdev) {
 			if (op_is_write(op))
 				set_bit(STRIPE_DEGRADED, &sh->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, &sh->dev[i].flags);
 			set_bit(STRIPE_HANDLE, &sh->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
-			       "submit_bio(rw=%d,0x%lx FLUSH, bdev=%p)\n",
+			       "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
 			       bio->bi_op, bio->bi_rw, bio->bi_bdev);
 		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 			if ((dev_state->state->print_mask &
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a96984f..b9c3799 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8061,7 +8061,7 @@ static void btrfs_end_dio_bio(struct bio *bio)
 
 	if (err)
 		btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
-			   "direct IO failed ino %llu rw %d,%lu sector %#Lx len %u err no %d",
+			   "direct IO failed ino %llu rw %d,0x%x sector %#Lx len %u err no %d",
 			   btrfs_ino(dip->inode), bio->bi_op, bio->bi_rw,
 			   (unsigned long long)bio->bi_iter.bi_sector,
 			   bio->bi_iter.bi_size, err);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 1e4b3b5..c91afc1 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -44,18 +44,9 @@
 #define BIO_MAX_SIZE		(BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
 #define BIO_MAX_SECTORS		(BIO_MAX_SIZE >> 9)
 
-/*
- * upper 16 bits of bi_rw define the io priority of this bio
- */
-#define BIO_PRIO_SHIFT	(8 * sizeof(unsigned long) - IOPRIO_BITS)
-#define bio_prio(bio)	((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio(bio)		(bio)->bi_ioprio
 #define bio_prio_valid(bio)	ioprio_valid(bio_prio(bio))
-
-#define bio_set_prio(bio, prio)		do {			\
-	WARN_ON(prio >= (1 << IOPRIO_BITS));			\
-	(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);		\
-	(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);	\
-} while (0)
+#define bio_set_prio(bio, prio)	((bio)->bi_ioprio = prio)
 
 /*
  * various member access, note that bio_data should of course not be used
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index bb30c2b..5d19b393 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -48,14 +48,9 @@ struct bio {
 	struct block_device	*bi_bdev;
 	unsigned int		bi_flags;	/* status, command, etc */
 	int			bi_error;
-	unsigned long		bi_rw;		/* bottom bits rq_flags_bits
-						 * top bits priority
-						 */
-	/*
-	 * this will be a u8 in the next patches and bi_rw can be shrunk to
-	 * a u32. For compat in these transistional patches op is a int here.
-	 */
-	int			bi_op;		/* REQ_OP */
+	unsigned int		bi_rw;		/* rq_flag_bits */
+	unsigned short		bi_ioprio;
+	u8			bi_op;		/* REQ_OP */
 
 
 	struct bvec_iter	bi_iter;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bc024c7..83d6f033 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -96,7 +96,7 @@ struct request {
 	struct request_queue *q;
 	struct blk_mq_ctx *mq_ctx;
 
-	int op;
+	u8 op;
 	u64 cmd_flags;
 	unsigned cmd_type;
 	unsigned long atomic_flags;
-- 
1.8.3.1

  parent reply	other threads:[~2016-01-05 20:53 UTC|newest]

Thread overview: 186+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 20:53 [PATCH 00/35 v2] separate operations from flags in the bio/request structs mchristi
2016-01-05 20:53 ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53 ` mchristi
2016-01-05 20:53 ` [PATCH 01/35] block/fs/drivers: remove rw argument from submit_bio mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-06 15:59   ` [dm-devel] " Bart Van Assche
2016-01-06 15:59     ` [Ocfs2-devel] " Bart Van Assche
2016-01-06 15:59     ` Bart Van Assche
2016-01-06 15:59     ` Bart Van Assche
2016-01-09 13:34   ` Christoph Hellwig
2016-01-09 13:34     ` [Ocfs2-devel] " Christoph Hellwig
2016-01-09 13:34     ` Christoph Hellwig
2016-01-10  0:43     ` Mike Christie
2016-01-10  0:43       ` [Ocfs2-devel] " Mike Christie
2016-01-10  0:43       ` Mike Christie
2016-01-05 20:53 ` [PATCH 02/35] block: add REQ_OP definitions and bi_op/op fields mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
     [not found]   ` <1452027218-32303-3-git-send-email-mchristi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-06 23:17     ` Martin K. Petersen
2016-01-06 23:17       ` [Ocfs2-devel] " Martin K. Petersen
2016-01-06 23:17       ` Martin K. Petersen
2016-01-06 23:17       ` Martin K. Petersen
2016-01-09 13:37   ` Christoph Hellwig
2016-01-09 13:37     ` [Ocfs2-devel] " Christoph Hellwig
2016-01-09 13:37     ` Christoph Hellwig
2016-01-10  0:56     ` [dm-devel] " Mike Christie
2016-01-10  0:56       ` [Ocfs2-devel] " Mike Christie
2016-01-10  0:56       ` Mike Christie
2016-01-10  1:21       ` Mike Christie
2016-01-10  1:21         ` [Ocfs2-devel] " Mike Christie
2016-01-10  1:21         ` Mike Christie
2016-01-10  7:15         ` Christoph Hellwig
2016-01-10  7:15           ` [Ocfs2-devel] " Christoph Hellwig
2016-01-10  7:15           ` Christoph Hellwig
2016-01-10  7:14       ` Christoph Hellwig
2016-01-10  7:14         ` [Ocfs2-devel] " Christoph Hellwig
2016-01-10  7:14         ` Christoph Hellwig
2016-01-05 20:53 ` [PATCH 03/35] block, fs, mm, drivers: set bi_op to REQ_OP mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 04/35] fs: have submit_bh users pass in op and flags separately mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 05/35] fs: have ll_rw_block " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 23:20   ` kbuild test robot
2016-01-05 23:20     ` [Ocfs2-devel] " kbuild test robot
2016-01-05 23:20     ` kbuild test robot
2016-01-05 23:20     ` kbuild test robot
2016-01-05 23:20     ` kbuild test robot
2016-01-05 20:53 ` [PATCH 06/35] direct-io: set bi_op to REQ_OP mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 07/35] btrfs: have submit_one_bio users setup bio bi_op mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 08/35] btrfs: set bi_op tp REQ_OP mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 09/35] btrfs: update __btrfs_map_block for bi_op transition mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 10/35] btrfs: don't pass rq_flag_bits if there is a bio mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 11/35] f2fs: set bi_op to REQ_OP mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 12/35] gfs2: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 13/35] xfs: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-07  3:11   ` Dave Chinner
2016-01-07  3:11     ` [Ocfs2-devel] " Dave Chinner
2016-01-07  3:11     ` Dave Chinner
2016-01-05 20:53 ` [PATCH 14/35] hfsplus: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 15/35] mpage: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 16/35] nilfs: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 17/35] ocfs2: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 18/35] pm: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 19/35] dm: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 20/35] dm: pass dm stats data dir instead of bi_rw mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 21/35] bcache: set bi_op to REQ_OP mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 22/35] drbd: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 23/35] md/raid: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 24/35] xen: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 25/35] target: " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-06 19:06   ` Nicholas A. Bellinger
2016-01-06 19:06     ` Nicholas A. Bellinger
2016-01-06 19:06     ` [Ocfs2-devel] " Nicholas A. Bellinger
2016-01-06 19:06     ` Nicholas A. Bellinger
2016-01-05 20:53 ` [PATCH 26/35] block: set op " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-09 13:39   ` Christoph Hellwig
2016-01-09 13:39     ` [Ocfs2-devel] " Christoph Hellwig
2016-01-09 13:39     ` Christoph Hellwig
2016-01-05 20:53 ` [PATCH 27/35] drivers: set request " mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 28/35] blktrace: get op from req->op/bio->bi_op mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 29/35] ide cd: do not set REQ_WRITE on requests mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 30/35] block, fs, drivers: do not test bi_rw for REQ_OPs mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 31/35] block, fs: remove old REQ definitions mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` mchristi [this message]
2016-01-05 20:53   ` [Ocfs2-devel] [PATCH 32/35] block: shrink bi_rw and bi_op mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 33/35] block, drivers: add REQ_OP_FLUSH operation mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 20:53 ` [PATCH 34/35] block: add QUEUE_FLAGs for flush and fua mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 23:46   ` kbuild test robot
2016-01-05 23:46     ` [Ocfs2-devel] " kbuild test robot
2016-01-05 23:46     ` kbuild test robot
2016-01-05 23:46     ` kbuild test robot
2016-01-05 23:46     ` kbuild test robot
     [not found]   ` <1452027218-32303-35-git-send-email-mchristi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-09  8:04     ` Christoph Hellwig
2016-01-09  8:04       ` [Ocfs2-devel] " Christoph Hellwig
2016-01-09  8:04       ` Christoph Hellwig
2016-01-09  8:04       ` Christoph Hellwig
2016-01-05 20:53 ` [PATCH 35/35] block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH mchristi
2016-01-05 20:53   ` [Ocfs2-devel] " mchristi at redhat.com
2016-01-05 20:53   ` mchristi
2016-01-05 23:53   ` kbuild test robot
2016-01-05 23:53     ` [Ocfs2-devel] " kbuild test robot
2016-01-05 23:53     ` kbuild test robot
2016-01-05 23:53     ` kbuild test robot
2016-01-05 23:53     ` kbuild test robot
     [not found] ` <1452027218-32303-1-git-send-email-mchristi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-07  1:40   ` [PATCH 00/35 v2] separate operations from flags in the bio/request structs Martin K. Petersen
2016-01-07  1:40     ` [Ocfs2-devel] " Martin K. Petersen
2016-01-07  1:40     ` Martin K. Petersen
2016-01-07  1:40     ` Martin K. Petersen
2016-01-07  3:13     ` Dave Chinner
2016-01-07  3:13       ` [Ocfs2-devel] " Dave Chinner
2016-01-07  3:13       ` Dave Chinner
2016-01-08 13:32 ` Christoph Hellwig
2016-01-08 13:32   ` [Ocfs2-devel] " Christoph Hellwig
2016-01-08 13:32   ` Christoph Hellwig
2016-01-08 20:50   ` Mike Christie
2016-01-08 20:50     ` [Ocfs2-devel] " Mike Christie
2016-01-08 20:50     ` Mike Christie
2016-01-08 23:07     ` Mike Snitzer
2016-01-08 23:07       ` [Ocfs2-devel] " Mike Snitzer
2016-01-08 23:07       ` Mike Snitzer
2016-01-11 20:20 [PATCH 00/35 v3] eparate " mchristi
2016-01-11 20:21 ` [PATCH 32/35] block: shrink bi_rw and bi_op mchristi
2016-01-11 20:21   ` mchristi
2016-02-24 19:47 [PATCH 00/35 v4] separate operations from flags in the bio/request structs mchristi
2016-02-24 19:48 ` [PATCH 32/35] block: shrink bi_rw and bi_op mchristi
2016-02-24 19:48   ` mchristi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452027218-32303-33-git-send-email-mchristi@redhat.com \
    --to=mchristi@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=konrad.wilk@oracle.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=osd-dev@open-osd.org \
    --cc=philipp.reisner@linbit.com \
    --cc=target-devel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.