Subject: Re: VOP_BMAP question
To: None <tech-kern@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 12/23/2003 09:55:37
--MGYHOYXEY6WxJCY8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 19, 2003 at 10:13:22PM +0100, Juergen Hannken-Illjes wrote:
> How does VOP_BMAP() handle fragments?
>=20
> Given a file with holes obtained from ftruncate(), what does VOP_BMAP()
> return in its argument "bnp" if it finds a fragment?
>=20
> Is it the block number of the fragment or will it return (daddr_t)-1?
>=20
> Is it always ok to write a full block to "bnp"?

I think you've been bitten by an ffs ambiguity (since only ffs has=20
"fragments").

What ffs calls a fragment in its documentation (the 1k in an 8k/1k file=20
system) is what the kernel internally calls a block. Since VOP_BMAP()=20
deals with kernel things, a "fragment" is a block, so there is no problem.

Take care,

Bill

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

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

iD8DBQE/6IGZWz+3JHUci9cRAsWuAJ98whBRKlmSY7O87NvUhIrbwjgZXQCfZLZM
jhWNmsYuZEx75cTZDz30H7c=
=Fbc3
-----END PGP SIGNATURE-----

--MGYHOYXEY6WxJCY8--