aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorJiaying Zhang <jiayingz@google.com>2010-03-02 13:28:44 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-03-02 13:28:44 -0500
commitc7064ef13b2181a489836349f9baf87df0dab28f (patch)
tree433d86d9ed4285e5c5e7f24fbbaa7f48fad09381 /fs/ext4/extents.c
parentb8b8afe236e97b6359d46d3a3f8c46455e192271 (diff)
ext4: mechanical rename some of the direct I/O get_block's identifiers
This commit renames some of the direct I/O's block allocation flags, variables, and functions introduced in Mingming's "Direct IO for holes and fallocate" patches so that they can be used by ext4's buffered write path as well. Also changed the related function comments accordingly to cover both direct write and buffered write cases. Signed-off-by: Jiaying Zhang <jiayingz@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a2c21aa09e2b..90ba8d9df697 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1619,7 +1619,7 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
1619 BUG_ON(path[depth].p_hdr == NULL); 1619 BUG_ON(path[depth].p_hdr == NULL);
1620 1620
1621 /* try to insert block into found extent and return */ 1621 /* try to insert block into found extent and return */
1622 if (ex && (flag != EXT4_GET_BLOCKS_DIO_CREATE_EXT) 1622 if (ex && (flag != EXT4_GET_BLOCKS_PRE_IO)
1623 && ext4_can_extents_be_merged(inode, ex, newext)) { 1623 && ext4_can_extents_be_merged(inode, ex, newext)) {
1624 ext_debug("append [%d]%d block to %d:[%d]%d (from %llu)\n", 1624 ext_debug("append [%d]%d block to %d:[%d]%d (from %llu)\n",
1625 ext4_ext_is_uninitialized(newext), 1625 ext4_ext_is_uninitialized(newext),
@@ -1740,7 +1740,7 @@ has_space:
1740 1740
1741merge: 1741merge:
1742 /* try to merge extents to the right */ 1742 /* try to merge extents to the right */
1743 if (flag != EXT4_GET_BLOCKS_DIO_CREATE_EXT) 1743 if (flag != EXT4_GET_BLOCKS_PRE_IO)
1744 ext4_ext_try_to_merge(inode, path, nearex); 1744 ext4_ext_try_to_merge(inode, path, nearex);
1745 1745
1746 /* try to merge extents to the left */ 1746 /* try to merge extents to the left */
@@ -2984,7 +2984,7 @@ fix_extent_len:
2984 ext4_ext_dirty(handle, inode, path + depth); 2984 ext4_ext_dirty(handle, inode, path + depth);
2985 return err; 2985 return err;
2986} 2986}
2987static int ext4_convert_unwritten_extents_dio(handle_t *handle, 2987static int ext4_convert_unwritten_extents_endio(handle_t *handle,
2988 struct inode *inode, 2988 struct inode *inode,
2989 struct ext4_ext_path *path) 2989 struct ext4_ext_path *path)
2990{ 2990{
@@ -3064,8 +3064,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
3064 flags, allocated); 3064 flags, allocated);
3065 ext4_ext_show_leaf(inode, path); 3065 ext4_ext_show_leaf(inode, path);
3066 3066
3067 /* DIO get_block() before submit the IO, split the extent */ 3067 /* get_block() before submit the IO, split the extent */
3068 if (flags == EXT4_GET_BLOCKS_DIO_CREATE_EXT) { 3068 if (flags == EXT4_GET_BLOCKS_PRE_IO) {
3069 ret = ext4_split_unwritten_extents(handle, 3069 ret = ext4_split_unwritten_extents(handle,
3070 inode, path, iblock, 3070 inode, path, iblock,
3071 max_blocks, flags); 3071 max_blocks, flags);
@@ -3075,14 +3075,14 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
3075 * completed 3075 * completed
3076 */ 3076 */
3077 if (io) 3077 if (io)
3078 io->flag = DIO_AIO_UNWRITTEN; 3078 io->flag = EXT4_IO_UNWRITTEN;
3079 else 3079 else
3080 ext4_set_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN); 3080 ext4_set_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN);
3081 goto out; 3081 goto out;
3082 } 3082 }
3083 /* async DIO end_io complete, convert the filled extent to written */ 3083 /* IO end_io complete, convert the filled extent to written */
3084 if (flags == EXT4_GET_BLOCKS_DIO_CONVERT_EXT) { 3084 if (flags == EXT4_GET_BLOCKS_CONVERT) {
3085 ret = ext4_convert_unwritten_extents_dio(handle, inode, 3085 ret = ext4_convert_unwritten_extents_endio(handle, inode,
3086 path); 3086 path);
3087 if (ret >= 0) 3087 if (ret >= 0)
3088 ext4_update_inode_fsync_trans(handle, inode, 1); 3088 ext4_update_inode_fsync_trans(handle, inode, 1);
@@ -3359,9 +3359,9 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
3359 * For non asycn direct IO case, flag the inode state 3359 * For non asycn direct IO case, flag the inode state
3360 * that we need to perform convertion when IO is done. 3360 * that we need to perform convertion when IO is done.
3361 */ 3361 */
3362 if (flags == EXT4_GET_BLOCKS_DIO_CREATE_EXT) { 3362 if (flags == EXT4_GET_BLOCKS_PRE_IO) {
3363 if (io) 3363 if (io)
3364 io->flag = DIO_AIO_UNWRITTEN; 3364 io->flag = EXT4_IO_UNWRITTEN;
3365 else 3365 else
3366 ext4_set_inode_state(inode, 3366 ext4_set_inode_state(inode,
3367 EXT4_STATE_DIO_UNWRITTEN); 3367 EXT4_STATE_DIO_UNWRITTEN);
@@ -3656,7 +3656,7 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
3656 map_bh.b_state = 0; 3656 map_bh.b_state = 0;
3657 ret = ext4_get_blocks(handle, inode, block, 3657 ret = ext4_get_blocks(handle, inode, block,
3658 max_blocks, &map_bh, 3658 max_blocks, &map_bh,
3659 EXT4_GET_BLOCKS_DIO_CONVERT_EXT); 3659 EXT4_GET_BLOCKS_IO_CONVERT_EXT);
3660 if (ret <= 0) { 3660 if (ret <= 0) {
3661 WARN_ON(ret <= 0); 3661 WARN_ON(ret <= 0);
3662 printk(KERN_ERR "%s: ext4_ext_get_blocks " 3662 printk(KERN_ERR "%s: ext4_ext_get_blocks "