mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
raid5-cache: hold spinlock instead of mutex in r5c_journal_mode_show
Replace mddev_lock with spin_lock to align with other show methods in raid5_attrs. Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
This commit is contained in:
parent
b3db8a2163
commit
01b5d32a57
1 changed files with 3 additions and 6 deletions
|
@ -2537,13 +2537,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
|
|||
struct r5conf *conf;
|
||||
int ret;
|
||||
|
||||
ret = mddev_lock(mddev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
spin_lock(&mddev->lock);
|
||||
conf = mddev->private;
|
||||
if (!conf || !conf->log) {
|
||||
mddev_unlock(mddev);
|
||||
spin_unlock(&mddev->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2563,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
|
|||
default:
|
||||
ret = 0;
|
||||
}
|
||||
mddev_unlock(mddev);
|
||||
spin_unlock(&mddev->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue