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
0da5468f
Commit
0da5468f
authored
Nov 07, 2007
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Use writepages for the metadata too
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
008630c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+26
-3
No files found.
fs/btrfs/disk-io.c
View file @
0da5468f
...
...
@@ -43,6 +43,8 @@ static int check_tree_block(struct btrfs_root *root, struct extent_buffer *buf)
}
#endif
static
struct
extent_map_ops
btree_extent_map_ops
;
struct
extent_buffer
*
btrfs_find_tree_block
(
struct
btrfs_root
*
root
,
u64
bytenr
,
u32
blocksize
)
{
...
...
@@ -188,15 +190,29 @@ int csum_dirty_buffer(struct btrfs_root *root, struct page *page)
return
0
;
}
static
int
btree_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
static
int
btree_writepage
_io_hook
(
struct
page
*
page
,
u64
start
,
u64
end
)
{
struct
extent_map_tree
*
tree
;
struct
btrfs_root
*
root
=
BTRFS_I
(
page
->
mapping
->
host
)
->
root
;
tree
=
&
BTRFS_I
(
page
->
mapping
->
host
)
->
extent_tree
;
csum_dirty_buffer
(
root
,
page
);
return
0
;
}
static
int
btree_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
{
struct
extent_map_tree
*
tree
;
tree
=
&
BTRFS_I
(
page
->
mapping
->
host
)
->
extent_tree
;
return
extent_write_full_page
(
tree
,
page
,
btree_get_extent
,
wbc
);
}
static
int
btree_writepages
(
struct
address_space
*
mapping
,
struct
writeback_control
*
wbc
)
{
struct
extent_map_tree
*
tree
;
tree
=
&
BTRFS_I
(
mapping
->
host
)
->
extent_tree
;
return
extent_writepages
(
tree
,
mapping
,
btree_get_extent
,
wbc
);
}
int
btree_readpage
(
struct
file
*
file
,
struct
page
*
page
)
{
struct
extent_map_tree
*
tree
;
...
...
@@ -251,6 +267,7 @@ static int btree_writepage(struct page *page, struct writeback_control *wbc)
static
struct
address_space_operations
btree_aops
=
{
.
readpage
=
btree_readpage
,
.
writepage
=
btree_writepage
,
.
writepages
=
btree_writepages
,
.
releasepage
=
btree_releasepage
,
.
invalidatepage
=
btree_invalidatepage
,
.
sync_page
=
block_sync_page
,
...
...
@@ -538,6 +555,8 @@ struct btrfs_root *open_ctree(struct super_block *sb)
extent_map_tree_init
(
&
BTRFS_I
(
fs_info
->
btree_inode
)
->
extent_tree
,
fs_info
->
btree_inode
->
i_mapping
,
GFP_NOFS
);
BTRFS_I
(
fs_info
->
btree_inode
)
->
extent_tree
.
ops
=
&
btree_extent_map_ops
;
extent_map_tree_init
(
&
fs_info
->
free_space_cache
,
fs_info
->
btree_inode
->
i_mapping
,
GFP_NOFS
);
extent_map_tree_init
(
&
fs_info
->
block_group_cache
,
...
...
@@ -832,3 +851,7 @@ int btrfs_read_buffer(struct extent_buffer *buf)
return
read_extent_buffer_pages
(
&
BTRFS_I
(
btree_inode
)
->
extent_tree
,
buf
,
0
,
1
);
}
static
struct
extent_map_ops
btree_extent_map_ops
=
{
.
writepage_io_hook
=
btree_writepage_io_hook
,
};
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