Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361599
b: refs/heads/master
c: 0e40110
h: refs/heads/master
i:
  361597: 3af2816
  361595: 43666f5
  361591: 55a85b6
  361583: 2bd4fcb
  361567: d309508
  361535: 79934ac
  361471: 5fc232c
v: v3
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Mar 18, 2013
1 parent b1dd715 commit 445f1b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f42f80a8f08d4c3f52c4267361241885d5dee3a
refs/heads/master: 0e401101db49959f5783f6ee9e676124b5a183ac
35 changes: 19 additions & 16 deletions trunk/fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
*/
static inline int
get_ext_path(struct inode *inode, ext4_lblk_t lblock,
struct ext4_ext_path **path)
struct ext4_ext_path **orig_path)
{
int ret = 0;
struct ext4_ext_path *path;

*path = ext4_ext_find_extent(inode, lblock, *path);
if (IS_ERR(*path)) {
ret = PTR_ERR(*path);
*path = NULL;
} else if ((*path)[ext_depth(inode)].p_ext == NULL)
path = ext4_ext_find_extent(inode, lblock, *orig_path);
if (IS_ERR(path))
ret = PTR_ERR(path);
else if (path[ext_depth(inode)].p_ext == NULL)
ret = -ENODATA;
else
*orig_path = path;

return ret;
}
Expand Down Expand Up @@ -611,24 +613,25 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
{
struct ext4_ext_path *path = NULL;
struct ext4_extent *ext;
int ret = 0;
ext4_lblk_t last = from + count;
while (from < last) {
*err = get_ext_path(inode, from, &path);
if (*err)
return 0;
goto out;
ext = path[ext_depth(inode)].p_ext;
if (!ext) {
ext4_ext_drop_refs(path);
return 0;
}
if (uninit != ext4_ext_is_uninitialized(ext)) {
ext4_ext_drop_refs(path);
return 0;
}
if (uninit != ext4_ext_is_uninitialized(ext))
goto out;
from += ext4_ext_get_actual_len(ext);
ext4_ext_drop_refs(path);
}
return 1;
ret = 1;
out:
if (path) {
ext4_ext_drop_refs(path);
kfree(path);
}
return ret;
}

/**
Expand Down

0 comments on commit 445f1b1

Please sign in to comment.