summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorSu Yue <suy.fnst@cn.fujitsu.com>2017-08-28 15:08:09 +0800
committerDavid Sterba <dsterba@suse.com>2017-10-16 20:33:00 +0200
commit3efc459166ad8d104912ec06c4ec9e0db6b7ef79 (patch)
treeb41c3099ccdd1b1aae298c1841ceb008ed283aff /cmds-check.c
parent564901eac7a43e85c01e5da90dbd7af6507cc724 (diff)
btrfs-progs: check: adjustments for further repair
For code reuse, btrfs_insert_dir_item() now calls inserts_with_overflow() even if the dir_item existed. Add a parameter @ignore_existed to btrfs_add_link(). If @ignore_existed is not zero, btrfs_add_link() continues to do link. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds-check.c b/cmds-check.c
index e1fe9a49..4f3958b9 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2961,7 +2961,7 @@ static int reset_nlink(struct btrfs_trans_handle *trans,
list_for_each_entry(backref, &rec->backrefs, list) {
ret = btrfs_add_link(trans, root, rec->ino, backref->dir,
backref->name, backref->namelen,
- backref->filetype, &backref->index, 1);
+ backref->filetype, &backref->index, 1, 0);
if (ret < 0)
goto out;
}
@@ -3053,7 +3053,7 @@ static int repair_inode_nlinks(struct btrfs_trans_handle *trans,
goto out;
}
ret = btrfs_add_link(trans, root, rec->ino, lost_found_ino,
- namebuf, namelen, type, NULL, 1);
+ namebuf, namelen, type, NULL, 1, 0);
/*
* Add ".INO" suffix several times to handle case where
* "FILENAME.INO" is already taken by another file.
@@ -3072,7 +3072,7 @@ static int repair_inode_nlinks(struct btrfs_trans_handle *trans,
namelen += count_digits(rec->ino) + 1;
ret = btrfs_add_link(trans, root, rec->ino,
lost_found_ino, namebuf,
- namelen, type, NULL, 1);
+ namelen, type, NULL, 1, 0);
}
if (ret < 0) {
fprintf(stderr,