]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Switch geom_disk over to using a pool mutex.
authorken <ken@FreeBSD.org>
Thu, 23 Jun 2016 20:05:59 +0000 (20:05 +0000)
committerken <ken@FreeBSD.org>
Thu, 23 Jun 2016 20:05:59 +0000 (20:05 +0000)
commitab14b434c175ecf71563899622d311668779e65c
treec8a67bdfd1fc008fbf7a9c2968dbbb725cdaa61e
parent5d697e7c812c904333f7baac06c0cddd0ad1263b
Switch geom_disk over to using a pool mutex.

The GEOM disk d_mtx is only acquired on disk creation and destruction.
It is a good candidate for replacement with a pool mutex.  This eliminates
the mutex initialization and teardown and the mutex and name variables
themselves from struct disk.

sys/geom/geom_disk.h:
Take d_mtx and d_mtx_name out of struct disk.

sys/geom/geom_disk.c:
Use mtx_pool_lock() and mtx_pool_unlock() to guard the disk
initialization state instead of a dedicated mutex.

This allows removing the initialization and destruction of
d_mtx.

sys/sys/param.h:
Bump __FreeBSD_version to 1100119 for the change to struct disk.

Suggested by: jhb
Sponsored by: Spectra Logic
Approved by: re (gjb)
sys/geom/geom_disk.c
sys/geom/geom_disk.h
sys/sys/param.h