aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/extents.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-10-16 04:25:09 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:56 -0400
commit7c0efc627738c840a685ea0f2c23d09aad7d5d3b (patch)
treee51573472f37260d57541bb4456ae1a948307cc7 /fs/hfsplus/extents.c
parent7903d9eed82db81c15ee8b4114187dfdcad7650f (diff)
hfsplus: convert to new aops
Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/extents.c')
-rw-r--r--fs/hfsplus/extents.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index 1a7480089e82..12e899cd7886 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -443,21 +443,18 @@ void hfsplus_file_truncate(struct inode *inode)
443 if (inode->i_size > HFSPLUS_I(inode).phys_size) { 443 if (inode->i_size > HFSPLUS_I(inode).phys_size) {
444 struct address_space *mapping = inode->i_mapping; 444 struct address_space *mapping = inode->i_mapping;
445 struct page *page; 445 struct page *page;
446 u32 size = inode->i_size - 1; 446 void *fsdata;
447 u32 size = inode->i_size;
447 int res; 448 int res;
448 449
449 page = grab_cache_page(mapping, size >> PAGE_CACHE_SHIFT); 450 res = pagecache_write_begin(NULL, mapping, size, 0,
450 if (!page) 451 AOP_FLAG_UNINTERRUPTIBLE,
451 return; 452 &page, &fsdata);
452 size &= PAGE_CACHE_SIZE - 1;
453 size++;
454 res = mapping->a_ops->prepare_write(NULL, page, size, size);
455 if (!res)
456 res = mapping->a_ops->commit_write(NULL, page, size, size);
457 if (res) 453 if (res)
458 inode->i_size = HFSPLUS_I(inode).phys_size; 454 return;
459 unlock_page(page); 455 res = pagecache_write_end(NULL, mapping, size, 0, 0, page, fsdata);
460 page_cache_release(page); 456 if (res < 0)
457 return;
461 mark_inode_dirty(inode); 458 mark_inode_dirty(inode);
462 return; 459 return;
463 } else if (inode->i_size == HFSPLUS_I(inode).phys_size) 460 } else if (inode->i_size == HFSPLUS_I(inode).phys_size)