From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: get_blocks_t semantics Date: Wed, 20 Jul 2005 20:14:37 -0700 Message-ID: <42DF131D.1080802@us.ibm.com> References: <1121868182.18164.9.camel@nexus.cs.bgu.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from e3.ny.us.ibm.com ([32.97.182.143]:50099 "EHLO e3.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261591AbVGUDOh (ORCPT ); Wed, 20 Jul 2005 23:14:37 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j6L3Eb03012326 for ; Wed, 20 Jul 2005 23:14:37 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j6L3Ebri251144 for ; Wed, 20 Jul 2005 23:14:37 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j6L3EaB8010677 for ; Wed, 20 Jul 2005 23:14:37 -0400 To: tzachar@cs.bgu.ac.il In-Reply-To: <1121868182.18164.9.camel@nexus.cs.bgu.ac.il> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Nir Tzachar wrote: > hello list. > > can someone please explain the exact semantics the get_block_t function > (which is passed to mpage_readpage(s)) should implement?? > i could not find any documentation, and existing code kind of baffled > me... > > 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. > > is this all?? > > thanks. > 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). Makes sense ? Thanks, Badari