From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Koss Subject: fragmentation && blocks "realloc" Date: Fri, 20 Jan 2006 14:47:09 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from uproxy.gmail.com ([66.249.92.197]:3531 "EHLO uproxy.gmail.com") by vger.kernel.org with ESMTP id S1750758AbWATLrM convert rfc822-to-8bit (ORCPT ); Fri, 20 Jan 2006 06:47:12 -0500 Received: by uproxy.gmail.com with SMTP id s2so294180uge for ; Fri, 20 Jan 2006 03:47:10 -0800 (PST) To: kernelnewbies@nl.linux.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hello. Let's suppose that we have file which consist of two blocks and user resizing file and now we need 4 blocks. Near this two blocks there are no 2 free blocks, and instead of allocating 2 additional blocks somewhere, I want allocate chunk of 4 blocks. The main problem is choose way of invalidate "old" blocks and copy data to new buffers, how it possible on linux? something like struct buffer_head *oldbh, *newbh; memcpy(newbh->b_data, oldbh->b_data); block_invalidatepage(oldbh->b_this_page,...) [ block_invalidatepage right choise ? ] or it is possible just change b_blocknr?