From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Koss Subject: Re: fragmentation && blocks "realloc" Date: Sun, 22 Jan 2006 23:58:16 +0300 Message-ID: References: <1137764093.15107.33.camel@imp.csi.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: kernelnewbies@nl.linux.org, linux-fsdevel@vger.kernel.org Return-path: Received: from uproxy.gmail.com ([66.249.92.194]:26570 "EHLO uproxy.gmail.com") by vger.kernel.org with ESMTP id S1751362AbWAVU6S convert rfc822-to-8bit (ORCPT ); Sun, 22 Jan 2006 15:58:18 -0500 Received: by uproxy.gmail.com with SMTP id s2so541997uge for ; Sun, 22 Jan 2006 12:58:16 -0800 (PST) To: Anton Altaparmakov In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hello. >(They access the block device directly, completely >bypassing the page cache so you are breaking cache coherency and are 100% >broken by design.) Oh... I thought that start from 2.4.x there are no separate implementation of working with blocks and pages, when you read block, kernel read whole page, am I wrong? > They only way to help you > is to see your whole file system code If we need some handhold for discussion, lets talk about minix v.1 (my file system derive from this code). Lets suppose I want make algorigth of allocation blocks in fs/minix/bitmap.c: minix_new_block more inteligent. I should say that minix code use sb_bread/brelse and work with pages (for example fs/minix/dir.c). So instead of allocation one additional block, I want "realloc" blocks, so all file will occupy several consecutive blocks. And we stop on such code bh->b_blocknr = newblk; unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr); mark_buffer_dirty (bh); And question how should I get this _bh_, if I can not use sb_bread?