extents.c (40c406c74eb9eed58ae7d4d12a0197f7279c9499) extents.c (8dc79ec4c0537e1b83c0739af82a7babefb30012)
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 5300 unchanged lines hidden (view full) ---

5309 if (start >= stop_block)
5310 return ret;
5311
5312 /*
5313 * Don't start shifting extents until we make sure the hole is big
5314 * enough to accomodate the shift.
5315 */
5316 path = ext4_ext_find_extent(inode, start - 1, NULL, 0);
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 5300 unchanged lines hidden (view full) ---

5309 if (start >= stop_block)
5310 return ret;
5311
5312 /*
5313 * Don't start shifting extents until we make sure the hole is big
5314 * enough to accomodate the shift.
5315 */
5316 path = ext4_ext_find_extent(inode, start - 1, NULL, 0);
5317 if (IS_ERR(path))
5318 return PTR_ERR(path);
5317 depth = path->p_depth;
5318 extent = path[depth].p_ext;
5319 depth = path->p_depth;
5320 extent = path[depth].p_ext;
5319 ex_start = le32_to_cpu(extent->ee_block);
5320 ex_end = le32_to_cpu(extent->ee_block) +
5321 if (extent) {
5322 ex_start = le32_to_cpu(extent->ee_block);
5323 ex_end = le32_to_cpu(extent->ee_block) +
5321 ext4_ext_get_actual_len(extent);
5324 ext4_ext_get_actual_len(extent);
5325 } else {
5326 ex_start = 0;
5327 ex_end = 0;
5328 }
5322 ext4_ext_drop_refs(path);
5323 kfree(path);
5324
5325 if ((start == ex_start && shift > ex_start) ||
5326 (shift > start - ex_end))
5327 return -EINVAL;
5328
5329 /* Its safe to start updating extents */

--- 141 unchanged lines hidden ---
5329 ext4_ext_drop_refs(path);
5330 kfree(path);
5331
5332 if ((start == ex_start && shift > ex_start) ||
5333 (shift > start - ex_end))
5334 return -EINVAL;
5335
5336 /* Its safe to start updating extents */

--- 141 unchanged lines hidden ---