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
nexedi
linux
Commits
85e55b13
Commit
85e55b13
authored
Jun 19, 2007
by
Chris Mason
Committed by
David Woodhouse
Jun 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: cache the extent tree preallocation
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
63c992fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+12
-2
No files found.
fs/btrfs/extent-tree.c
View file @
85e55b13
...
...
@@ -741,7 +741,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
BUG_ON
(
ret
);
}
extent_root
->
fs_info
->
extent_tree_insert_nr
=
0
;
extent_root
->
fs_info
->
extent_tree_prealloc_nr
=
0
;
return
0
;
}
...
...
@@ -951,6 +950,18 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
num_blocks
=
1
;
total_needed
=
(
min
(
level
+
1
,
BTRFS_MAX_LEVEL
)
+
2
)
*
3
;
}
if
(
fill_prealloc
)
{
u64
first
;
int
nr
=
info
->
extent_tree_prealloc_nr
;
first
=
info
->
extent_tree_prealloc
[
nr
-
1
];
if
(
info
->
extent_tree_prealloc_nr
>=
total_needed
&&
first
>=
search_start
)
{
ins
->
objectid
=
info
->
extent_tree_prealloc
[
0
];
ins
->
offset
=
1
;
return
0
;
}
info
->
extent_tree_prealloc_nr
=
0
;
}
if
(
search_end
==
(
u64
)
-
1
)
search_end
=
btrfs_super_total_blocks
(
info
->
disk_super
);
if
(
hint_block
)
{
...
...
@@ -1107,7 +1118,6 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
if
(
ins
->
objectid
+
num_blocks
>
first
&&
ins
->
objectid
<=
info
->
extent_tree_prealloc
[
0
])
{
search_start
=
info
->
extent_tree_prealloc
[
0
]
+
1
;
WARN_ON
(
!
full_scan
);
goto
new_group
;
}
}
...
...
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