Date: Mon, 16 Oct 2017 10:17:34 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: "Owens, Keith" <Keith.Owens2@dell.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: How to map a single unmapped BIO? Message-ID: <20171016071734.GF2473@kib.kiev.ua> In-Reply-To: <0A22297308D147479E18AA1807A03807017F2378@MX202CL01.corp.emc.com> References: <0A22297308D147479E18AA1807A03807017F2378@MX202CL01.corp.emc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 16, 2017 at 06:24:19AM +0000, Owens, Keith wrote: > I have a geom that sometimes (very rarely) needs to modify the data in an unmapped BIO. Completely removing unmapped support from the entire geom is overkill. What is the best way of converting a single unmapped BIO to a mapped address so I can access the data? > > Basically I want g_io_transient_map_bio(), but that function is static. Duplicating that code in my geom is not elegant. Making g_io_transient_map_bio() non-static and allowing arbitrary geom to use it would probably cause troubles, because the mapping is automatically destroyed by biodone(). It is either too late if yor only need the mapping now, or too early in other situations. Consider using the sf bufs, which were designed specifically to allow kernel consumers to create temporary mappings. There is even a man page sf_buf(4), which is mostly up to date.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171016071734.GF2473>