Lines Matching defs:dir

28 #include "dir-item.h"
65 * 2) we must log any new names for any file or dir that is in the fsync
68 * 2a) we must log any new names for any file or dir during rename
70 * ---> check inode and old parent dir during rename
84 * called on f1, only its parent dir. After a crash the rm -rf must
900 struct btrfs_inode *dir,
906 ret = btrfs_unlink_inode(trans, dir, inode, name);
928 struct btrfs_inode *dir,
931 struct btrfs_root *root = dir->root;
957 ret = unlink_inode_for_log_replay(trans, dir, BTRFS_I(inode), &name);
1054 struct btrfs_inode *dir,
1109 ret = unlink_inode_for_log_replay(trans, dir, inode,
1190 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir),
1195 ret = drop_one_dir_item(trans, path, dir, di);
1202 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), name, 0);
1206 ret = drop_one_dir_item(trans, path, dir, di);
1261 * reference item and both dir index keys).
1310 struct inode *dir;
1313 dir = read_one_inode(root, parent_id);
1314 if (!dir) {
1319 ret = unlink_inode_for_log_replay(trans, BTRFS_I(dir),
1322 iput(dir);
1354 struct inode *dir = NULL;
1384 * for a given inode. If we don't find the dir, just don't
1388 dir = read_one_inode(root, parent_objectid);
1389 if (!dir) {
1408 if (!dir)
1409 dir = read_one_inode(root, parent_objectid);
1410 if (!dir) {
1420 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)),
1433 BTRFS_I(dir), BTRFS_I(inode),
1443 ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode),
1458 iput(dir);
1459 dir = NULL;
1468 * dir index entries exist for a name but there is no inode reference
1481 iput(dir);
1706 * record a given inode in the fixup dir so we can check its link
1756 struct inode *dir;
1763 dir = read_one_inode(root, dirid);
1764 if (!dir) {
1769 ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), name,
1775 iput(dir);
1780 struct btrfs_inode *dir,
1804 return drop_one_dir_item(trans, path, dir, dst_di);
1837 struct inode *dir;
1844 dir = read_one_inode(root, key->objectid);
1845 if (!dir)
1867 ret = delete_conflicting_dir_entry(trans, BTRFS_I(dir), path,
1884 ret = delete_conflicting_dir_entry(trans, BTRFS_I(dir), path,
1941 btrfs_i_size_write(BTRFS_I(dir), dir->i_size + name.len * 2);
1942 ret = btrfs_update_inode(trans, root, BTRFS_I(dir));
1945 iput(dir);
1951 /* Replay one dir item from a BTRFS_DIR_INDEX_KEY key. */
1961 /* We only log dir index keys, which only contain a single dir item. */
1975 * for this dir entry:
2102 struct inode *dir,
2105 struct btrfs_root *root = BTRFS_I(dir)->root;
2115 * Currently we only log dir index keys. Even if we replay a log created
2116 * by an older kernel that logged both dir index and dir item keys, all
2117 * we need to do is process the dir index keys, we (and our caller) can
2118 * safely ignore dir item keys (key type BTRFS_DIR_ITEM_KEY).
2159 ret = unlink_inode_for_log_replay(trans, BTRFS_I(dir), BTRFS_I(inode),
2162 * Unlike dir item keys, dir index keys can only have one name (entry) in
2294 struct inode *dir;
2302 dir = read_one_inode(root, dirid);
2307 if (!dir) {
2354 log_path, dir,
2371 iput(dir);
3351 * not skip checking if dir index keys found in modified subvolume tree
3353 * to insert duplicate dir index keys in the log tree. This must be done
3381 * We only log dir index items of a directory, so we don't need to look
3382 * for dir item keys.
3403 * create file X in dir Y
3404 * link file X to X.link in dir Y
3407 * fsync dir Y
3423 struct btrfs_inode *dir, u64 index)
3428 ret = inode_logged(trans, dir, NULL);
3440 mutex_lock(&dir->log_mutex);
3448 ret = del_logged_dentry(trans, root->log_root, path, btrfs_ino(dir),
3452 mutex_unlock(&dir->log_mutex);
3512 * items from other inodes and that result in pushing off some dir items
3514 * This results in logging the same dir index range key.
3675 * Skip ranges of items that consist only of dir item keys created
3677 * dir index range item for that gap, so that index keys in that
3693 /* If we logged this dir index item before, we can skip it. */
3813 * The dir index key before the first one we found that needs to
3833 * need to log the parent directory of an inode. This means a dir index
3837 * not log dir index keys that come after the one that was just deleted
3838 * and we can end up logging a dir index range that ends at (u64)-1
3839 * (@last_offset is initialized to that), resulting in removing dir
3889 * and has at least one dir index key.
3913 * all its dir items are from a past transaction, the last item
3914 * in the leaf is a dir item and there's no gap between that last
3915 * dir item and the first one on the next leaf (which did not
3933 * is to avoid lookups in the log tree every time we try to insert a dir index
3935 * do batch insertions of dir index keys.
3971 * No dir index items, bail out and leave last_dir_index_offset with
4000 * that dir entry was unlinked during the transaction.
5593 * If the other inode that had a conflicting dir entry was deleted in
5725 * If the other inode that had a conflicting dir entry was
5744 * the dir index of the conflicting inode is not in a
5745 * dir index key range logged for the directory. So we
6001 /* We are adding dir index items to the log tree. */
6091 * Find a range of consecutive dir index items to delete. Like
6092 * this we log a single dir range item spanning several contiguous
6093 * dir items instead of logging one range item per dir index item.
6193 * existing one. Otherwise we have to log a dir range item.
6230 * We are deleting dir index items from the log tree or adding range
6519 * dir index items in case they get flushed while or right after we are
7309 struct btrfs_inode *dir, struct btrfs_inode *inode,
7335 if (inode_logged(trans, dir, NULL) == 1)
7354 mutex_lock(&dir->log_mutex);
7355 dir->last_unlink_trans = trans->transid;
7356 mutex_unlock(&dir->log_mutex);
7372 struct btrfs_inode *dir)
7374 mutex_lock(&dir->log_mutex);
7375 dir->last_unlink_trans = trans->transid;
7376 mutex_unlock(&dir->log_mutex);
7439 * dir entry deleted. This is needed because we will also log the new
7441 * replay we don't end up with both the new and old dir entries existing.
7487 * the old name's dir index item is in the delayed items, so