Skip to content

Commit

Permalink
ext4: use ext4_ext_next_allocated_block instead of mext_next_extent
Browse files Browse the repository at this point in the history
This allows us to make mext_next_extent static and potentially get rid
of it.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Aug 31, 2014
1 parent ee124d2 commit f8fb4f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2753,8 +2753,6 @@ extern void ext4_double_up_write_data_sem(struct inode *orig_inode,
extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
__u64 start_orig, __u64 start_donor,
__u64 len, __u64 *moved_len);
extern int mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
struct ext4_extent **extent);

/* page-io.c */
extern int __init ext4_init_pageio(void);
Expand Down
16 changes: 7 additions & 9 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -5304,7 +5304,7 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
struct ext4_ext_path *path;
int ret = 0, depth;
struct ext4_extent *extent;
ext4_lblk_t stop_block, current_block;
ext4_lblk_t stop_block;
ext4_lblk_t ex_start, ex_end;

/* Let path point to the last extent */
Expand Down Expand Up @@ -5365,17 +5365,15 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
(unsigned long) start);
return -EIO;
}

current_block = le32_to_cpu(extent->ee_block);
if (start > current_block) {
if (start > le32_to_cpu(extent->ee_block)) {
/* Hole, move to the next extent */
ret = mext_next_extent(inode, path, &extent);
if (ret != 0) {
if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) {
path[depth].p_ext++;
} else {
start = ext4_ext_next_allocated_block(path);
ext4_ext_drop_refs(path);
kfree(path);
if (ret == 1)
ret = 0;
break;
continue;
}
}
ret = ext4_ext_shift_path_extents(path, shift, inode,
Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ copy_extent_status(struct ext4_extent *src, struct ext4_extent *dest)
* ext4_ext_path structure refers to the last extent, or a negative error
* value on failure.
*/
int
static int
mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
struct ext4_extent **extent)
{
Expand Down

0 comments on commit f8fb4f4

Please sign in to comment.