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
21ad10cf
Commit
21ad10cf
authored
Jan 09, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Add flush barriers on commit
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
bcd987fe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+3
-2
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+5
-0
fs/btrfs/super.c
fs/btrfs/super.c
+8
-1
No files found.
fs/btrfs/ctree.h
View file @
21ad10cf
...
...
@@ -440,8 +440,9 @@ struct btrfs_root {
*/
#define BTRFS_STRING_ITEM_KEY 253
#define BTRFS_MOUNT_NODATASUM 0x1
#define BTRFS_MOUNT_NODATACOW 0x2
#define BTRFS_MOUNT_NODATASUM (1 << 0)
#define BTRFS_MOUNT_NODATACOW (1 << 1)
#define BTRFS_MOUNT_NOBARRIER (1 << 2)
#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
...
...
fs/btrfs/disk-io.c
View file @
21ad10cf
...
...
@@ -762,10 +762,15 @@ int write_ctree_super(struct btrfs_trans_handle *trans, struct btrfs_root
int
ret
;
struct
extent_buffer
*
super
=
root
->
fs_info
->
sb_buffer
;
struct
inode
*
btree_inode
=
root
->
fs_info
->
btree_inode
;
struct
super_block
*
sb
=
root
->
fs_info
->
sb
;
if
(
!
btrfs_test_opt
(
root
,
NOBARRIER
))
blkdev_issue_flush
(
sb
->
s_bdev
,
NULL
);
set_extent_buffer_dirty
(
&
BTRFS_I
(
btree_inode
)
->
extent_tree
,
super
);
ret
=
sync_page_range_nolock
(
btree_inode
,
btree_inode
->
i_mapping
,
super
->
start
,
super
->
len
);
if
(
!
btrfs_test_opt
(
root
,
NOBARRIER
))
blkdev_issue_flush
(
sb
->
s_bdev
,
NULL
);
return
ret
;
}
...
...
fs/btrfs/super.c
View file @
21ad10cf
...
...
@@ -64,13 +64,14 @@ static void btrfs_put_super (struct super_block * sb)
enum
{
Opt_subvol
,
Opt_nodatasum
,
Opt_nodatacow
,
Opt_max_extent
,
Opt_alloc_start
,
Opt_err
,
Opt_alloc_start
,
Opt_
nobarrier
,
Opt_
err
,
};
static
match_table_t
tokens
=
{
{
Opt_subvol
,
"subvol=%s"
},
{
Opt_nodatasum
,
"nodatasum"
},
{
Opt_nodatacow
,
"nodatacow"
},
{
Opt_nobarrier
,
"nobarrier"
},
{
Opt_max_extent
,
"max_extent=%s"
},
{
Opt_alloc_start
,
"alloc_start=%s"
},
{
Opt_err
,
NULL
}
...
...
@@ -148,6 +149,12 @@ static int parse_options (char * options,
btrfs_set_opt
(
info
->
mount_opt
,
NODATASUM
);
}
break
;
case
Opt_nobarrier
:
if
(
info
)
{
printk
(
"btrfs: turning off barriers
\n
"
);
btrfs_set_opt
(
info
->
mount_opt
,
NOBARRIER
);
}
break
;
case
Opt_max_extent
:
if
(
info
)
{
char
*
num
=
match_strdup
(
&
args
[
0
]);
...
...
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