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>
This commit is contained in:
Nick Piggin
2007-10-16 01:25:09 -07:00
committed by Linus Torvalds
parent 7903d9eed8
commit 7c0efc6277
2 changed files with 20 additions and 19 deletions

View File

@@ -443,21 +443,18 @@ void hfsplus_file_truncate(struct inode *inode)
if (inode->i_size > HFSPLUS_I(inode).phys_size) {
struct address_space *mapping = inode->i_mapping;
struct page *page;
u32 size = inode->i_size - 1;
void *fsdata;
u32 size = inode->i_size;
int res;
page = grab_cache_page(mapping, size >> PAGE_CACHE_SHIFT);
if (!page)
return;
size &= PAGE_CACHE_SIZE - 1;
size++;
res = mapping->a_ops->prepare_write(NULL, page, size, size);
if (!res)
res = mapping->a_ops->commit_write(NULL, page, size, size);
res = pagecache_write_begin(NULL, mapping, size, 0,
AOP_FLAG_UNINTERRUPTIBLE,
&page, &fsdata);
if (res)
inode->i_size = HFSPLUS_I(inode).phys_size;
unlock_page(page);
page_cache_release(page);
return;
res = pagecache_write_end(NULL, mapping, size, 0, 0, page, fsdata);
if (res < 0)
return;
mark_inode_dirty(inode);
return;
} else if (inode->i_size == HFSPLUS_I(inode).phys_size)