[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: How to map a single unmapped BIO?
From:       Konstantin Belousov <kostikbel () gmail ! com>
Date:       2017-10-16 7:17:34
Message-ID: 20171016071734.GF2473 () kib ! kiev ! ua
[Download RAW message or body]

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.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic