Lines Matching defs:inode
123 /* Mask out flags that are inappropriate for the given type of inode. */
124 static unsigned int btrfs_mask_fsflags_for_type(struct inode *inode,
127 if (S_ISDIR(inode->i_mode))
129 else if (S_ISREG(inode->i_mode))
136 * Export internal inode flags to the format expected by the FS_IOC_GETFLAGS
171 * Update inode->i_flags based on the btrfs internal flags.
173 void btrfs_sync_inode_flags_to_i_flags(struct inode *inode)
175 struct btrfs_inode *binode = BTRFS_I(inode);
191 set_mask_bits(&inode->i_flags,
235 * Set flags/xflags from the internal inode flags. The remaining items of
249 struct inode *inode = d_inode(dentry);
250 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
251 struct btrfs_inode *binode = BTRFS_I(inode);
265 fsflags = btrfs_mask_fsflags_for_type(inode, fa->flags);
299 /* 1 item for the inode */
311 if (S_ISREG(inode->i_mode)) {
317 if (inode->i_size == 0)
327 if (S_ISREG(inode->i_mode)) {
328 if (inode->i_size == 0)
346 if (IS_SWAPFILE(inode))
360 * 1 for inode item
368 ret = btrfs_set_prop(trans, inode, "btrfs.compression", comp,
375 ret = btrfs_set_prop(trans, inode, "btrfs.compression", NULL,
385 btrfs_sync_inode_flags_to_i_flags(inode);
386 inode_inc_iversion(inode);
387 inode_set_ctime_current(inode);
388 ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
475 static int btrfs_ioctl_getversion(struct inode *inode, int __user *arg)
477 return put_user(inode->i_generation, arg);
558 * or snapshot, not including the inode, directory entries, or parent directory.
584 struct inode *dir, struct dentry *dentry,
628 new_inode_args.inode = btrfs_new_subvol_inode(idmap, dir);
629 if (!new_inode_args.inode) {
652 /* Tree log can't currently deal with an inode which is a new root. */
668 inode_item = &root_item->inode;
732 BTRFS_I(new_inode_args.inode)->root = new_root;
733 /* ... and new_root is owned by new_inode_args.inode now. */
754 d_instantiate_new(dentry, new_inode_args.inode);
755 new_inode_args.inode = NULL;
766 iput(new_inode_args.inode);
775 static int create_snapshot(struct btrfs_root *root, struct inode *dir,
780 struct inode *inode;
825 * 1 to update parent inode item
860 inode = btrfs_lookup_dentry(d_inode(dentry->d_parent), dentry);
861 if (IS_ERR(inode)) {
862 ret = PTR_ERR(inode);
866 d_instantiate(dentry, inode);
906 struct inode *dir, struct dentry *victim, int isdir)
941 struct inode *dir, struct dentry *child)
964 struct inode *dir = d_inode(parent->dentry);
1099 struct inode *inode = file_inode(file);
1100 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
1104 struct btrfs_root *root = BTRFS_I(inode)->root;
1279 struct inode *src_inode;
1299 * to the subvolume inode, otherwise the permission
1405 static noinline int btrfs_ioctl_subvol_getflags(struct inode *inode,
1408 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
1409 struct btrfs_root *root = BTRFS_I(inode)->root;
1413 if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID)
1430 struct inode *inode = file_inode(file);
1431 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
1432 struct btrfs_root *root = BTRFS_I(inode)->root;
1438 if (!inode_owner_or_capable(file_mnt_idmap(file), inode))
1445 if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) {
1673 static noinline int search_ioctl(struct inode *inode,
1678 struct btrfs_fs_info *info = btrfs_sb(inode->i_sb);
1696 /* search the root of the inode that was passed */
1697 root = btrfs_grab_root(BTRFS_I(inode)->root);
1742 static noinline int btrfs_ioctl_tree_search(struct inode *inode,
1758 ret = search_ioctl(inode, &sk, &buf_size, uargs->buf);
1772 static noinline int btrfs_ioctl_tree_search_v2(struct inode *inode,
1794 ret = search_ioctl(inode, &args.key, &buf_size,
1887 struct inode *inode,
1890 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
1891 struct super_block *sb = inode->i_sb;
1892 struct btrfs_key upper_limit = BTRFS_I(inode)->location;
1893 u64 treeid = BTRFS_I(inode)->root->root_key.objectid;
1903 struct inode *temp_inode;
1976 * btrfs_iget() needs to lookup the inode from its root
2096 * 2. Path construction will be stopped at the inode number which corresponds
2098 * exist under fd's inode, -EACCES will be returned.
2104 struct inode *inode;
2111 inode = file_inode(file);
2114 BTRFS_I(inode)->location.objectid != BTRFS_FIRST_FREE_OBJECTID) {
2123 ret = btrfs_search_path_in_tree_user(file_mnt_idmap(file), inode, args);
2133 static int btrfs_ioctl_get_subvol_info(struct inode *inode, void __user *argp)
2158 fs_info = BTRFS_I(inode)->root->fs_info;
2160 /* Get root_item of inode's subvolume */
2161 key.objectid = BTRFS_I(inode)->root->root_key.objectid;
2250 * Return ROOT_REF information of the subvolume containing this inode
2351 struct inode *dir = d_inode(parent);
2352 struct inode *inode;
2392 struct inode *old_dir;
2444 * ancestors of the inode referenced by the file
2504 inode = d_inode(dentry);
2505 dest = BTRFS_I(inode)->root;
2535 err = inode_permission(idmap, inode, MAY_WRITE | MAY_EXEC);
2545 if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) {
2550 btrfs_inode_lock(BTRFS_I(inode), 0);
2552 btrfs_inode_unlock(BTRFS_I(inode), 0);
2575 struct inode *inode = file_inode(file);
2576 struct btrfs_root *root = BTRFS_I(inode)->root;
2589 switch (inode->i_mode & S_IFMT) {
2604 inode_permission(&nop_mnt_idmap, inode, MAY_WRITE)) {
2692 struct inode *inode = file_inode(file);
2693 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
2758 struct inode *inode = file_inode(file);
2759 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
2902 struct inode *inode = file_inode(file);
2903 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
2904 struct btrfs_root *root = BTRFS_I(inode)->root;
3694 struct inode *inode = file_inode(file);
3695 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
3735 struct inode *inode = file_inode(file);
3736 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
3737 struct btrfs_root *root = BTRFS_I(inode)->root;
3788 struct inode *inode = file_inode(file);
3789 struct btrfs_root *root = BTRFS_I(inode)->root;
3843 struct inode *inode = file_inode(file);
3844 struct btrfs_root *root = BTRFS_I(inode)->root;
3891 struct inode *inode = file_inode(file);
3892 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
3955 struct inode *inode = file_inode(file);
3956 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
3957 struct btrfs_root *root = BTRFS_I(inode)->root;
3960 struct timespec64 ct = current_time(inode);
3964 if (!inode_owner_or_capable(idmap, inode))
3973 if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) {
4143 struct inode *inode = file_inode(file);
4144 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
4145 struct btrfs_root *root = BTRFS_I(inode)->root;
4286 struct inode *inode = file_inode(file);
4287 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
4288 struct btrfs_root *root = BTRFS_I(inode)->root;
4355 static int _btrfs_ioctl_send(struct inode *inode, void __user *argp, bool compat)
4386 ret = btrfs_ioctl_send(inode, arg);
4577 struct inode *inode = file_inode(file);
4578 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
4579 struct btrfs_root *root = BTRFS_I(inode)->root;
4584 return btrfs_ioctl_getversion(inode, argp);
4604 return btrfs_ioctl_subvol_getflags(inode, argp);
4626 return btrfs_ioctl_tree_search(inode, argp);
4628 return btrfs_ioctl_tree_search_v2(inode, argp);
4645 ret = btrfs_sync_fs(inode->i_sb, 1);
4677 return _btrfs_ioctl_send(inode, argp, false);
4680 return _btrfs_ioctl_send(inode, argp, true);
4707 return btrfs_ioctl_get_subvol_info(inode, argp);