Commit 8532e343 authored by NeilBrown's avatar NeilBrown

md/bitmap: remove rcu annotation from pointer arithmetic.

Evaluating  "&mddev->disks" is simple pointer arithmetic, so
it does not need 'rcu' annotations - no dereferencing is happening.

Also enhance the comment to explain that 'rdev' in that case
is not actually a pointer to an rdev.
Reported-by: default avatarPatrick Marlier <patrick.marlier@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent a8115776
...@@ -177,11 +177,16 @@ static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mdde ...@@ -177,11 +177,16 @@ static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mdde
* nr_pending is 0 and In_sync is clear, the entries we return will * nr_pending is 0 and In_sync is clear, the entries we return will
* still be in the same position on the list when we re-enter * still be in the same position on the list when we re-enter
* list_for_each_entry_continue_rcu. * list_for_each_entry_continue_rcu.
*
* Note that if entered with 'rdev == NULL' to start at the
* beginning, we temporarily assign 'rdev' to an address which
* isn't really an rdev, but which can be used by
* list_for_each_entry_continue_rcu() to find the first entry.
*/ */
rcu_read_lock(); rcu_read_lock();
if (rdev == NULL) if (rdev == NULL)
/* start at the beginning */ /* start at the beginning */
rdev = list_entry_rcu(&mddev->disks, struct md_rdev, same_set); rdev = list_entry(&mddev->disks, struct md_rdev, same_set);
else { else {
/* release the previous rdev and start from there. */ /* release the previous rdev and start from there. */
rdev_dec_pending(rdev, mddev); rdev_dec_pending(rdev, mddev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment