diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-09 08:40:28 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-12 10:29:36 -0600 |
commit | 50b4aecfbbb09869db967e4a26212a47e10c0088 (patch) | |
tree | 11348e1e5960f45f23b5c4eaa9d687a1e0de3b6b /drivers | |
parent | b75f4aed88febe903bd40a6128b74edd2388417e (diff) | |
download | lwn-50b4aecfbbb09869db967e4a26212a47e10c0088.tar.gz lwn-50b4aecfbbb09869db967e4a26212a47e10c0088.zip |
block: remove GENHD_FL_UP
Just check inode_unhashed on the whole device bdev inode instead,
and provide a helper to check for that information.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210809064028.1198327-9-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md.h | 4 | ||||
-rw-r--r-- | drivers/nvme/host/core.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 832547cf038f..4c96c36bd01a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -764,9 +764,7 @@ struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev); static inline bool is_mddev_broken(struct md_rdev *rdev, const char *md_type) { - int flags = rdev->bdev->bd_disk->flags; - - if (!(flags & GENHD_FL_UP)) { + if (!disk_live(rdev->bdev->bd_disk)) { if (!test_and_set_bit(MD_BROKEN, &rdev->mddev->flags)) pr_warn("md: %s: %s array has a missing/failed member\n", mdname(rdev->mddev), md_type); diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index dbe7144f0026..1478d825011d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1822,7 +1822,7 @@ static void nvme_update_disk_info(struct gendisk *disk, static inline bool nvme_first_scan(struct gendisk *disk) { /* nvme_alloc_ns() scans the disk prior to adding it */ - return !(disk->flags & GENHD_FL_UP); + return !disk_live(disk); } static void nvme_set_chunk_sectors(struct nvme_ns *ns, struct nvme_id_ns *id) |