aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-05-14 00:57:44 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-05-14 00:57:44 -0400
commit12b7ac176831df1aa58a787e67c3e5d698b30163 (patch)
treed8d3ab93fd28d5b84efff0b5c247da74c84788e0 /fs/ext4
parente4d996ca806e93dddb5d76c0d3d859b494c559f6 (diff)
ext4: Rename ext4_get_blocks_wrap() to be ext4_get_blocks()
Another function rename for clarity's sake. The _wrap prefix simply confuses people, and didn't add much people trying to follow the code paths. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/dir.c3
-rw-r--r--fs/ext4/ext4.h8
-rw-r--r--fs/ext4/extents.c6
-rw-r--r--fs/ext4/inode.c35
4 files changed, 25 insertions, 27 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index b64789929a65..052d6378f997 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -131,8 +131,7 @@ static int ext4_readdir(struct file *filp,
131 struct buffer_head *bh = NULL; 131 struct buffer_head *bh = NULL;
132 132
133 map_bh.b_state = 0; 133 map_bh.b_state = 0;
134 err = ext4_get_blocks_wrap(NULL, inode, blk, 1, &map_bh, 134 err = ext4_get_blocks(NULL, inode, blk, 1, &map_bh, 0, 0, 0);
135 0, 0, 0);
136 if (err > 0) { 135 if (err > 0) {
137 pgoff_t index = map_bh.b_blocknr >> 136 pgoff_t index = map_bh.b_blocknr >>
138 (PAGE_CACHE_SHIFT - inode->i_blkbits); 137 (PAGE_CACHE_SHIFT - inode->i_blkbits);
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 89190ae671f6..5dc8368e46bc 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1617,10 +1617,10 @@ extern void ext4_ext_init(struct super_block *);
1617extern void ext4_ext_release(struct super_block *); 1617extern void ext4_ext_release(struct super_block *);
1618extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset, 1618extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
1619 loff_t len); 1619 loff_t len);
1620extern int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, 1620extern int ext4_get_blocks(handle_t *handle, struct inode *inode,
1621 sector_t block, unsigned int max_blocks, 1621 sector_t block, unsigned int max_blocks,
1622 struct buffer_head *bh, int create, 1622 struct buffer_head *bh, int create,
1623 int extend_disksize, int flag); 1623 int extend_disksize, int flag);
1624extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 1624extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
1625 __u64 start, __u64 len); 1625 __u64 start, __u64 len);
1626 1626
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 4fec6b746382..7e7d02dd2739 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3151,9 +3151,9 @@ retry:
3151 break; 3151 break;
3152 } 3152 }
3153 map_bh.b_state = 0; 3153 map_bh.b_state = 0;
3154 ret = ext4_get_blocks_wrap(handle, inode, block, 3154 ret = ext4_get_blocks(handle, inode, block,
3155 max_blocks, &map_bh, 3155 max_blocks, &map_bh,
3156 EXT4_CREATE_UNINITIALIZED_EXT, 0, 0); 3156 EXT4_CREATE_UNINITIALIZED_EXT, 0, 0);
3157 if (ret <= 0) { 3157 if (ret <= 0) {
3158#ifdef EXT4FS_DEBUG 3158#ifdef EXT4FS_DEBUG
3159 WARN_ON(ret <= 0); 3159 WARN_ON(ret <= 0);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index f758e8021d1a..a9a9b9b77e8e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1121,7 +1121,7 @@ static void ext4_da_update_reserve_space(struct inode *inode, int used)
1121} 1121}
1122 1122
1123/* 1123/*
1124 * The ext4_get_blocks_wrap() function try to look up the requested blocks, 1124 * The ext4_get_blocks() function tries to look up the requested blocks,
1125 * and returns if the blocks are already mapped. 1125 * and returns if the blocks are already mapped.
1126 * 1126 *
1127 * Otherwise it takes the write lock of the i_data_sem and allocate blocks 1127 * Otherwise it takes the write lock of the i_data_sem and allocate blocks
@@ -1142,9 +1142,9 @@ static void ext4_da_update_reserve_space(struct inode *inode, int used)
1142 * 1142 *
1143 * It returns the error in case of allocation failure. 1143 * It returns the error in case of allocation failure.
1144 */ 1144 */
1145int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1145int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,
1146 unsigned int max_blocks, struct buffer_head *bh, 1146 unsigned int max_blocks, struct buffer_head *bh,
1147 int create, int extend_disksize, int flag) 1147 int create, int extend_disksize, int flag)
1148{ 1148{
1149 int retval; 1149 int retval;
1150 1150
@@ -1268,8 +1268,8 @@ int ext4_get_block(struct inode *inode, sector_t iblock,
1268 started = 1; 1268 started = 1;
1269 } 1269 }
1270 1270
1271 ret = ext4_get_blocks_wrap(handle, inode, iblock, 1271 ret = ext4_get_blocks(handle, inode, iblock, max_blocks, bh_result,
1272 max_blocks, bh_result, create, 0, 0); 1272 create, 0, 0);
1273 if (ret > 0) { 1273 if (ret > 0) {
1274 bh_result->b_size = (ret << inode->i_blkbits); 1274 bh_result->b_size = (ret << inode->i_blkbits);
1275 ret = 0; 1275 ret = 0;
@@ -1294,10 +1294,9 @@ struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode,
1294 dummy.b_state = 0; 1294 dummy.b_state = 0;
1295 dummy.b_blocknr = -1000; 1295 dummy.b_blocknr = -1000;
1296 buffer_trace_init(&dummy.b_history); 1296 buffer_trace_init(&dummy.b_history);
1297 err = ext4_get_blocks_wrap(handle, inode, block, 1, 1297 err = ext4_get_blocks(handle, inode, block, 1, &dummy, create, 1, 0);
1298 &dummy, create, 1, 0);
1299 /* 1298 /*
1300 * ext4_get_blocks_wrap() returns number of blocks 1299 * ext4_get_blocks() returns number of blocks
1301 * mapped. 0 in case of a HOLE. 1300 * mapped. 0 in case of a HOLE.
1302 */ 1301 */
1303 if (err > 0) { 1302 if (err > 0) {
@@ -2009,8 +2008,8 @@ static int ext4_da_get_block_write(struct inode *inode, sector_t iblock,
2009 2008
2010 handle = ext4_journal_current_handle(); 2009 handle = ext4_journal_current_handle();
2011 BUG_ON(!handle); 2010 BUG_ON(!handle);
2012 ret = ext4_get_blocks_wrap(handle, inode, iblock, max_blocks, 2011 ret = ext4_get_blocks(handle, inode, iblock, max_blocks,
2013 bh_result, 1, 0, EXT4_DELALLOC_RSVED); 2012 bh_result, 1, 0, EXT4_DELALLOC_RSVED);
2014 if (ret <= 0) 2013 if (ret <= 0)
2015 return ret; 2014 return ret;
2016 2015
@@ -2067,11 +2066,11 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
2067 /* 2066 /*
2068 * We need to make sure the BH_Delay flag is passed down to 2067 * We need to make sure the BH_Delay flag is passed down to
2069 * ext4_da_get_block_write(), since it calls 2068 * ext4_da_get_block_write(), since it calls
2070 * ext4_get_blocks_wrap() with the EXT4_DELALLOC_RSVED flag. 2069 * ext4_get_blocks() with the EXT4_DELALLOC_RSVED flag.
2071 * This flag causes ext4_get_blocks_wrap() to call 2070 * This flag causes ext4_get_blocks() to call
2072 * ext4_da_update_reserve_space() if the passed buffer head 2071 * ext4_da_update_reserve_space() if the passed buffer head
2073 * has the BH_Delay flag set. In the future, once we clean up 2072 * has the BH_Delay flag set. In the future, once we clean up
2074 * the interfaces to ext4_get_blocks_wrap(), we should pass in 2073 * the interfaces to ext4_get_blocks(), we should pass in
2075 * a separate flag which requests that the delayed allocation 2074 * a separate flag which requests that the delayed allocation
2076 * statistics should be updated, instead of depending on the 2075 * statistics should be updated, instead of depending on the
2077 * state information getting passed down via the map_bh's 2076 * state information getting passed down via the map_bh's
@@ -2363,7 +2362,7 @@ static int ext4_da_get_block_prep(struct inode *inode, sector_t iblock,
2363 * preallocated blocks are unmapped but should treated 2362 * preallocated blocks are unmapped but should treated
2364 * the same as allocated blocks. 2363 * the same as allocated blocks.
2365 */ 2364 */
2366 ret = ext4_get_blocks_wrap(NULL, inode, iblock, 1, bh_result, 0, 0, 0); 2365 ret = ext4_get_blocks(NULL, inode, iblock, 1, bh_result, 0, 0, 0);
2367 if ((ret == 0) && !buffer_delay(bh_result)) { 2366 if ((ret == 0) && !buffer_delay(bh_result)) {
2368 /* the block isn't (pre)allocated yet, let's reserve space */ 2367 /* the block isn't (pre)allocated yet, let's reserve space */
2369 /* 2368 /*
@@ -2407,8 +2406,8 @@ static int ext4_normal_get_block_write(struct inode *inode, sector_t iblock,
2407 * we don't want to do block allocation in writepage 2406 * we don't want to do block allocation in writepage
2408 * so call get_block_wrap with create = 0 2407 * so call get_block_wrap with create = 0
2409 */ 2408 */
2410 ret = ext4_get_blocks_wrap(NULL, inode, iblock, max_blocks, 2409 ret = ext4_get_blocks(NULL, inode, iblock, max_blocks,
2411 bh_result, 0, 0, 0); 2410 bh_result, 0, 0, 0);
2412 if (ret > 0) { 2411 if (ret > 0) {
2413 bh_result->b_size = (ret << inode->i_blkbits); 2412 bh_result->b_size = (ret << inode->i_blkbits);
2414 ret = 0; 2413 ret = 0;
@@ -5034,7 +5033,7 @@ int ext4_writepage_trans_blocks(struct inode *inode)
5034 * Calculate the journal credits for a chunk of data modification. 5033 * Calculate the journal credits for a chunk of data modification.
5035 * 5034 *
5036 * This is called from DIO, fallocate or whoever calling 5035 * This is called from DIO, fallocate or whoever calling
5037 * ext4_get_blocks_wrap() to map/allocate a chunk of contigous disk blocks. 5036 * ext4_get_blocks() to map/allocate a chunk of contigous disk blocks.
5038 * 5037 *
5039 * journal buffers for data blocks are not included here, as DIO 5038 * journal buffers for data blocks are not included here, as DIO
5040 * and fallocate do no need to journal data buffers. 5039 * and fallocate do no need to journal data buffers.