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
nexedi
linux
Commits
d18a2c44
Commit
d18a2c44
authored
Apr 04, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Fix allocation profile init
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
6bc34676
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
21 deletions
+13
-21
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+7
-6
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+4
-7
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+2
-8
No files found.
fs/btrfs/ctree.h
View file @
d18a2c44
...
...
@@ -506,12 +506,13 @@ struct btrfs_fs_info {
u64
delalloc_bytes
;
u64
last_alloc
;
u64
last_data_alloc
;
int
avail_data_alloc_bits
;
int
avail_metadata_alloc_bits
;
int
avail_system_alloc_bits
;
int
data_alloc_profile
;
int
metadata_alloc_profile
;
int
system_alloc_profile
;
u64
avail_data_alloc_bits
;
u64
avail_metadata_alloc_bits
;
u64
avail_system_alloc_bits
;
u64
data_alloc_profile
;
u64
metadata_alloc_profile
;
u64
system_alloc_profile
;
};
/*
...
...
fs/btrfs/disk-io.c
View file @
d18a2c44
...
...
@@ -912,13 +912,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
btrfs_read_block_groups
(
extent_root
);
fs_info
->
generation
=
btrfs_super_generation
(
disk_super
)
+
1
;
if
(
btrfs_super_num_devices
(
disk_super
)
>
0
)
{
fs_info
->
data_alloc_profile
=
BTRFS_BLOCK_GROUP_RAID0
|
BTRFS_BLOCK_GROUP_RAID1
;
fs_info
->
metadata_alloc_profile
=
BTRFS_BLOCK_GROUP_RAID1
|
BTRFS_BLOCK_GROUP_DUP
;
fs_info
->
system_alloc_profile
=
fs_info
->
metadata_alloc_profile
;
}
fs_info
->
data_alloc_profile
=
(
u64
)
-
1
;
fs_info
->
metadata_alloc_profile
=
(
u64
)
-
1
;
fs_info
->
system_alloc_profile
=
fs_info
->
metadata_alloc_profile
;
mutex_unlock
(
&
fs_info
->
fs_mutex
);
return
tree_root
;
...
...
fs/btrfs/extent-tree.c
View file @
d18a2c44
...
...
@@ -1100,7 +1100,6 @@ printk("space info full %Lu\n", flags);
start
,
num_bytes
);
BUG_ON
(
ret
);
set_avail_alloc_bits
(
extent_root
->
fs_info
,
flags
);
return
0
;
}
...
...
@@ -2813,13 +2812,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
&
cache
->
space_info
);
BUG_ON
(
ret
);
if
(
type
&
BTRFS_BLOCK_GROUP_DATA
)
{
bit
=
BLOCK_GROUP_DATA
;
}
else
if
(
type
&
BTRFS_BLOCK_GROUP_SYSTEM
)
{
bit
=
BLOCK_GROUP_SYSTEM
;
}
else
if
(
type
&
BTRFS_BLOCK_GROUP_METADATA
)
{
bit
=
BLOCK_GROUP_METADATA
;
}
bit
=
block_group_state_bits
(
type
);
set_extent_bits
(
block_group_cache
,
chunk_objectid
,
chunk_objectid
+
size
-
1
,
bit
|
EXTENT_LOCKED
,
GFP_NOFS
);
...
...
@@ -2833,5 +2826,6 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
finish_current_insert
(
trans
,
extent_root
);
ret
=
del_pending_extents
(
trans
,
extent_root
);
BUG_ON
(
ret
);
set_avail_alloc_bits
(
extent_root
->
fs_info
,
type
);
return
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