From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Good place to drop preallocation on directories Date: Wed, 19 Nov 2008 21:32:42 +0100 Message-ID: <20081119203242.GE29820@duck.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from styx.suse.cz ([82.119.242.94]:56792 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752530AbYKSUco (ORCPT ); Wed, 19 Nov 2008 15:32:44 -0500 Received: from duck.suse.cz (duck.suse.cz [10.20.1.74]) by mail.suse.cz (Postfix) with ESMTP id C13286280F7 for ; Wed, 19 Nov 2008 21:32:42 +0100 (CET) Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi! I have a problem in UDF so I thought I'll post it here if someone has a good idea how to solve it. UDF does preallocation on directories (on files a well, but that is not a problem). Now this helps against directory fragmentation but there is an issue with it: When to drop this preallocation? Currently it is done in udf_clear_inode() which has two problems: 1) udf_clear_inode() is really called to late to do anything like freeing space from inode and UDF has to play some nasty tricks (like explicitely syncing inode, calling invalidate_inode_buffers() once more) to make everything work. Using udf_drop_inode() would be much better but that is called under i_lock so it's not really usable (unless I'd drop i_lock in it but then it would even nastier). 2) When you create lots of directories, they use quite some additional space for preallocation and there's not really a got way how to get rid of preallocated blocks than dropping dcache or umount + mount the filesystem. So after all I'm thinking whether directory preallocation is really worth the trouble. But before I go and rip it I'd like to check whether someone does not have some clever idea :). Honza -- Jan Kara SUSE Labs, CR