X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fhfsplus%2Fextents.c;fp=fs%2Fhfsplus%2Fextents.c;h=1a7480089e82ef918cb71c91a52c4e86b214c2df;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=376498cc64fddb5b54df6d8f249df43570d38c5e;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index 376498cc6..1a7480089 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c @@ -11,13 +11,13 @@ #include #include #include -#include #include "hfsplus_fs.h" #include "hfsplus_raw.h" /* Compare two extents keys, returns 0 on same, pos/neg for difference */ -int hfsplus_ext_cmp_key(hfsplus_btree_key *k1, hfsplus_btree_key *k2) +int hfsplus_ext_cmp_key(const hfsplus_btree_key *k1, + const hfsplus_btree_key *k2) { __be32 k1id, k2id; __be32 k1s, k2s; @@ -350,10 +350,9 @@ int hfsplus_file_extend(struct inode *inode) if (HFSPLUS_SB(sb).alloc_file->i_size * 8 < HFSPLUS_SB(sb).total_blocks - HFSPLUS_SB(sb).free_blocks + 8) { // extend alloc file - printk("extend alloc file! (%Lu,%u,%u)\n", HFSPLUS_SB(sb).alloc_file->i_size * 8, + printk(KERN_ERR "hfs: extend alloc file! (%Lu,%u,%u)\n", HFSPLUS_SB(sb).alloc_file->i_size * 8, HFSPLUS_SB(sb).total_blocks, HFSPLUS_SB(sb).free_blocks); return -ENOSPC; - //BUG(); } down(&HFSPLUS_I(inode).extents_lock); @@ -461,7 +460,9 @@ void hfsplus_file_truncate(struct inode *inode) page_cache_release(page); mark_inode_dirty(inode); return; - } + } else if (inode->i_size == HFSPLUS_I(inode).phys_size) + return; + blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >> HFSPLUS_SB(sb).alloc_blksz_shift; alloc_cnt = HFSPLUS_I(inode).alloc_blocks; if (blk_cnt == alloc_cnt)