Lines Matching refs:old_dir
1287 static int do_rename(struct inode *old_dir, struct dentry *old_dentry,
1291 struct ubifs_info *c = old_dir->i_sb->s_fs_info;
1297 int err, release, sync = 0, move = (new_dir != old_dir);
1320 old_dentry, old_inode->i_ino, old_dir->i_ino,
1339 err = fscrypt_setup_filename(old_dir, &old_dentry->d_name, 0, &old_nm);
1380 whiteout = create_whiteout(old_dir, old_dentry);
1411 /* Add the old_dentry size to the old_dir size. */
1415 lock_4_inodes(old_dir, new_dir, new_inode, whiteout);
1421 time = current_time(old_dir);
1428 * @old_dir loses a link because we are moving
1431 drop_nlink(old_dir);
1441 * but @old_dir still loses a link if we are
1445 drop_nlink(old_dir);
1449 old_dir->i_size -= old_sz;
1450 ubifs_inode(old_dir)->ui_size = old_dir->i_size;
1451 old_dir->i_mtime = old_dir->i_ctime = time;
1481 sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir);
1485 * S_SYNC flag of whiteout inherits from the old_dir, and we
1491 err = ubifs_jnl_rename(c, old_dir, old_inode, &old_nm, new_dir,
1496 unlock_4_inodes(old_dir, new_dir, new_inode, whiteout);
1530 old_dir->i_size += old_sz;
1531 ubifs_inode(old_dir)->ui_size = old_dir->i_size;
1534 inc_nlink(old_dir);
1539 inc_nlink(old_dir);
1542 unlock_4_inodes(old_dir, new_dir, new_inode, whiteout);
1555 static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,
1558 struct ubifs_info *c = old_dir->i_sb->s_fs_info;
1561 int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir);
1570 err = fscrypt_setup_filename(old_dir, &old_dentry->d_name, 0, &fst_nm);
1584 lock_4_inodes(old_dir, new_dir, NULL, NULL);
1586 time = current_time(old_dir);
1589 old_dir->i_mtime = old_dir->i_ctime = time;
1592 if (old_dir != new_dir) {
1595 drop_nlink(old_dir);
1599 inc_nlink(old_dir);
1603 err = ubifs_jnl_xrename(c, old_dir, fst_inode, &fst_nm, new_dir,
1606 unlock_4_inodes(old_dir, new_dir, NULL, NULL);
1615 static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
1620 struct ubifs_info *c = old_dir->i_sb->s_fs_info;
1625 ubifs_assert(c, inode_is_locked(old_dir));
1628 err = fscrypt_prepare_rename(old_dir, old_dentry, new_dir, new_dentry,
1634 return ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry);
1636 return do_rename(old_dir, old_dentry, new_dir, new_dentry, flags);