summaryrefslogtreecommitdiff
path: root/fs/minix/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 13:29:56 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-10 00:47:31 +0400
commitf4e420dc423148fba637af1ab618fa8896dfb2d6 (patch)
treedf0e81f5f4b8448dd6b3929e5537dcc46e7d7dde /fs/minix/inode.c
parent282dc178849882289d30e58b54be6b2799b351aa (diff)
downloadlinux-f4e420dc423148fba637af1ab618fa8896dfb2d6.tar.xz
clean up write_begin usage for directories in pagecache
For filesystem that implement directories in pagecache we call block_write_begin with an already allocated page for this code, while the normal regular file write path uses the default block_write_begin behaviour. Get rid of the __foofs_write_begin helper and opencode the normal write_begin call in foofs_write_begin, while adding a new foofs_prepare_chunk helper for the directory code. The added benefit is that foofs_prepare_chunk has a much saner calling convention. Note that the interruptible flag passed into block_write_begin is always ignored if we already pass in a page (see next patch for details), and we never were doing truncations of exessive blocks for this case either so we can switch directly to block_write_begin_newtrunc. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/minix/inode.c')
-rw-r--r--fs/minix/inode.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 756f8c93780c..f4abe45229bb 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -357,12 +357,10 @@ static int minix_readpage(struct file *file, struct page *page)
return block_read_full_page(page,minix_get_block);
}
-int __minix_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
- struct page **pagep, void **fsdata)
+int minix_prepare_chunk(struct page *page, loff_t pos, unsigned len)
{
- return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
- minix_get_block);
+ return block_write_begin_newtrunc(NULL, page->mapping, pos, len, 0,
+ &page, NULL, minix_get_block);
}
static int minix_write_begin(struct file *file, struct address_space *mapping,
@@ -370,7 +368,8 @@ static int minix_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata)
{
*pagep = NULL;
- return __minix_write_begin(file, mapping, pos, len, flags, pagep, fsdata);
+ return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ minix_get_block);
}
static sector_t minix_bmap(struct address_space *mapping, sector_t block)