diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2019-10-04 16:17:37 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2019-11-05 20:35:42 +0100 |
commit | 6ca43ed8376a51afec790dd484a51804ade4352a (patch) | |
tree | 24740639a9d64462e0ab8ec29e6ed73231e818ab /drivers/md/dm-clone-metadata.h | |
parent | dm writecache: handle REQ_FUA (diff) | |
download | linux-6ca43ed8376a51afec790dd484a51804ade4352a.tar.xz linux-6ca43ed8376a51afec790dd484a51804ade4352a.zip |
dm clone: replace spin_lock_irqsave with spin_lock_irq
If we are in a place where it is known that interrupts are enabled,
functions spin_lock_irq/spin_unlock_irq should be used instead of
spin_lock_irqsave/spin_unlock_irqrestore.
spin_lock_irq and spin_unlock_irq are faster because they don't need to
push and pop the flags register.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-clone-metadata.h')
-rw-r--r-- | drivers/md/dm-clone-metadata.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-clone-metadata.h b/drivers/md/dm-clone-metadata.h index 434bff08508b..3fe50a781c11 100644 --- a/drivers/md/dm-clone-metadata.h +++ b/drivers/md/dm-clone-metadata.h @@ -44,7 +44,9 @@ int dm_clone_set_region_hydrated(struct dm_clone_metadata *cmd, unsigned long re * @start: Starting region number * @nr_regions: Number of regions in the range * - * This function doesn't block, so it's safe to call it from interrupt context. + * This function doesn't block, but since it uses spin_lock_irq()/spin_unlock_irq() + * it's NOT safe to call it from any context where interrupts are disabled, e.g., + * from interrupt context. */ int dm_clone_cond_set_range(struct dm_clone_metadata *cmd, unsigned long start, unsigned long nr_regions); |