Date: Mon, 19 May 2008 09:32:35 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Scott Long <scottl@samsco.org> Cc: Jeremy Chadwick <koitsu@freebsd.org>, Zoran Kolic <zkolic@sbb.co.yu>, freebsd-stable@freebsd.org, Andriy Gapon <avg@icyb.net.ua>, Stefan Lambrev <stefan.lambrev@moneybookers.com> Subject: Re: udf Message-ID: <200805191632.m4JGWZix002576@apollo.backplane.com> References: <1210965790.00070991.1210954202@10.7.7.3> <1210965791.00070995.1210954203@10.7.7.3> <1210965792.00070997.1210954803@10.7.7.3> <1210969383.00071003.1210956601@10.7.7.3> <48318B97.5090200@icyb.net.ua> <48318CE7.10507@samsco.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:> BTW, Remko has kindly notified me that Reinoud Zandijk has completed his :> long work on UDF write support in NetBSD. I think that porting his work :> is our best chance to get write support in FreeBSD too. :> : :I think you'll find that implementing VOPs and filling in UDF data :structures will be easy, while interacting with the VM will be many :orders of magnitude harder. Still it should be a fun challenge for :someone to do. : :Scott One avenue that can be persued would be to finish the UIO_NOCOPY support in the vm/vnode_pager.c. You have UIO_NOCOPY support for the putpages code but not the getpages code. If that were done the VFS can simply use VMIO-backed buffer cache buffers (they have to be VMIO-backed for UIO_NOCOPY to work properly)... and not have to deal with getpages or putpages at all. The vnode pager would convert them to a UIO_NOCOPY VOP_READ or VOP_WRITE as appropriate. The entire VM coding burden winds up being in the kernel proper and not in the VFS at all. IMHO implementing per-VFS getpages/putpages is an exercise in frustration, to be avoided at all costs. Plus once you have a generic getpages/putpages layer in vm/vnode_pager.c the VFS code no longer has to mess with VM pages anywhere and winds up being far more portable. I did the necessary work in DragonFly in order to avoid having to mess with VM pages in HAMMER. Primary work: * It is a good idea to require that all vnode-based buffer cache buffers be B_VMIO backed (aka have a VM object). It ensures a clean interface and avoids confusion, and also cleans up numerous special cases that are simply not needed in this day and age. * Add support for UIO_NOCOPY in generic getpages. Get rid of all the special cases for small-block filesystems in getpages. Make it completely generic and simply issue the UIO_NOCOPY VOP_READ/VOP_WRITE. * Make minor adjustments to existing VFSs (but nothing prevents them from still rolling their own getpages/putpages so no major changes are needed). And then enjoy the greatly simplified VFS interactions that result. I would also recommend removing the VOP_BMAP() from the generic getpages/putpages code and simply letting the VFS's VOP_READ/VOP_WRITE deal with it. The BMAP calls were being made from getpages/putpages to check for discontiguous blocks, to avoid unnecessary disk seeks. Those checks are virtually worthless on today's modern hardware particularly since filesystems already localize most data accesses. In other words, if your filesystem is fragmented you are going to be doing the seeks anyway, probably. -Matt Matthew Dillon <dillon@backplane.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805191632.m4JGWZix002576>