Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
60cde612
Commit
60cde612
authored
Feb 01, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Use last_alloc optimizations for metadata, even without -o ssd
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
21a4989d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+13
-15
No files found.
fs/btrfs/extent-tree.c
View file @
60cde612
...
@@ -1431,19 +1431,19 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans,
...
@@ -1431,19 +1431,19 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans,
data
=
BTRFS_BLOCK_GROUP_MIXED
;
data
=
BTRFS_BLOCK_GROUP_MIXED
;
}
}
/* for SSD, cluster allocations together as much as possible */
if
(
!
data
)
if
(
btrfs_test_opt
(
root
,
SSD
))
{
last_ptr
=
&
root
->
fs_info
->
last_alloc
;
if
(
data
)
last_ptr
=
&
root
->
fs_info
->
last_data_alloc
;
if
(
data
&&
btrfs_test_opt
(
root
,
SSD
))
else
last_ptr
=
&
root
->
fs_info
->
last_data_alloc
;
last_ptr
=
&
root
->
fs_info
->
last_alloc
;
if
(
*
last_ptr
)
{
if
(
last_ptr
)
{
if
(
*
last_ptr
)
hint_byte
=
*
last_ptr
;
hint_byte
=
*
last_ptr
;
}
else
{
else
{
hint_byte
=
hint_byte
&
hint_byte
=
hint_byte
&
~
((
u64
)
BTRFS_BLOCK_GROUP_SIZE
-
1
);
~
((
u64
)
BTRFS_BLOCK_GROUP_SIZE
-
1
);
empty_size
+=
16
*
1024
*
1024
;
empty_size
+=
2
*
1024
*
1024
;
}
}
}
}
...
@@ -1473,9 +1473,8 @@ check_failed:
...
@@ -1473,9 +1473,8 @@ check_failed:
search_start
=
find_search_start
(
root
,
&
block_group
,
search_start
,
search_start
=
find_search_start
(
root
,
&
block_group
,
search_start
,
total_needed
,
data
);
total_needed
,
data
);
if
(
btrfs_test_opt
(
root
,
SSD
)
&&
*
last_ptr
&&
if
(
last_ptr
&&
*
last_ptr
&&
search_start
!=
*
last_ptr
)
{
search_start
!=
*
last_ptr
)
{
*
last_ptr
=
0
;
info
->
last_alloc
=
0
;
if
(
!
empty_size
)
{
if
(
!
empty_size
)
{
empty_size
+=
16
*
1024
*
1024
;
empty_size
+=
16
*
1024
*
1024
;
total_needed
+=
empty_size
;
total_needed
+=
empty_size
;
...
@@ -1612,7 +1611,7 @@ check_pending:
...
@@ -1612,7 +1611,7 @@ check_pending:
}
}
ins
->
offset
=
num_bytes
;
ins
->
offset
=
num_bytes
;
btrfs_free_path
(
path
);
btrfs_free_path
(
path
);
if
(
btrfs_test_opt
(
root
,
SSD
)
)
if
(
last_ptr
)
*
last_ptr
=
ins
->
objectid
+
ins
->
offset
;
*
last_ptr
=
ins
->
objectid
+
ins
->
offset
;
return
0
;
return
0
;
...
@@ -1827,8 +1826,7 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
...
@@ -1827,8 +1826,7 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
buf
->
start
,
buf
->
start
+
buf
->
len
-
1
,
buf
->
start
,
buf
->
start
+
buf
->
len
-
1
,
EXTENT_CSUM
,
GFP_NOFS
);
EXTENT_CSUM
,
GFP_NOFS
);
buf
->
flags
|=
EXTENT_CSUM
;
buf
->
flags
|=
EXTENT_CSUM
;
if
(
!
btrfs_test_opt
(
root
,
SSD
))
btrfs_set_buffer_defrag
(
buf
);
btrfs_set_buffer_defrag
(
buf
);
trans
->
blocks_used
++
;
trans
->
blocks_used
++
;
return
buf
;
return
buf
;
}
}
...
...
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