tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bmap/strategy for vnd backing file



On Tue, Sep 18, 2018 at 03:36:50PM +0000, Emmanuel Dreyfus wrote:
> Hello
> 
> The code in sys/dev/vnd.c is abls to handle I/O either using
> bmap/strategy, or using read/write. The later is more efficient,

that's clearly not true. There have been a thread on this topic recently.
Or maybe you mean "the former" ?

> the later is supported on any filesystem.
> 
> There are a few tests to decide which method to use, but in 
> the case where the backing store is a plain file on a filesystem,
> we have a test for bmap/strategy that always fail: the
> call to getdisksize() produces an ioctl DIOCGPARTINFO  which is
> unsupported on regular files.
> 
> We use getdisksize() to read block size. I added an alternative 
> using mount->mnt_dev_bshift when the backing store is of type VREG.
> Anyone sees a reason to not commit that?

I guess it won't hurt but I still think it won't cover all cases
(see the recent thread in tech-kern). I have in mind something where we
could first try with bmap/strategy and if that fail, retry with read/write,
at run time. The cost of a bmap/strategy failure would be low as there
would be no I/O involved.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index