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
409eb95d
Commit
409eb95d
authored
Aug 08, 2007
by
Chris Mason
Committed by
David Woodhouse
Aug 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Further reduce the concurrency penalty of defrag and drop_snapshot
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
26b8003f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+6
-7
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+3
-0
fs/btrfs/tree-defrag.c
fs/btrfs/tree-defrag.c
+2
-5
No files found.
fs/btrfs/extent-tree.c
View file @
409eb95d
...
...
@@ -1312,7 +1312,10 @@ static void reada_walk_down(struct btrfs_root *root,
BUG_ON
(
ret
);
if
(
refs
!=
1
)
continue
;
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
ret
=
readahead_tree_block
(
root
,
blocknr
);
cond_resched
();
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
if
(
ret
)
break
;
}
...
...
@@ -1445,7 +1448,6 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
struct
btrfs_path
*
path
;
int
i
;
int
orig_level
;
int
num_walks
=
0
;
struct
btrfs_root_item
*
root_item
=
&
root
->
root_item
;
path
=
btrfs_alloc_path
();
...
...
@@ -1486,12 +1488,9 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
break
;
if
(
wret
<
0
)
ret
=
wret
;
num_walks
++
;
if
(
num_walks
>
2
)
{
ret
=
-
EAGAIN
;
get_bh
(
root
->
node
);
break
;
}
ret
=
-
EAGAIN
;
get_bh
(
root
->
node
);
break
;
}
for
(
i
=
0
;
i
<=
orig_level
;
i
++
)
{
if
(
path
->
nodes
[
i
])
{
...
...
fs/btrfs/transaction.c
View file @
409eb95d
...
...
@@ -364,6 +364,9 @@ int btrfs_defrag_dirty_roots(struct btrfs_fs_info *info)
break
;
}
root
->
defrag_running
=
0
;
radix_tree_tag_clear
(
&
info
->
fs_roots_radix
,
(
unsigned
long
)
root
->
root_key
.
objectid
,
BTRFS_ROOT_DEFRAG_TAG
);
}
}
btrfs_end_transaction
(
trans
,
tree_root
);
...
...
fs/btrfs/tree-defrag.c
View file @
409eb95d
...
...
@@ -148,7 +148,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
int
level
;
int
orig_level
;
int
i
;
int
num_runs
=
0
;
if
(
root
->
ref_cows
==
0
)
{
goto
out
;
...
...
@@ -200,10 +199,8 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
break
;
if
(
wret
<
0
)
ret
=
wret
;
if
(
num_runs
++
>
8
)
{
ret
=
-
EAGAIN
;
break
;
}
ret
=
-
EAGAIN
;
break
;
}
for
(
i
=
0
;
i
<=
orig_level
;
i
++
)
{
if
(
path
->
nodes
[
i
])
{
...
...
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