Lines Matching defs:dir
58 #include "dir-item.h"
584 struct inode *dir, struct dentry *dentry,
587 struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
593 struct btrfs_root *root = BTRFS_I(dir)->root;
596 struct timespec64 cur_time = current_time(dir);
598 .dir = dir,
628 new_inode_args.inode = btrfs_new_subvol_inode(idmap, dir);
775 static int create_snapshot(struct btrfs_root *root, struct inode *dir,
779 struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
823 * 1 to add dir item
824 * 1 to add dir index
828 ret = btrfs_subvolume_reserve_metadata(BTRFS_I(dir)->root,
837 pending_snapshot->dir = dir;
886 * Check whether we can remove a link victim from directory dir, check
888 * 1. We can't do it if dir is read-only (done in permission())
889 * 2. We should have write and exec permissions on dir
890 * 3. We can't remove anything from append-only dir
891 * 4. We can't do anything with immutable dir (done in permission())
892 * 5. If the sticky bit on dir is set we should either
893 * a. be owner of dir, or
906 struct inode *dir, struct dentry *victim, int isdir)
913 BUG_ON(d_inode(victim->d_parent) != dir);
914 audit_inode_child(dir, victim, AUDIT_TYPE_CHILD_DELETE);
916 error = inode_permission(idmap, dir, MAY_WRITE | MAY_EXEC);
919 if (IS_APPEND(dir))
921 if (check_sticky(idmap, dir, d_inode(victim)) ||
932 if (IS_DEADDIR(dir))
941 struct inode *dir, struct dentry *child)
945 if (IS_DEADDIR(dir))
947 if (!fsuidgid_has_mapping(dir->i_sb, idmap))
949 return inode_permission(idmap, dir, MAY_WRITE | MAY_EXEC);
964 struct inode *dir = d_inode(parent->dentry);
965 struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
970 error = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
979 error = btrfs_may_create(idmap, dir, dentry);
987 error = btrfs_check_dir_item_collision(BTRFS_I(dir)->root,
988 dir->i_ino, &name_str);
994 if (btrfs_root_refs(&BTRFS_I(dir)->root->root_item) == 0)
998 error = create_snapshot(snap_src, dir, dentry, readonly, inherit);
1000 error = create_subvol(idmap, dir, dentry, inherit);
1003 fsnotify_mkdir(dir, dentry);
1009 btrfs_inode_unlock(BTRFS_I(dir), 0);
2351 struct inode *dir = d_inode(parent);
2353 struct btrfs_root *root = BTRFS_I(dir)->root;
2430 old_dir = dir;
2431 dir = d_inode(parent);
2450 if (old_dir != dir && idmap != &nop_mnt_idmap) {
2485 if (!S_ISDIR(dir->i_mode)) {
2490 err = down_write_killable_nested(&dir->i_rwsem, I_MUTEX_PARENT);
2525 * Do not allow deletion if the parent dir is the same
2526 * as the dir to be deleted. That means the ioctl
2541 err = btrfs_may_delete(idmap, dir, dentry, 1);
2551 err = btrfs_delete_subvolume(BTRFS_I(dir), dentry);
2554 d_delete_notify(dir, dentry);
2559 btrfs_inode_unlock(BTRFS_I(dir), 0);