Lines Matching defs:dir

872 typedef int (*iterate_inode_ref_t)(int num, u64 dir, int index,
902 u64 dir;
938 dir = found_key->offset;
944 dir = btrfs_inode_extref_parent(eb, extref);
949 name_off, eb, dir,
963 eb, dir,
980 ret = iterate(num, dir, index, p, ctx);
1002 * path must point to the dir item when called.
1117 static int __copy_first_ref(int num, u64 dir, int index,
1702 * Helper function to lookup a dir item in a dir.
1705 u64 dir, const char *name, int name_len,
1719 dir, name, name_len, 0);
1738 * Looks up the first btrfs_inode_ref of a given ino. It returns the parent dir,
1739 * generation of the parent dir and the name of the dir entry.
1742 u64 *dir, u64 *dir_gen, struct fs_path *name)
1801 *dir = parent_dir;
1809 u64 ino, u64 dir,
1824 if (dir != tmp_dir || name_len != fs_path_len(tmp_name)) {
1846 static int will_overwrite_ref(struct send_ctx *sctx, u64 dir, u64 dir_gen,
1858 ret = is_inode_existent(sctx, dir, dir_gen);
1863 * If we have a parent root we need to verify that the parent dir was
1867 if (sctx->parent_root && dir != BTRFS_FIRST_FREE_OBJECTID) {
1868 ret = get_inode_info(sctx->parent_root, dir, NULL, &gen, NULL,
1880 ret = lookup_dir_item_inode(sctx->parent_root, dir, name, name_len,
1919 u64 dir, u64 dir_gen,
1931 ret = is_inode_existent(sctx, dir, dir_gen);
1935 if (dir != BTRFS_FIRST_FREE_OBJECTID) {
1936 ret = get_inode_info(sctx->send_root, dir, NULL, &gen, NULL,
1949 ret = lookup_dir_item_inode(sctx->send_root, dir, name, name_len,
1995 u64 dir;
2005 ret = get_first_ref(sctx->parent_root, ino, &dir, &dir_gen, name);
2009 ret = did_overwrite_ref(sctx, dir, dir_gen, ino, gen,
2179 * This should only happen for the parent dir that we determine in
2267 * 2. When a directory lost all it's refs (deleted) but still has dir items
2269 * tried to get the path to the dir items, it would get a path inside that
2673 * This function does the check if we already created the dir out of order.
2675 static int did_create_dir(struct send_ctx *sctx, u64 dir)
2692 key.objectid = dir;
2769 u64 dir;
2786 static int __record_ref(struct list_head *head, u64 dir,
2795 ref->dir = dir;
2810 new->dir = ref->dir;
2837 * Renames/moves a file/dir to its orphan name. Used when the first
2936 * We check this by iterating all dir items and checking if the inode behind
2937 * the dir item was already processed.
2939 static int can_rmdir(struct send_ctx *sctx, u64 dir, u64 dir_gen,
2952 * Don't try to rmdir the top/root subvolume dir.
2954 if (dir == BTRFS_FIRST_FREE_OBJECTID)
2961 key.objectid = dir;
2965 odi = get_orphan_dir_info(sctx, dir, dir_gen);
2996 odi = add_orphan_dir_info(sctx, dir, dir_gen);
3003 dm->rmdir_ino = dir;
3010 odi = add_orphan_dir_info(sctx, dir, dir_gen);
3346 ret = get_inode_info(sctx->send_root, cur->dir, NULL,
3355 ret = send_utimes(sctx, cur->dir, cur->dir_gen);
3489 key.objectid = parent_ref->dir;
3693 u64 ino = parent_ref->dir;
3804 ret = get_cur_path(sctx, ref->dir, ref->dir_gen, new_path);
3872 ret = get_cur_path(sctx, ref->dir, ref->dir_gen, ref->full_path);
3911 * This should never happen as the root dir always has the same ref
3994 ret = get_cur_inode_state(sctx, cur->dir, cur->dir_gen);
4006 ret = will_overwrite_ref(sctx, cur->dir, cur->dir_gen,
4013 ow_inode, cur->dir, cur->name,
4108 * did already happen before due to other refs in the same dir.
4110 ret = get_cur_inode_state(sctx, cur->dir, cur->dir_gen);
4117 * already create the dir.
4122 if (cur2->dir == cur->dir) {
4130 * did already create the dir.
4133 ret = did_create_dir(sctx, cur->dir);
4137 ret = send_create_inode(sctx, cur->dir);
4218 * orphanize it. For every dir item inside that gets deleted
4246 * We have a moved dir. Add the old parent to check_dirs
4255 * We have a non dir inode. Go through all deleted refs and
4260 ret = did_overwrite_ref(sctx, cur->dir, cur->dir_gen,
4311 * The dir will be processed later.
4313 if (cur->dir > sctx->cur_ino)
4316 ret = get_cur_inode_state(sctx, cur->dir, cur->dir_gen);
4323 ret = send_utimes(sctx, cur->dir, cur->dir_gen);
4327 cur->dir != last_dir_ino_rm) {
4328 ret = can_rmdir(sctx, cur->dir, cur->dir_gen,
4333 ret = get_cur_path(sctx, cur->dir,
4340 last_dir_ino_rm = cur->dir;
4354 static int record_ref(struct btrfs_root *root, u64 dir, struct fs_path *name,
4366 ret = get_inode_info(root, dir, NULL, &gen, NULL, NULL,
4371 ret = get_cur_path(sctx, dir, gen, p);
4378 ret = __record_ref(refs, dir, gen, p);
4386 static int __record_new_ref(int num, u64 dir, int index,
4391 return record_ref(sctx->send_root, dir, name, ctx, &sctx->new_refs);
4395 static int __record_deleted_ref(int num, u64 dir, int index,
4400 return record_ref(sctx->parent_root, dir, name, ctx,
4433 u64 dir;
4440 static int __find_iref(int num, u64 dir, int index,
4448 if (dir == ctx->dir && fs_path_len(name) == fs_path_len(ctx->name) &&
4454 ret = get_inode_info(ctx->root, dir, NULL, &dir_gen, NULL,
4469 u64 dir, u64 dir_gen, struct fs_path *name)
4474 ctx.dir = dir;
4490 static int __record_changed_new_ref(int num, u64 dir, int index,
4498 ret = get_inode_info(sctx->send_root, dir, NULL, &dir_gen, NULL,
4504 sctx->cmp_key, dir, dir_gen, name);
4506 ret = __record_new_ref(num, dir, index, name, sctx);
4513 static int __record_changed_deleted_ref(int num, u64 dir, int index,
4521 ret = get_inode_info(sctx->parent_root, dir, NULL, &dir_gen, NULL,
4527 dir, dir_gen, name);
4529 ret = __record_deleted_ref(num, dir, index, name, sctx);
6227 static int record_parent_ref(int num, u64 dir, int index, struct fs_path *name,
6232 return record_ref(ppctx->sctx->parent_root, dir, name, ppctx->sctx,
6355 * The cur_ino = root dir case is special here. We can't treat
6357 * stream that tries to delete/mkdir the root dir.
6581 static int dir_changed(struct send_ctx *sctx, u64 dir)
6586 ret = get_inode_info(sctx->send_root, dir, NULL, &new_gen, NULL, NULL,
6591 ret = get_inode_info(sctx->parent_root, dir, NULL, &orig_gen, NULL,