Commit 37508515 authored by David Sterba's avatar David Sterba

btrfs: simplify some assignments of inode numbers

There are several places when the btrfs inode is converted to the
generic inode, back to btrfs and then passed to btrfs_ino. We can remove
the extra back and forth conversions.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8f6c72a9
...@@ -4242,9 +4242,9 @@ static void btrfs_prune_dentries(struct btrfs_root *root) ...@@ -4242,9 +4242,9 @@ static void btrfs_prune_dentries(struct btrfs_root *root)
prev = node; prev = node;
entry = rb_entry(node, struct btrfs_inode, rb_node); entry = rb_entry(node, struct btrfs_inode, rb_node);
if (objectid < btrfs_ino(BTRFS_I(&entry->vfs_inode))) if (objectid < btrfs_ino(entry))
node = node->rb_left; node = node->rb_left;
else if (objectid > btrfs_ino(BTRFS_I(&entry->vfs_inode))) else if (objectid > btrfs_ino(entry))
node = node->rb_right; node = node->rb_right;
else else
break; break;
...@@ -4252,7 +4252,7 @@ static void btrfs_prune_dentries(struct btrfs_root *root) ...@@ -4252,7 +4252,7 @@ static void btrfs_prune_dentries(struct btrfs_root *root)
if (!node) { if (!node) {
while (prev) { while (prev) {
entry = rb_entry(prev, struct btrfs_inode, rb_node); entry = rb_entry(prev, struct btrfs_inode, rb_node);
if (objectid <= btrfs_ino(BTRFS_I(&entry->vfs_inode))) { if (objectid <= btrfs_ino(entry)) {
node = prev; node = prev;
break; break;
} }
...@@ -4261,7 +4261,7 @@ static void btrfs_prune_dentries(struct btrfs_root *root) ...@@ -4261,7 +4261,7 @@ static void btrfs_prune_dentries(struct btrfs_root *root)
} }
while (node) { while (node) {
entry = rb_entry(node, struct btrfs_inode, rb_node); entry = rb_entry(node, struct btrfs_inode, rb_node);
objectid = btrfs_ino(BTRFS_I(&entry->vfs_inode)) + 1; objectid = btrfs_ino(entry) + 1;
inode = igrab(&entry->vfs_inode); inode = igrab(&entry->vfs_inode);
if (inode) { if (inode) {
spin_unlock(&root->inode_lock); spin_unlock(&root->inode_lock);
...@@ -5614,9 +5614,9 @@ static void inode_tree_add(struct inode *inode) ...@@ -5614,9 +5614,9 @@ static void inode_tree_add(struct inode *inode)
parent = *p; parent = *p;
entry = rb_entry(parent, struct btrfs_inode, rb_node); entry = rb_entry(parent, struct btrfs_inode, rb_node);
if (ino < btrfs_ino(BTRFS_I(&entry->vfs_inode))) if (ino < btrfs_ino(entry))
p = &parent->rb_left; p = &parent->rb_left;
else if (ino > btrfs_ino(BTRFS_I(&entry->vfs_inode))) else if (ino > btrfs_ino(entry))
p = &parent->rb_right; p = &parent->rb_right;
else { else {
WARN_ON(!(entry->vfs_inode.i_state & WARN_ON(!(entry->vfs_inode.i_state &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment