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
ff7db6e0
Commit
ff7db6e0
authored
Feb 26, 2016
by
David Sterba
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'foreign/zhaolei/reada' into for-chris-4.6
parents
23c1a966
7aff8cf4
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
137 deletions
+141
-137
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+5
-2
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+12
-11
fs/btrfs/reada.c
fs/btrfs/reada.c
+124
-124
No files found.
fs/btrfs/ctree.h
View file @
ff7db6e0
...
@@ -1825,6 +1825,9 @@ struct btrfs_fs_info {
...
@@ -1825,6 +1825,9 @@ struct btrfs_fs_info {
spinlock_t
reada_lock
;
spinlock_t
reada_lock
;
struct
radix_tree_root
reada_tree
;
struct
radix_tree_root
reada_tree
;
/* readahead works cnt */
atomic_t
reada_works_cnt
;
/* Extent buffer radix tree */
/* Extent buffer radix tree */
spinlock_t
buffer_lock
;
spinlock_t
buffer_lock
;
struct
radix_tree_root
buffer_radix
;
struct
radix_tree_root
buffer_radix
;
...
@@ -4563,8 +4566,8 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root,
...
@@ -4563,8 +4566,8 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root,
struct
btrfs_key
*
start
,
struct
btrfs_key
*
end
);
struct
btrfs_key
*
start
,
struct
btrfs_key
*
end
);
int
btrfs_reada_wait
(
void
*
handle
);
int
btrfs_reada_wait
(
void
*
handle
);
void
btrfs_reada_detach
(
void
*
handle
);
void
btrfs_reada_detach
(
void
*
handle
);
int
btree_readahead_hook
(
struct
btrfs_
root
*
root
,
struct
extent_buffer
*
eb
,
int
btree_readahead_hook
(
struct
btrfs_
fs_info
*
fs_info
,
u64
start
,
int
err
);
struct
extent_buffer
*
eb
,
u64
start
,
int
err
);
static
inline
int
is_fstree
(
u64
rootid
)
static
inline
int
is_fstree
(
u64
rootid
)
{
{
...
...
fs/btrfs/disk-io.c
View file @
ff7db6e0
...
@@ -612,6 +612,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
...
@@ -612,6 +612,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
int
found_level
;
int
found_level
;
struct
extent_buffer
*
eb
;
struct
extent_buffer
*
eb
;
struct
btrfs_root
*
root
=
BTRFS_I
(
page
->
mapping
->
host
)
->
root
;
struct
btrfs_root
*
root
=
BTRFS_I
(
page
->
mapping
->
host
)
->
root
;
struct
btrfs_fs_info
*
fs_info
=
root
->
fs_info
;
int
ret
=
0
;
int
ret
=
0
;
int
reads_done
;
int
reads_done
;
...
@@ -637,20 +638,20 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
...
@@ -637,20 +638,20 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
found_start
=
btrfs_header_bytenr
(
eb
);
found_start
=
btrfs_header_bytenr
(
eb
);
if
(
found_start
!=
eb
->
start
)
{
if
(
found_start
!=
eb
->
start
)
{
btrfs_err_rl
(
eb
->
fs_info
,
"bad tree block start %llu %llu"
,
btrfs_err_rl
(
fs_info
,
"bad tree block start %llu %llu"
,
found_start
,
eb
->
start
);
found_start
,
eb
->
start
);
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
err
;
goto
err
;
}
}
if
(
check_tree_block_fsid
(
root
->
fs_info
,
eb
))
{
if
(
check_tree_block_fsid
(
fs_info
,
eb
))
{
btrfs_err_rl
(
eb
->
fs_info
,
"bad fsid on block %llu"
,
btrfs_err_rl
(
fs_info
,
"bad fsid on block %llu"
,
eb
->
start
);
eb
->
start
);
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
err
;
goto
err
;
}
}
found_level
=
btrfs_header_level
(
eb
);
found_level
=
btrfs_header_level
(
eb
);
if
(
found_level
>=
BTRFS_MAX_LEVEL
)
{
if
(
found_level
>=
BTRFS_MAX_LEVEL
)
{
btrfs_err
(
root
->
fs_info
,
"bad tree block level %d"
,
btrfs_err
(
fs_info
,
"bad tree block level %d"
,
(
int
)
btrfs_header_level
(
eb
));
(
int
)
btrfs_header_level
(
eb
));
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
err
;
goto
err
;
...
@@ -659,7 +660,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
...
@@ -659,7 +660,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
btrfs_set_buffer_lockdep_class
(
btrfs_header_owner
(
eb
),
btrfs_set_buffer_lockdep_class
(
btrfs_header_owner
(
eb
),
eb
,
found_level
);
eb
,
found_level
);
ret
=
csum_tree_block
(
root
->
fs_info
,
eb
,
1
);
ret
=
csum_tree_block
(
fs_info
,
eb
,
1
);
if
(
ret
)
{
if
(
ret
)
{
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
err
;
goto
err
;
...
@@ -680,7 +681,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
...
@@ -680,7 +681,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
err:
err:
if
(
reads_done
&&
if
(
reads_done
&&
test_and_clear_bit
(
EXTENT_BUFFER_READAHEAD
,
&
eb
->
bflags
))
test_and_clear_bit
(
EXTENT_BUFFER_READAHEAD
,
&
eb
->
bflags
))
btree_readahead_hook
(
root
,
eb
,
eb
->
start
,
ret
);
btree_readahead_hook
(
fs_info
,
eb
,
eb
->
start
,
ret
);
if
(
ret
)
{
if
(
ret
)
{
/*
/*
...
@@ -699,14 +700,13 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
...
@@ -699,14 +700,13 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
static
int
btree_io_failed_hook
(
struct
page
*
page
,
int
failed_mirror
)
static
int
btree_io_failed_hook
(
struct
page
*
page
,
int
failed_mirror
)
{
{
struct
extent_buffer
*
eb
;
struct
extent_buffer
*
eb
;
struct
btrfs_root
*
root
=
BTRFS_I
(
page
->
mapping
->
host
)
->
root
;
eb
=
(
struct
extent_buffer
*
)
page
->
private
;
eb
=
(
struct
extent_buffer
*
)
page
->
private
;
set_bit
(
EXTENT_BUFFER_READ_ERR
,
&
eb
->
bflags
);
set_bit
(
EXTENT_BUFFER_READ_ERR
,
&
eb
->
bflags
);
eb
->
read_mirror
=
failed_mirror
;
eb
->
read_mirror
=
failed_mirror
;
atomic_dec
(
&
eb
->
io_pages
);
atomic_dec
(
&
eb
->
io_pages
);
if
(
test_and_clear_bit
(
EXTENT_BUFFER_READAHEAD
,
&
eb
->
bflags
))
if
(
test_and_clear_bit
(
EXTENT_BUFFER_READAHEAD
,
&
eb
->
bflags
))
btree_readahead_hook
(
root
,
eb
,
eb
->
start
,
-
EIO
);
btree_readahead_hook
(
eb
->
fs_info
,
eb
,
eb
->
start
,
-
EIO
);
return
-
EIO
;
/* we fixed nothing */
return
-
EIO
;
/* we fixed nothing */
}
}
...
@@ -2604,6 +2604,7 @@ int open_ctree(struct super_block *sb,
...
@@ -2604,6 +2604,7 @@ int open_ctree(struct super_block *sb,
atomic_set
(
&
fs_info
->
nr_async_bios
,
0
);
atomic_set
(
&
fs_info
->
nr_async_bios
,
0
);
atomic_set
(
&
fs_info
->
defrag_running
,
0
);
atomic_set
(
&
fs_info
->
defrag_running
,
0
);
atomic_set
(
&
fs_info
->
qgroup_op_seq
,
0
);
atomic_set
(
&
fs_info
->
qgroup_op_seq
,
0
);
atomic_set
(
&
fs_info
->
reada_works_cnt
,
0
);
atomic64_set
(
&
fs_info
->
tree_mod_seq
,
0
);
atomic64_set
(
&
fs_info
->
tree_mod_seq
,
0
);
fs_info
->
sb
=
sb
;
fs_info
->
sb
=
sb
;
fs_info
->
max_inline
=
BTRFS_DEFAULT_MAX_INLINE
;
fs_info
->
max_inline
=
BTRFS_DEFAULT_MAX_INLINE
;
...
...
fs/btrfs/reada.c
View file @
ff7db6e0
This diff is collapsed.
Click to expand it.
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