aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/extents.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-08-02 00:11:40 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-02 00:38:00 -0400
commitf76d28d235cf777dd2e1c1d48c16ee10c1d1587f (patch)
treee0f47d7b83276d91298326eb818e3de7fa32a2f2 /fs/hfsplus/extents.c
parent0072b1389c25355ccc01048114adb9652c13fd9f (diff)
[PATCH] hfs: don't dirty unchanged inode
If inode size hasn't changed, don't do anything further in truncate, which also prevents a dirty inode, what might upset some readonly devices quite badly. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hfsplus/extents.c')
-rw-r--r--fs/hfsplus/extents.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index 376498cc64fd..e7235ca79a95 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -461,7 +461,9 @@ void hfsplus_file_truncate(struct inode *inode)
461 page_cache_release(page); 461 page_cache_release(page);
462 mark_inode_dirty(inode); 462 mark_inode_dirty(inode);
463 return; 463 return;
464 } 464 } else if (inode->i_size == HFSPLUS_I(inode).phys_size)
465 return;
466
465 blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >> HFSPLUS_SB(sb).alloc_blksz_shift; 467 blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >> HFSPLUS_SB(sb).alloc_blksz_shift;
466 alloc_cnt = HFSPLUS_I(inode).alloc_blocks; 468 alloc_cnt = HFSPLUS_I(inode).alloc_blocks;
467 if (blk_cnt == alloc_cnt) 469 if (blk_cnt == alloc_cnt)