diff options
author | ken <ken@FreeBSD.org> | 2013-08-15 22:52:39 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 2013-08-15 22:52:39 +0000 |
commit | 5591de079d3f2d8a4854b384d52322fc01bf57ea (patch) | |
tree | 3aad15663c99de3361bd1808e8449ee767a03647 /sys/geom/geom_dev.c | |
parent | bdb743702fb53c60e30455a13dfd78783868ac2c (diff) | |
download | FreeBSD-src-5591de079d3f2d8a4854b384d52322fc01bf57ea.zip FreeBSD-src-5591de079d3f2d8a4854b384d52322fc01bf57ea.tar.gz |
Change the way that unmapped I/O capability is advertised.
The previous method was to set the D_UNMAPPED_IO flag in the cdevsw
for the driver. The problem with this is that in many cases (e.g.
sa(4)) there may be some instances of the driver that can handle
unmapped I/O and some that can't. The isp(4) driver can handle
unmapped I/O, but the esp(4) driver currently cannot. The cdevsw
is shared among all driver instances.
So instead of setting a flag on the cdevsw, set a flag on the cdev.
This allows drivers to indicate support for unmapped I/O on a
per-instance basis.
sys/conf.h: Remove the D_UNMAPPED_IO cdevsw flag and replace it
with an SI_UNMAPPED cdev flag.
kern_physio.c: Look at the cdev SI_UNMAPPED flag to determine
whether or not a particular driver can handle
unmapped I/O.
geom_dev.c: Set the SI_UNMAPPED flag for all GEOM cdevs.
Since GEOM will create a temporary mapping when
needed, setting SI_UNMAPPED unconditionally will
work.
Remove the D_UNMAPPED_IO flag.
nvme_ns.c: Set the SI_UNMAPPED flag on cdevs created here
if NVME_UNMAPPED_BIO_SUPPORT is enabled.
vfs_aio.c: In aio_qphysio(), check the SI_UNMAPPED flag on a
cdev instead of the D_UNMAPPED_IO flag on the cdevsw.
sys/param.h: Bump __FreeBSD_version to 1000045 for the switch from
setting the D_UNMAPPED_IO flag in the cdevsw to setting
SI_UNMAPPED in the cdev.
Reviewed by: kib, jimharris
MFC after: 1 week
Sponsored by: Spectra Logic
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index f8b2680..17f24f8 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -79,7 +79,7 @@ static struct cdevsw g_dev_cdevsw = { .d_ioctl = g_dev_ioctl, .d_strategy = g_dev_strategy, .d_name = "g_dev", - .d_flags = D_DISK | D_TRACKCLOSE | D_UNMAPPED_IO, + .d_flags = D_DISK | D_TRACKCLOSE, }; static g_taste_t g_dev_taste; @@ -237,6 +237,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) g_free(sc); return (NULL); } + dev->si_flags |= SI_UNMAPPED; sc->sc_dev = dev; /* Search for device alias name and create it if found. */ @@ -251,6 +252,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) freeenv(val); make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &adev, dev, "%s", buf); + adev->si_flags |= SI_UNMAPPED; break; } } |