Skip to content

Commit 49a43da

Browse files
author
Al Viro
committed
bdev: move ->bd_ro_warned to ->__bd_flags
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ac2b6f9 commit 49a43da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

block/blk-core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,11 @@ static inline void bio_check_ro(struct bio *bio)
514514
if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
515515
return;
516516

517-
if (bio->bi_bdev->bd_ro_warned)
517+
if (bdev_test_flag(bio->bi_bdev, BD_RO_WARNED))
518518
return;
519519

520-
bio->bi_bdev->bd_ro_warned = true;
520+
bdev_set_flag(bio->bi_bdev, BD_RO_WARNED);
521+
521522
/*
522523
* Use ioctl to set underlying disk of raid/dm to read-only
523524
* will trigger this.

include/linux/blk_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct block_device {
5050
#define BD_READ_ONLY (1u<<8) // read-only policy
5151
#define BD_WRITE_HOLDER (1u<<9)
5252
#define BD_HAS_SUBMIT_BIO (1u<<10)
53+
#define BD_RO_WARNED (1u<<11)
5354
dev_t bd_dev;
5455
struct inode *bd_inode; /* will die */
5556

@@ -69,7 +70,6 @@ struct block_device {
6970
#ifdef CONFIG_FAIL_MAKE_REQUEST
7071
bool bd_make_it_fail;
7172
#endif
72-
bool bd_ro_warned;
7373
int bd_writers;
7474
/*
7575
* keep this out-of-line as it's both big and not needed in the fast

0 commit comments

Comments
 (0)