Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8fb4f41 authored by Dmitry Monakhov's avatar Dmitry Monakhov Committed by Theodore Ts'o
Browse files

ext4: use ext4_ext_next_allocated_block instead of mext_next_extent



This allows us to make mext_next_extent static and potentially get rid
of it.

Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent ee124d27
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -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,
extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
			     __u64 start_orig, __u64 start_donor,
			     __u64 start_orig, __u64 start_donor,
			     __u64 len, __u64 *moved_len);
			     __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 */
/* page-io.c */
extern int __init ext4_init_pageio(void);
extern int __init ext4_init_pageio(void);
+7 −9
Original line number Original line Diff line number Diff line
@@ -5304,7 +5304,7 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
	struct ext4_ext_path *path;
	struct ext4_ext_path *path;
	int ret = 0, depth;
	int ret = 0, depth;
	struct ext4_extent *extent;
	struct ext4_extent *extent;
	ext4_lblk_t stop_block, current_block;
	ext4_lblk_t stop_block;
	ext4_lblk_t ex_start, ex_end;
	ext4_lblk_t ex_start, ex_end;


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

		if (start > le32_to_cpu(extent->ee_block)) {
		current_block = le32_to_cpu(extent->ee_block);
		if (start > current_block) {
			/* Hole, move to the next extent */
			/* Hole, move to the next extent */
			ret = mext_next_extent(inode, path, &extent);
			if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) {
			if (ret != 0) {
				path[depth].p_ext++;
			} else {
				start = ext4_ext_next_allocated_block(path);
				ext4_ext_drop_refs(path);
				ext4_ext_drop_refs(path);
				kfree(path);
				kfree(path);
				if (ret == 1)
				continue;
					ret = 0;
				break;
			}
			}
		}
		}
		ret = ext4_ext_shift_path_extents(path, shift, inode,
		ret = ext4_ext_shift_path_extents(path, shift, inode,
+1 −1
Original line number Original line Diff line number Diff line
@@ -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
 * ext4_ext_path structure refers to the last extent, or a negative error
 * value on failure.
 * value on failure.
 */
 */
int
static int
mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
		      struct ext4_extent **extent)
		      struct ext4_extent **extent)
{
{