]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
UBIFS: do not lie about used blocks
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 22 Dec 2008 09:21:03 +0000 (11:21 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 31 Dec 2008 12:13:24 +0000 (14:13 +0200)
Do not force UBIFS return 0 used space when it is empty. It leads
to a situation when creating any file immediately produces tens of
used blocks, which looks very weird. It is better to be honest and
say that some blocks are used even if the FS is empty. And ext2
does the same.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
fs/ubifs/budget.c

index 44cff803171a9cf12fc4e4a8339b92b728dc2060..3715d0114952b68be4d846cc9d5bfca4849ca4a0 100644 (file)
@@ -766,16 +766,6 @@ long long ubifs_get_free_space(struct ubifs_info *c)
        min_idx_lebs = c->min_idx_lebs;
        ubifs_assert(min_idx_lebs == ubifs_calc_min_idx_lebs(c));
        outstanding = c->budg_data_growth + c->budg_dd_growth;
-
-       /*
-        * Force the amount available to the total size reported if the used
-        * space is zero.
-        */
-       if (c->lst.total_used <= UBIFS_INO_NODE_SZ && !outstanding) {
-               spin_unlock(&c->space_lock);
-               return (long long)c->block_cnt << UBIFS_BLOCK_SHIFT;
-       }
-
        available = ubifs_calc_available(c, min_idx_lebs);
 
        /*