diff options
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 00cb924884f5..a1216f9b4917 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -3067,48 +3067,6 @@ static struct pending_dir_move *get_pending_dir_moves(struct send_ctx *sctx, | |||
3067 | return NULL; | 3067 | return NULL; |
3068 | } | 3068 | } |
3069 | 3069 | ||
3070 | static int path_loop(struct send_ctx *sctx, struct fs_path *name, | ||
3071 | u64 ino, u64 gen, u64 *ancestor_ino) | ||
3072 | { | ||
3073 | int ret = 0; | ||
3074 | u64 parent_inode = 0; | ||
3075 | u64 parent_gen = 0; | ||
3076 | u64 start_ino = ino; | ||
3077 | |||
3078 | *ancestor_ino = 0; | ||
3079 | while (ino != BTRFS_FIRST_FREE_OBJECTID) { | ||
3080 | fs_path_reset(name); | ||
3081 | |||
3082 | if (is_waiting_for_rm(sctx, ino)) | ||
3083 | break; | ||
3084 | if (is_waiting_for_move(sctx, ino)) { | ||
3085 | if (*ancestor_ino == 0) | ||
3086 | *ancestor_ino = ino; | ||
3087 | ret = get_first_ref(sctx->parent_root, ino, | ||
3088 | &parent_inode, &parent_gen, name); | ||
3089 | } else { | ||
3090 | ret = __get_cur_name_and_parent(sctx, ino, gen, | ||
3091 | &parent_inode, | ||
3092 | &parent_gen, name); | ||
3093 | if (ret > 0) { | ||
3094 | ret = 0; | ||
3095 | break; | ||
3096 | } | ||
3097 | } | ||
3098 | if (ret < 0) | ||
3099 | break; | ||
3100 | if (parent_inode == start_ino) { | ||
3101 | ret = 1; | ||
3102 | if (*ancestor_ino == 0) | ||
3103 | *ancestor_ino = ino; | ||
3104 | break; | ||
3105 | } | ||
3106 | ino = parent_inode; | ||
3107 | gen = parent_gen; | ||
3108 | } | ||
3109 | return ret; | ||
3110 | } | ||
3111 | |||
3112 | static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) | 3070 | static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) |
3113 | { | 3071 | { |
3114 | struct fs_path *from_path = NULL; | 3072 | struct fs_path *from_path = NULL; |
@@ -3120,7 +3078,6 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) | |||
3120 | struct waiting_dir_move *dm = NULL; | 3078 | struct waiting_dir_move *dm = NULL; |
3121 | u64 rmdir_ino = 0; | 3079 | u64 rmdir_ino = 0; |
3122 | int ret; | 3080 | int ret; |
3123 | u64 ancestor = 0; | ||
3124 | 3081 | ||
3125 | name = fs_path_alloc(); | 3082 | name = fs_path_alloc(); |
3126 | from_path = fs_path_alloc(); | 3083 | from_path = fs_path_alloc(); |
@@ -3152,22 +3109,6 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) | |||
3152 | goto out; | 3109 | goto out; |
3153 | 3110 | ||
3154 | sctx->send_progress = sctx->cur_ino + 1; | 3111 | sctx->send_progress = sctx->cur_ino + 1; |
3155 | ret = path_loop(sctx, name, pm->ino, pm->gen, &ancestor); | ||
3156 | if (ret) { | ||
3157 | LIST_HEAD(deleted_refs); | ||
3158 | ASSERT(ancestor > BTRFS_FIRST_FREE_OBJECTID); | ||
3159 | ret = add_pending_dir_move(sctx, pm->ino, pm->gen, ancestor, | ||
3160 | &pm->update_refs, &deleted_refs, | ||
3161 | pm->is_orphan); | ||
3162 | if (ret < 0) | ||
3163 | goto out; | ||
3164 | if (rmdir_ino) { | ||
3165 | dm = get_waiting_dir_move(sctx, pm->ino); | ||
3166 | ASSERT(dm); | ||
3167 | dm->rmdir_ino = rmdir_ino; | ||
3168 | } | ||
3169 | goto out; | ||
3170 | } | ||
3171 | fs_path_reset(name); | 3112 | fs_path_reset(name); |
3172 | to_path = name; | 3113 | to_path = name; |
3173 | name = NULL; | 3114 | name = NULL; |