diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2022-06-08 18:27:54 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-08-03 01:14:40 +0200 |
commit | eac58d08d4937d2eab8f71c663d98d0759845bde (patch) | |
tree | be424e94edc28059f85fb1cb4bf28f321fcc7d76 /drivers/md/md.h | |
parent | md/raid5-cache: Annotate pslot with __rcu notation (diff) | |
download | linux-eac58d08d4937d2eab8f71c663d98d0759845bde.tar.xz linux-eac58d08d4937d2eab8f71c663d98d0759845bde.zip |
md: Use enum for overloaded magic numbers used by mddev->curr_resync
Comments in the code document special values used for
mddev->curr_resync. Make this clearer by using an enum to label these
values.
The only functional change is a couple places use the wrong comparison
operator that implied 3 is another special value. They are all
fixed to imply that 3 or greater is an active resync.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index b4f84b27bdef..551c0a349cb5 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -288,6 +288,21 @@ struct serial_info { sector_t _subtree_last; /* highest sector in subtree of rb node */ }; +/* + * mddev->curr_resync stores the current sector of the resync but + * also has some overloaded values. + */ +enum { + /* No resync in progress */ + MD_RESYNC_NONE = 0, + /* Yielded to allow another conflicting resync to commence */ + MD_RESYNC_YIELDED = 1, + /* Delayed to check that there is no conflict with another sync */ + MD_RESYNC_DELAYED = 2, + /* Any value greater than or equal to this is in an active resync */ + MD_RESYNC_ACTIVE = 3, +}; + struct mddev { void *private; struct md_personality *pers; |