Subject: mp->mnt_vnodelist change
To: None <tech-kern@NetBSD.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 10/18/2006 20:34:46
Dear folks,

in the proces of developing a writable UDF file system, i came on an oddity 
thats biting the current UDF implementation quite badly: when issueing a 
vflush() on the mountpoint just prior to umounting i get the inactive nodes 
in the *reverse* oder they are used/introduced.

The file system then gets VOP_RECLAIM() calls and thus wants to write out 
the `dirty' nodes that have been accessed or modified to disc. If those 
nodes were ordered on disc with disc addresses a0 < a1 < a2 < a3 they get 
written back in the order a3, a2, a1, a0.

Normal discs dont mind that but media like CD/DVD *hate* that and due to 
their nature, writing with decending adresses takes around 10 times as much 
time as writing ascending adresses if not more. In fact the current 
implementation is faster in synchronious mount rather than asynchronious 
mount for that reason.

My proposed solution is to replace the LIST used for mp->mnt_vnodelist to a 
TAILQ so that new nodes can be added at the tail and vnodes can be read 
from the head so the order isn't reversed by default.

The order of the vnodes of a simple `chown -R reinoud /mnt/UDF' or a copy 
to the disc will thus result in a reverse order vnode callback.

Any objections / other solutions ?

With regards,
Reinoud