From: Nir Tzachar Subject: Re: get_blocks_t semantics Date: Thu, 21 Jul 2005 09:46:37 +0300 Message-ID: <1121928397.31997.6.camel@nexus.cs.bgu.ac.il> References: <1121868182.18164.9.camel@nexus.cs.bgu.ac.il> <42DF131D.1080802@us.ibm.com> Reply-To: tzachar@cs.bgu.ac.il Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Xp9QF3eJNuiYkj0QzkFR" Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from indigo.cs.bgu.ac.il ([132.72.42.23]:5037 "EHLO indigo.cs.bgu.ac.il") by vger.kernel.org with ESMTP id S261662AbVGUGo2 (ORCPT ); Thu, 21 Jul 2005 02:44:28 -0400 To: Badari Pulavarty In-Reply-To: <42DF131D.1080802@us.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-Xp9QF3eJNuiYkj0QzkFR Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2005-07-20 at 20:14 -0700, Badari Pulavarty wrote: > Nir Tzachar wrote: >=20 > > hello list. > >=20 > > can someone please explain the exact semantics the get_block_t function= =20 > > (which is passed to mpage_readpage(s)) should implement?? > > i could not find any documentation, and existing code kind of baffled > > me... > >=20 > > my current understanding goes like this: > > if the block is present, call map_bh on the bh, with the physical block > > number. > > else, if "create" is set, allocate a new block for the inode, and again > > update the new physical block number. > >=20 > > is this all??=20 > >=20 > > thanks. > >=20 >=20 > For a given file offset, get_block() function is supposed to return the > physical disk block# of the block. (and size of the block). If "create" > is one, it needs to allocate the block (if it doesn't already exist).=20 > Makes sense ? from fs.h: typedef int (get_block_t)(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create); so, iblock is the block number in the file, or the offset in the file?? furthermore, what set_buffer_mapped (used in map_bh) does?? i could not find it's definition anywhere?? about create, "allocate a block" means just deciding which block should be allocated, update the fs control structures, and return that block #, right?? > Thanks, > Badari --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Nir Tzachar. --=-Xp9QF3eJNuiYkj0QzkFR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBC30TMIHR+zI+Dam4RAkaNAJ0Q1NQFTmWAeL2aFlUS+tHcST6auwCfam1B otXR3kr0EUbncMOfMI6Y/eE= =xJvs -----END PGP SIGNATURE----- --=-Xp9QF3eJNuiYkj0QzkFR--