]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
md: factor out set_in_sync()
authorNeilBrown <neilb@suse.com>
Wed, 15 Mar 2017 03:05:14 +0000 (14:05 +1100)
committerShaohua Li <shli@fb.com>
Thu, 23 Mar 2017 02:18:18 +0000 (19:18 -0700)
commit6497709b5d1bccce7de1df678d5f147d614551d1
treefd6e21252c7bed7702f560cc1419b37d8bf5c0fd
parent84dd97a69092cef858483b775f1900d743d796a4
md: factor out set_in_sync()

Three separate places in md.c check if the number of active
writes is zero and, if so, sets mddev->in_sync.

There are a few differences, but there shouldn't be:
- it is always appropriate to notify the change in
  sysfs_state, and there is no need to do this outside a
  spin-locked region.
- we never need to check ->recovery_cp.  The state of resync
  is not relevant for whether there are any pending writes
  or not (which is what ->in_sync reports).

So create set_in_sync() which does the correct tests and
makes the correct changes, and call this in all three
places.

Any behaviour changes here a minor and cosmetic.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c