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
725c8463
Commit
725c8463
authored
Jan 04, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: resizer: don't hold the fs_mutex for long periods of time
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
1372f8e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+21
-1
No files found.
fs/btrfs/extent-tree.c
View file @
725c8463
...
@@ -2331,6 +2331,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
...
@@ -2331,6 +2331,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
struct
extent_buffer
*
leaf
;
struct
extent_buffer
*
leaf
;
u32
nritems
;
u32
nritems
;
int
ret
;
int
ret
;
int
progress
=
0
;
btrfs_set_super_total_bytes
(
&
info
->
super_copy
,
new_size
);
btrfs_set_super_total_bytes
(
&
info
->
super_copy
,
new_size
);
block_group_cache
=
&
info
->
block_group_cache
;
block_group_cache
=
&
info
->
block_group_cache
;
...
@@ -2383,6 +2384,19 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
...
@@ -2383,6 +2384,19 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
}
}
btrfs_item_key_to_cpu
(
leaf
,
&
found_key
,
path
->
slots
[
0
]);
btrfs_item_key_to_cpu
(
leaf
,
&
found_key
,
path
->
slots
[
0
]);
if
(
progress
&&
need_resched
())
{
memcpy
(
&
key
,
&
found_key
,
sizeof
(
key
));
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
cond_resched
();
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
btrfs_release_path
(
root
,
path
);
btrfs_search_slot
(
NULL
,
root
,
&
key
,
path
,
0
,
0
);
progress
=
0
;
goto
next
;
}
progress
=
1
;
if
(
btrfs_key_type
(
&
found_key
)
!=
BTRFS_EXTENT_ITEM_KEY
||
if
(
btrfs_key_type
(
&
found_key
)
!=
BTRFS_EXTENT_ITEM_KEY
||
found_key
.
objectid
+
found_key
.
offset
<=
cur_byte
)
{
found_key
.
objectid
+
found_key
.
offset
<=
cur_byte
)
{
path
->
slots
[
0
]
++
;
path
->
slots
[
0
]
++
;
...
@@ -2442,7 +2456,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
...
@@ -2442,7 +2456,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
*/
*/
memcpy
(
&
key
,
&
found_key
,
sizeof
(
key
));
memcpy
(
&
key
,
&
found_key
,
sizeof
(
key
));
btrfs_release_path
(
root
,
path
);
btrfs_release_path
(
root
,
path
);
continue
;
goto
resched_check
;
}
}
btrfs_item_key_to_cpu
(
leaf
,
&
found_key
,
path
->
slots
[
0
]);
btrfs_item_key_to_cpu
(
leaf
,
&
found_key
,
path
->
slots
[
0
]);
...
@@ -2465,6 +2479,12 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
...
@@ -2465,6 +2479,12 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
key
.
objectid
=
found_key
.
objectid
+
1
;
key
.
objectid
=
found_key
.
objectid
+
1
;
btrfs_del_item
(
trans
,
root
,
path
);
btrfs_del_item
(
trans
,
root
,
path
);
btrfs_release_path
(
root
,
path
);
btrfs_release_path
(
root
,
path
);
resched_check:
if
(
need_resched
())
{
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
cond_resched
();
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
}
}
}
clear_extent_dirty
(
&
info
->
free_space_cache
,
new_size
,
(
u64
)
-
1
,
clear_extent_dirty
(
&
info
->
free_space_cache
,
new_size
,
(
u64
)
-
1
,
GFP_NOFS
);
GFP_NOFS
);
...
...
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