Skip to content

Commit e829e2f

Browse files
ihorobehlendorf
authored andcommitted
spa_config: Rename spa_config_enter_mmp() to spa_config_enter_priority()
Originally this was created for MMP, but now new cases are emerging where the same mechanism is required. Hence the name's generalization. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Igor Ostapenko <[email protected]> Closes #17793
1 parent 8869caa commit e829e2f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/sys/spa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ extern void spa_import_progress_set_notes_nolog(spa_t *spa,
10301030
extern int spa_config_tryenter(spa_t *spa, int locks, const void *tag,
10311031
krw_t rw);
10321032
extern void spa_config_enter(spa_t *spa, int locks, const void *tag, krw_t rw);
1033-
extern void spa_config_enter_mmp(spa_t *spa, int locks, const void *tag,
1033+
extern void spa_config_enter_priority(spa_t *spa, int locks, const void *tag,
10341034
krw_t rw);
10351035
extern void spa_config_exit(spa_t *spa, int locks, const void *tag);
10361036
extern int spa_config_held(spa_t *spa, int locks, krw_t rw);

module/zfs/mmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ mmp_write_uberblock(spa_t *spa)
446446
uint64_t offset;
447447

448448
hrtime_t lock_acquire_time = gethrtime();
449-
spa_config_enter_mmp(spa, SCL_STATE, mmp_tag, RW_READER);
449+
spa_config_enter_priority(spa, SCL_STATE, mmp_tag, RW_READER);
450450
lock_acquire_time = gethrtime() - lock_acquire_time;
451451
if (lock_acquire_time > (MSEC2NSEC(MMP_MIN_INTERVAL) / 10))
452452
zfs_dbgmsg("MMP SCL_STATE acquisition pool '%s' took %llu ns "

module/zfs/spa_misc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ spa_config_tryenter(spa_t *spa, int locks, const void *tag, krw_t rw)
510510

511511
static void
512512
spa_config_enter_impl(spa_t *spa, int locks, const void *tag, krw_t rw,
513-
int mmp_flag)
513+
int priority_flag)
514514
{
515515
(void) tag;
516516
int wlocks_held = 0;
@@ -526,7 +526,7 @@ spa_config_enter_impl(spa_t *spa, int locks, const void *tag, krw_t rw,
526526
mutex_enter(&scl->scl_lock);
527527
if (rw == RW_READER) {
528528
while (scl->scl_writer ||
529-
(!mmp_flag && scl->scl_write_wanted)) {
529+
(!priority_flag && scl->scl_write_wanted)) {
530530
cv_wait(&scl->scl_cv, &scl->scl_lock);
531531
}
532532
} else {
@@ -551,7 +551,7 @@ spa_config_enter(spa_t *spa, int locks, const void *tag, krw_t rw)
551551
}
552552

553553
/*
554-
* The spa_config_enter_mmp() allows the mmp thread to cut in front of
554+
* The spa_config_enter_priority() allows the mmp thread to cut in front of
555555
* outstanding write lock requests. This is needed since the mmp updates are
556556
* time sensitive and failure to service them promptly will result in a
557557
* suspended pool. This pool suspension has been seen in practice when there is
@@ -560,7 +560,7 @@ spa_config_enter(spa_t *spa, int locks, const void *tag, krw_t rw)
560560
*/
561561

562562
void
563-
spa_config_enter_mmp(spa_t *spa, int locks, const void *tag, krw_t rw)
563+
spa_config_enter_priority(spa_t *spa, int locks, const void *tag, krw_t rw)
564564
{
565565
spa_config_enter_impl(spa, locks, tag, rw, 1);
566566
}

0 commit comments

Comments
 (0)