Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0d0ca30f
Commit
0d0ca30f
authored
May 22, 2011
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: update the delayed inode code to use the btrfs_ino helper.
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
dcc6d073
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.c
+6
-5
fs/btrfs/dir-item.c
fs/btrfs/dir-item.c
+1
-1
No files found.
fs/btrfs/delayed-inode.c
View file @
0d0ca30f
...
...
@@ -88,6 +88,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
struct
btrfs_delayed_node
*
node
;
struct
btrfs_inode
*
btrfs_inode
=
BTRFS_I
(
inode
);
struct
btrfs_root
*
root
=
btrfs_inode
->
root
;
u64
ino
=
btrfs_ino
(
inode
);
int
ret
;
again:
...
...
@@ -98,7 +99,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
}
spin_lock
(
&
root
->
inode_lock
);
node
=
radix_tree_lookup
(
&
root
->
delayed_nodes_tree
,
ino
de
->
i_ino
);
node
=
radix_tree_lookup
(
&
root
->
delayed_nodes_tree
,
ino
);
if
(
node
)
{
if
(
btrfs_inode
->
delayed_node
)
{
spin_unlock
(
&
root
->
inode_lock
);
...
...
@@ -115,7 +116,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
node
=
kmem_cache_alloc
(
delayed_node_cache
,
GFP_NOFS
);
if
(
!
node
)
return
ERR_PTR
(
-
ENOMEM
);
btrfs_init_delayed_node
(
node
,
root
,
ino
de
->
i_ino
);
btrfs_init_delayed_node
(
node
,
root
,
ino
);
atomic_inc
(
&
node
->
refs
);
/* cached in the btrfs inode */
atomic_inc
(
&
node
->
refs
);
/* can be accessed */
...
...
@@ -127,7 +128,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
}
spin_lock
(
&
root
->
inode_lock
);
ret
=
radix_tree_insert
(
&
root
->
delayed_nodes_tree
,
ino
de
->
i_ino
,
node
);
ret
=
radix_tree_insert
(
&
root
->
delayed_nodes_tree
,
ino
,
node
);
if
(
ret
==
-
EEXIST
)
{
kmem_cache_free
(
delayed_node_cache
,
node
);
spin_unlock
(
&
root
->
inode_lock
);
...
...
@@ -1274,7 +1275,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
*/
BUG_ON
(
ret
);
delayed_item
->
key
.
objectid
=
dir
->
i_ino
;
delayed_item
->
key
.
objectid
=
btrfs_ino
(
dir
)
;
btrfs_set_key_type
(
&
delayed_item
->
key
,
BTRFS_DIR_INDEX_KEY
);
delayed_item
->
key
.
offset
=
index
;
...
...
@@ -1337,7 +1338,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
if
(
IS_ERR
(
node
))
return
PTR_ERR
(
node
);
item_key
.
objectid
=
dir
->
i_ino
;
item_key
.
objectid
=
btrfs_ino
(
dir
)
;
btrfs_set_key_type
(
&
item_key
,
BTRFS_DIR_INDEX_KEY
);
item_key
.
offset
=
index
;
...
...
fs/btrfs/dir-item.c
View file @
0d0ca30f
...
...
@@ -138,7 +138,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
struct
btrfs_disk_key
disk_key
;
u32
data_size
;
key
.
objectid
=
dir
->
i_ino
;
key
.
objectid
=
btrfs_ino
(
dir
)
;
btrfs_set_key_type
(
&
key
,
BTRFS_DIR_ITEM_KEY
);
key
.
offset
=
btrfs_name_hash
(
name
,
name_len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment