Subject: RFC: VOP_BMAP() change proposal
To: None <tech-kern@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 12/30/2005 03:22:34
--ReaqsoxgOBHFXBhH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear folks,

VOP_BMAP is currently defined as:
     int
     VOP_BMAP(struct vnode *vp, daddr_t bn, struct vnode **vpp,
              daddr_t *bnp, int *runp);

My problem with this is that it doesn't signal whether its a _read_ or a 
_write_ request. Some filingsystems with a preference for shuffling blocks 
like UDF and also LFS might want to rewrite blocks on a different place 
than it reads them from. So when f.e. genfs() calls BMAP on an extent it 
gets both a wrong mapping but most of all a wrong _runlength_. A fragmented 
file that is written out in a sequential part is thus splitted up in 
seperate sectors just because it was fragmented on the disc... :-S this 
logic is baffling me.

A simple solution would be to pass a flag to the BMAP indicating reading or 
writing so filingsystems that want to distinguish between the two can do 
so.

Thoughs?
Reinoud


--ReaqsoxgOBHFXBhH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQ7SZ3IKcNwBDyKpoAQJFDAgAxRzKhatt0oZqv8LNDR7MXw7wNxCRYuN5
twHMqF1WsSaFH0Yd6Ni8wZE22xLDMgHozG5oIMTxhIJ+6a2QL2ZsyvEWCdZM8mwn
cQSZhRJj/1mPZHnozO7sj8/vW87SMzcontflJWw+/+9QtE64KATcxOEZddwi9sl/
Ntdw/FDKTBcGK0XmAqRfzjd2USMXkY43ztvmACjcnOeRR5xl0KYv/1HJMPHz7hRT
EC6H5SQ5QjOiaqwNWii7ROhXzcynN2QurGX9pQGWs1n7miMOADucREj6wAzOP3oK
lLB34BaYwL1dzOwV/v4XjX/yvHgschvOM+WmlS3Wk+UcQXk3PODLbg==
=wJJs
-----END PGP SIGNATURE-----

--ReaqsoxgOBHFXBhH--