Lines Matching defs:dir

55  * 2) we must log any new names for any file or dir that is in the fsync
58 * 2a) we must log any new names for any file or dir during rename
60 * ---> check inode and old parent dir during rename
74 * called on f1, only its parent dir. After a crash the rm -rf must
853 struct btrfs_inode *dir,
884 ret = btrfs_unlink_inode(trans, root, dir, BTRFS_I(inode), name,
989 struct btrfs_inode *dir,
1050 ret = btrfs_unlink_inode(trans, root, dir, inode,
1149 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir),
1155 ret = drop_one_dir_item(trans, root, path, dir, di);
1162 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir),
1167 ret = drop_one_dir_item(trans, root, path, dir, di);
1225 * reference item and both dir index keys).
1278 struct inode *dir;
1281 dir = read_one_inode(root, parent_id);
1282 if (!dir) {
1287 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
1290 iput(dir);
1318 static int btrfs_inode_ref_exists(struct inode *inode, struct inode *dir,
1324 const u64 parent_id = btrfs_ino(BTRFS_I(dir));
1358 struct inode *dir, struct inode *inode, const char *name,
1372 btrfs_ino(BTRFS_I(dir)),
1394 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), BTRFS_I(other_inode),
1409 ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode),
1431 struct inode *dir = NULL;
1463 * for a given inode. If we don't find the dir, just don't
1467 dir = read_one_inode(root, parent_objectid);
1468 if (!dir) {
1487 if (!dir)
1488 dir = read_one_inode(root, parent_objectid);
1489 if (!dir) {
1500 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)),
1516 BTRFS_I(dir),
1534 * and dir index entries, otherwise we would fail with
1537 ret = btrfs_inode_ref_exists(inode, dir, key->type,
1541 BTRFS_I(dir),
1565 ret = add_link(trans, root, dir, inode, name, namelen,
1578 iput(dir);
1579 dir = NULL;
1588 * dir index entries exist for a name but there is no inode reference
1601 iput(dir);
1834 * record a given inode in the fixup dir so we can check its link
1884 struct inode *dir;
1891 dir = read_one_inode(root, dirid);
1892 if (!dir) {
1897 ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), name,
1903 iput(dir);
1935 struct inode *dir;
1942 dir = read_one_inode(root, key->objectid);
1943 if (!dir)
2011 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di);
2020 btrfs_i_size_write(BTRFS_I(dir), dir->i_size + name_len * 2);
2021 ret = btrfs_update_inode(trans, root, dir);
2024 iput(dir);
2109 * inode with a wrong link that does not account for this dir
2245 struct inode *dir,
2308 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
2464 struct inode *dir;
2472 dir = read_one_inode(root, dirid);
2477 if (!dir) {
2522 log_path, dir,
2547 iput(dir);
3382 * create file X in dir Y
3383 * link file X to X.link in dir Y
3386 * fsync dir Y
3402 struct btrfs_inode *dir, u64 index)
3410 u64 dir_ino = btrfs_ino(dir);
3412 if (!inode_logged(trans, dir))
3419 mutex_lock(&dir->log_mutex);
3494 mutex_unlock(&dir->log_mutex);
3780 * that dir entry was unlinked during the transaction.
4959 * If the other inode that had a conflicting dir entry was
6448 struct btrfs_inode *dir, struct btrfs_inode *inode,
6467 * names for this file/dir will get recorded
6469 if (dir->logged_trans == trans->transid)
6493 mutex_lock(&dir->log_mutex);
6494 dir->last_unlink_trans = trans->transid;
6495 mutex_unlock(&dir->log_mutex);
6511 struct btrfs_inode *dir)
6513 mutex_lock(&dir->log_mutex);
6514 dir->last_unlink_trans = trans->transid;
6515 mutex_unlock(&dir->log_mutex);