aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-10-06 04:47:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:18:20 -0400
commitebdec241d509cf69f6ebf1ecdc036359d3dbe154 (patch)
treee3c23f9b213936cb8501c83f55522a01f4a69aca /fs/buffer.c
parent56b0dacfa2b8416815a2f2a5f4f51e46be4cf14c (diff)
fs: kill block_prepare_write
__block_write_begin and block_prepare_write are identical except for slightly different calling conventions. Convert all callers to the __block_write_begin calling conventions and drop block_prepare_write. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 7f0b9b083f77..a7b8f3c59a4e 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1834,9 +1834,11 @@ void page_zero_new_buffers(struct page *page, unsigned from, unsigned to)
1834} 1834}
1835EXPORT_SYMBOL(page_zero_new_buffers); 1835EXPORT_SYMBOL(page_zero_new_buffers);
1836 1836
1837int block_prepare_write(struct page *page, unsigned from, unsigned to, 1837int __block_write_begin(struct page *page, loff_t pos, unsigned len,
1838 get_block_t *get_block) 1838 get_block_t *get_block)
1839{ 1839{
1840 unsigned from = pos & (PAGE_CACHE_SIZE - 1);
1841 unsigned to = from + len;
1840 struct inode *inode = page->mapping->host; 1842 struct inode *inode = page->mapping->host;
1841 unsigned block_start, block_end; 1843 unsigned block_start, block_end;
1842 sector_t block; 1844 sector_t block;
@@ -1916,7 +1918,7 @@ int block_prepare_write(struct page *page, unsigned from, unsigned to,
1916 } 1918 }
1917 return err; 1919 return err;
1918} 1920}
1919EXPORT_SYMBOL(block_prepare_write); 1921EXPORT_SYMBOL(__block_write_begin);
1920 1922
1921static int __block_commit_write(struct inode *inode, struct page *page, 1923static int __block_commit_write(struct inode *inode, struct page *page,
1922 unsigned from, unsigned to) 1924 unsigned from, unsigned to)
@@ -1953,15 +1955,6 @@ static int __block_commit_write(struct inode *inode, struct page *page,
1953 return 0; 1955 return 0;
1954} 1956}
1955 1957
1956int __block_write_begin(struct page *page, loff_t pos, unsigned len,
1957 get_block_t *get_block)
1958{
1959 unsigned start = pos & (PAGE_CACHE_SIZE - 1);
1960
1961 return block_prepare_write(page, start, start + len, get_block);
1962}
1963EXPORT_SYMBOL(__block_write_begin);
1964
1965/* 1958/*
1966 * block_write_begin takes care of the basic task of block allocation and 1959 * block_write_begin takes care of the basic task of block allocation and
1967 * bringing partial write blocks uptodate first. 1960 * bringing partial write blocks uptodate first.
@@ -2379,7 +2372,7 @@ block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
2379 else 2372 else
2380 end = PAGE_CACHE_SIZE; 2373 end = PAGE_CACHE_SIZE;
2381 2374
2382 ret = block_prepare_write(page, 0, end, get_block); 2375 ret = __block_write_begin(page, 0, end, get_block);
2383 if (!ret) 2376 if (!ret)
2384 ret = block_commit_write(page, 0, end); 2377 ret = block_commit_write(page, 0, end);
2385 2378