diff options
author | Christoph Hellwig <hch@lst.de> | 2010-10-06 04:47:23 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:18:20 -0400 |
commit | ebdec241d509cf69f6ebf1ecdc036359d3dbe154 (patch) | |
tree | e3c23f9b213936cb8501c83f55522a01f4a69aca /fs/ocfs2 | |
parent | 56b0dacfa2b8416815a2f2a5f4f51e46be4cf14c (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/ocfs2')
-rw-r--r-- | fs/ocfs2/aops.c | 19 | ||||
-rw-r--r-- | fs/ocfs2/aops.h | 3 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 9 |
3 files changed, 6 insertions, 25 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 5cfeee118158..f1e962cb3b73 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -165,7 +165,7 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock, | |||
165 | * ocfs2 never allocates in this function - the only time we | 165 | * ocfs2 never allocates in this function - the only time we |
166 | * need to use BH_New is when we're extending i_size on a file | 166 | * need to use BH_New is when we're extending i_size on a file |
167 | * system which doesn't support holes, in which case BH_New | 167 | * system which doesn't support holes, in which case BH_New |
168 | * allows block_prepare_write() to zero. | 168 | * allows __block_write_begin() to zero. |
169 | * | 169 | * |
170 | * If we see this on a sparse file system, then a truncate has | 170 | * If we see this on a sparse file system, then a truncate has |
171 | * raced us and removed the cluster. In this case, we clear | 171 | * raced us and removed the cluster. In this case, we clear |
@@ -407,21 +407,6 @@ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc) | |||
407 | return ret; | 407 | return ret; |
408 | } | 408 | } |
409 | 409 | ||
410 | /* | ||
411 | * This is called from ocfs2_write_zero_page() which has handled it's | ||
412 | * own cluster locking and has ensured allocation exists for those | ||
413 | * blocks to be written. | ||
414 | */ | ||
415 | int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page, | ||
416 | unsigned from, unsigned to) | ||
417 | { | ||
418 | int ret; | ||
419 | |||
420 | ret = block_prepare_write(page, from, to, ocfs2_get_block); | ||
421 | |||
422 | return ret; | ||
423 | } | ||
424 | |||
425 | /* Taken from ext3. We don't necessarily need the full blown | 410 | /* Taken from ext3. We don't necessarily need the full blown |
426 | * functionality yet, but IMHO it's better to cut and paste the whole | 411 | * functionality yet, but IMHO it's better to cut and paste the whole |
427 | * thing so we can avoid introducing our own bugs (and easily pick up | 412 | * thing so we can avoid introducing our own bugs (and easily pick up |
@@ -732,7 +717,7 @@ static int ocfs2_should_read_blk(struct inode *inode, struct page *page, | |||
732 | } | 717 | } |
733 | 718 | ||
734 | /* | 719 | /* |
735 | * Some of this taken from block_prepare_write(). We already have our | 720 | * Some of this taken from __block_write_begin(). We already have our |
736 | * mapping by now though, and the entire write will be allocating or | 721 | * mapping by now though, and the entire write will be allocating or |
737 | * it won't, so not much need to use BH_New. | 722 | * it won't, so not much need to use BH_New. |
738 | * | 723 | * |
diff --git a/fs/ocfs2/aops.h b/fs/ocfs2/aops.h index 7606f663da6d..76bfdfda691a 100644 --- a/fs/ocfs2/aops.h +++ b/fs/ocfs2/aops.h | |||
@@ -22,9 +22,6 @@ | |||
22 | #ifndef OCFS2_AOPS_H | 22 | #ifndef OCFS2_AOPS_H |
23 | #define OCFS2_AOPS_H | 23 | #define OCFS2_AOPS_H |
24 | 24 | ||
25 | int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page, | ||
26 | unsigned from, unsigned to); | ||
27 | |||
28 | handle_t *ocfs2_start_walk_page_trans(struct inode *inode, | 25 | handle_t *ocfs2_start_walk_page_trans(struct inode *inode, |
29 | struct page *page, | 26 | struct page *page, |
30 | unsigned from, | 27 | unsigned from, |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 1ca6867935bb..77b4c04a2809 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -796,13 +796,12 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, | |||
796 | block_end = block_start + (1 << inode->i_blkbits); | 796 | block_end = block_start + (1 << inode->i_blkbits); |
797 | 797 | ||
798 | /* | 798 | /* |
799 | * block_start is block-aligned. Bump it by one to | 799 | * block_start is block-aligned. Bump it by one to force |
800 | * force ocfs2_{prepare,commit}_write() to zero the | 800 | * __block_write_begin and block_commit_write to zero the |
801 | * whole block. | 801 | * whole block. |
802 | */ | 802 | */ |
803 | ret = ocfs2_prepare_write_nolock(inode, page, | 803 | ret = __block_write_begin(page, block_start + 1, 0, |
804 | block_start + 1, | 804 | ocfs2_get_block); |
805 | block_start + 1); | ||
806 | if (ret < 0) { | 805 | if (ret < 0) { |
807 | mlog_errno(ret); | 806 | mlog_errno(ret); |
808 | goto out_unlock; | 807 | goto out_unlock; |