diff options
author | Josef Bacik <jbacik@fb.com> | 2014-10-10 16:57:13 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-10-14 10:45:03 +0200 |
commit | b25a40651d15c8ca795ab7a4f1b8150128f09e3c (patch) | |
tree | 7e3eaec4a384d5d14b3b8676168405fe7b83444c /ctree.h | |
parent | 994ce2672dbf89fe5a7a18557b15449f0f83af65 (diff) | |
download | btrfs-progs-b25a40651d15c8ca795ab7a4f1b8150128f09e3c.tar.gz |
Btrfs-progs: delete bogus dir indexes
We may run across dir indexes that are corrupt in such a way that it makes them
useless, such as having a bad location key or a bad name. In this case we can
just delete dir indexes that don't show up properly and then re-create what we
need. When we delete dir indexes however we need to restart scanning the fs
tree as we could have greated bogus inode recs if the location key was bad, so
set it up so that if we had to delete an dir index we go ahead and free up our
inode recs and return -EAGAIN to check_fs_roots so it knows to restart the loop.
Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'ctree.h')
-rw-r--r-- | ctree.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2360,6 +2360,15 @@ struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_path *path, u64 dir, const char *name, int name_len, int mod); +struct btrfs_dir_item *btrfs_lookup_dir_index(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_path *path, u64 dir, + const char *name, int name_len, + u64 index, int mod); +int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_path *path, + struct btrfs_dir_item *di); int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, u16 name_len, const void *data, u16 data_len, |