aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-05-21 09:27:38 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-21 09:27:38 -0400
commit0965537308ac3b267ea16e731bd73870a51c53b8 (patch)
tree7b52288b7272b2391f736dd82a313cbbaad68570 /fs/btrfs/ioctl.c
parent61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff)
parent82d5902d9c681be37ffa9d70482907f9f0b7ec1f (diff)
Merge branch 'ino-alloc' of git://repo.or.cz/linux-btrfs-devel into inode_numbers
Conflicts: fs/btrfs/free-space-cache.c Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2616f7ed4799..bc5c2b01bf33 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -50,6 +50,7 @@
50#include "print-tree.h" 50#include "print-tree.h"
51#include "volumes.h" 51#include "volumes.h"
52#include "locking.h" 52#include "locking.h"
53#include "inode-map.h"
53 54
54/* Mask out flags that are inappropriate for the given type of inode. */ 55/* Mask out flags that are inappropriate for the given type of inode. */
55static inline __u32 btrfs_mask_flags(umode_t mode, __u32 flags) 56static inline __u32 btrfs_mask_flags(umode_t mode, __u32 flags)
@@ -329,8 +330,7 @@ static noinline int create_subvol(struct btrfs_root *root,
329 u64 new_dirid = BTRFS_FIRST_FREE_OBJECTID; 330 u64 new_dirid = BTRFS_FIRST_FREE_OBJECTID;
330 u64 index = 0; 331 u64 index = 0;
331 332
332 ret = btrfs_find_free_objectid(NULL, root->fs_info->tree_root, 333 ret = btrfs_find_free_objectid(root->fs_info->tree_root, &objectid);
333 0, &objectid);
334 if (ret) { 334 if (ret) {
335 dput(parent); 335 dput(parent);
336 return ret; 336 return ret;
@@ -422,7 +422,7 @@ static noinline int create_subvol(struct btrfs_root *root,
422 BUG_ON(ret); 422 BUG_ON(ret);
423 423
424 ret = btrfs_insert_dir_item(trans, root, 424 ret = btrfs_insert_dir_item(trans, root,
425 name, namelen, dir->i_ino, &key, 425 name, namelen, btrfs_ino(dir), &key,
426 BTRFS_FT_DIR, index); 426 BTRFS_FT_DIR, index);
427 if (ret) 427 if (ret)
428 goto fail; 428 goto fail;
@@ -433,7 +433,7 @@ static noinline int create_subvol(struct btrfs_root *root,
433 433
434 ret = btrfs_add_root_ref(trans, root->fs_info->tree_root, 434 ret = btrfs_add_root_ref(trans, root->fs_info->tree_root,
435 objectid, root->root_key.objectid, 435 objectid, root->root_key.objectid,
436 dir->i_ino, index, name, namelen); 436 btrfs_ino(dir), index, name, namelen);
437 437
438 BUG_ON(ret); 438 BUG_ON(ret);
439 439
@@ -1129,7 +1129,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1129 int ret = 0; 1129 int ret = 0;
1130 u64 flags = 0; 1130 u64 flags = 0;
1131 1131
1132 if (inode->i_ino != BTRFS_FIRST_FREE_OBJECTID) 1132 if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID)
1133 return -EINVAL; 1133 return -EINVAL;
1134 1134
1135 down_read(&root->fs_info->subvol_sem); 1135 down_read(&root->fs_info->subvol_sem);
@@ -1156,7 +1156,7 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
1156 if (root->fs_info->sb->s_flags & MS_RDONLY) 1156 if (root->fs_info->sb->s_flags & MS_RDONLY)
1157 return -EROFS; 1157 return -EROFS;
1158 1158
1159 if (inode->i_ino != BTRFS_FIRST_FREE_OBJECTID) 1159 if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID)
1160 return -EINVAL; 1160 return -EINVAL;
1161 1161
1162 if (copy_from_user(&flags, arg, sizeof(flags))) 1162 if (copy_from_user(&flags, arg, sizeof(flags)))
@@ -1639,7 +1639,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
1639 goto out_dput; 1639 goto out_dput;
1640 } 1640 }
1641 1641
1642 if (inode->i_ino != BTRFS_FIRST_FREE_OBJECTID) { 1642 if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID) {
1643 err = -EINVAL; 1643 err = -EINVAL;
1644 goto out_dput; 1644 goto out_dput;
1645 } 1645 }
@@ -1925,7 +1925,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1925 } 1925 }
1926 1926
1927 /* clone data */ 1927 /* clone data */
1928 key.objectid = src->i_ino; 1928 key.objectid = btrfs_ino(src);
1929 key.type = BTRFS_EXTENT_DATA_KEY; 1929 key.type = BTRFS_EXTENT_DATA_KEY;
1930 key.offset = 0; 1930 key.offset = 0;
1931 1931
@@ -1952,7 +1952,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1952 1952
1953 btrfs_item_key_to_cpu(leaf, &key, slot); 1953 btrfs_item_key_to_cpu(leaf, &key, slot);
1954 if (btrfs_key_type(&key) > BTRFS_EXTENT_DATA_KEY || 1954 if (btrfs_key_type(&key) > BTRFS_EXTENT_DATA_KEY ||
1955 key.objectid != src->i_ino) 1955 key.objectid != btrfs_ino(src))
1956 break; 1956 break;
1957 1957
1958 if (btrfs_key_type(&key) == BTRFS_EXTENT_DATA_KEY) { 1958 if (btrfs_key_type(&key) == BTRFS_EXTENT_DATA_KEY) {
@@ -1995,7 +1995,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1995 goto next; 1995 goto next;
1996 1996
1997 memcpy(&new_key, &key, sizeof(new_key)); 1997 memcpy(&new_key, &key, sizeof(new_key));
1998 new_key.objectid = inode->i_ino; 1998 new_key.objectid = btrfs_ino(inode);
1999 if (off <= key.offset) 1999 if (off <= key.offset)
2000 new_key.offset = key.offset + destoff - off; 2000 new_key.offset = key.offset + destoff - off;
2001 else 2001 else
@@ -2049,7 +2049,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2049 ret = btrfs_inc_extent_ref(trans, root, 2049 ret = btrfs_inc_extent_ref(trans, root,
2050 disko, diskl, 0, 2050 disko, diskl, 0,
2051 root->root_key.objectid, 2051 root->root_key.objectid,
2052 inode->i_ino, 2052 btrfs_ino(inode),
2053 new_key.offset - datao); 2053 new_key.offset - datao);
2054 BUG_ON(ret); 2054 BUG_ON(ret);
2055 } 2055 }