/*
- * cloned bio must not modify vec list
+ * submitted bio must not modify vec list
*/
- if (unlikely(bio_flagged(bio, BIO_CLONED)))
+ if (unlikely(bio_flagged(bio, BIO_SUBMITTED)))
return 0;
if (((bio->bi_size + len) >> 9) > max_sectors)
@@ -844,6 +844,8 @@ int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask)
int i;
struct bio_vec *bv;
+ BUG_ON(bio_flagged(bio, BIO_SUBMITTED));
+
bio_for_each_segment_all(bv, bio, i) {
bv->bv_page = alloc_page(gfp_mask);
if (!bv->bv_page) {
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index e9375cf..fb49107 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -103,7 +103,7 @@ struct bio {
#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
#define BIO_EOF 2 /* out-out-bounds error */
#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
-#define BIO_CLONED 4 /* doesn't own data */
+#define BIO_SUBMITTED 4 /* bio has been submitted */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
#define BIO_USER_MAPPED 6 /* contains user pages */
#define BIO_EOPNOTSUPP 7 /* not supported */
--
1.7.12
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
09-24-2012, 10:35 PM
Kent Overstreet
block: Add BIO_SUBMITTED flag, kill BIO_CLONED
BIO_CLONED wasn't very useful, and didn't have very clear semantics, so
kill it.
Replace it with a more useful flag - BIO_SUBMITTED means the bio has
been passed to generic_make_request() and the bvec can no longer be
modified.
Roll both changes into the same patch so we can steal the old bit for
the new flag.
/*
- * cloned bio must not modify vec list
+ * submitted bio must not modify vec list
*/
- if (unlikely(bio_flagged(bio, BIO_CLONED)))
+ if (unlikely(bio_flagged(bio, BIO_SUBMITTED)))
return 0;
if (((bio->bi_size + len) >> 9) > max_sectors)
@@ -844,6 +844,8 @@ int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask)
int i;
struct bio_vec *bv;
+ BUG_ON(bio_flagged(bio, BIO_SUBMITTED));
+
bio_for_each_segment_all(bv, bio, i) {
bv->bv_page = alloc_page(gfp_mask);
if (!bv->bv_page) {
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6547103..3958888 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -103,7 +103,7 @@ struct bio {
#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
#define BIO_EOF 2 /* out-out-bounds error */
#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
-#define BIO_CLONED 4 /* doesn't own data */
+#define BIO_SUBMITTED 4 /* bio has been submitted */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
#define BIO_USER_MAPPED 6 /* contains user pages */
#define BIO_EOPNOTSUPP 7 /* not supported */
--
1.7.12
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
10-15-2012, 08:08 PM
Kent Overstreet
block: Add BIO_SUBMITTED flag, kill BIO_CLONED
BIO_CLONED wasn't very useful, and didn't have very clear semantics, so
kill it.
Replace it with a more useful flag - BIO_SUBMITTED means the bio has
been passed to generic_make_request() and the bvec can no longer be
modified.
Roll both changes into the same patch so we can steal the old bit for
the new flag.
/*
- * cloned bio must not modify vec list
+ * submitted bio must not modify vec list
*/
- if (unlikely(bio_flagged(bio, BIO_CLONED)))
+ if (unlikely(bio_flagged(bio, BIO_SUBMITTED)))
return 0;
if (((bio->bi_size + len) >> 9) > max_sectors)
@@ -844,6 +844,8 @@ int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask)
int i;
struct bio_vec *bv;
+ BUG_ON(bio_flagged(bio, BIO_SUBMITTED));
+
bio_for_each_segment_all(bv, bio, i) {
bv->bv_page = alloc_page(gfp_mask);
if (!bv->bv_page) {
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 538289f..edc5cb9 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -103,7 +103,7 @@ struct bio {
#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
#define BIO_EOF 2 /* out-out-bounds error */
#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
-#define BIO_CLONED 4 /* doesn't own data */
+#define BIO_SUBMITTED 4 /* bio has been submitted */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
#define BIO_USER_MAPPED 6 /* contains user pages */
#define BIO_EOPNOTSUPP 7 /* not supported */
--
1.7.12
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
10-15-2012, 08:09 PM
Kent Overstreet
block: Add BIO_SUBMITTED flag, kill BIO_CLONED
BIO_CLONED wasn't very useful, and didn't have very clear semantics, so
kill it.
Replace it with a more useful flag - BIO_SUBMITTED means the bio has
been passed to generic_make_request() and the bvec can no longer be
modified.
Roll both changes into the same patch so we can steal the old bit for
the new flag.
/*
- * cloned bio must not modify vec list
+ * submitted bio must not modify vec list
*/
- if (unlikely(bio_flagged(bio, BIO_CLONED)))
+ if (unlikely(bio_flagged(bio, BIO_SUBMITTED)))
return 0;
if (((bio->bi_size + len) >> 9) > max_sectors)
@@ -844,6 +844,8 @@ int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask)
int i;
struct bio_vec *bv;
+ BUG_ON(bio_flagged(bio, BIO_SUBMITTED));
+
bio_for_each_segment_all(bv, bio, i) {
bv->bv_page = alloc_page(gfp_mask);
if (!bv->bv_page) {
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index e9375cf..fb49107 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -103,7 +103,7 @@ struct bio {
#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
#define BIO_EOF 2 /* out-out-bounds error */
#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
-#define BIO_CLONED 4 /* doesn't own data */
+#define BIO_SUBMITTED 4 /* bio has been submitted */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
#define BIO_USER_MAPPED 6 /* contains user pages */
#define BIO_EOPNOTSUPP 7 /* not supported */
--
1.7.12
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel