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
e37c9e69
Commit
e37c9e69
authored
May 09, 2007
by
Chris Mason
Committed by
David Woodhouse
May 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: many allocator fixes, pretty solid
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
3e1ad54f
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
340 additions
and
59 deletions
+340
-59
fs/btrfs/TODO
fs/btrfs/TODO
+1
-0
fs/btrfs/bit-radix.c
fs/btrfs/bit-radix.c
+7
-3
fs/btrfs/bit-radix.h
fs/btrfs/bit-radix.h
+1
-1
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+3
-0
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-0
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+323
-52
fs/btrfs/super.c
fs/btrfs/super.c
+2
-2
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+2
-1
No files found.
fs/btrfs/TODO
View file @
e37c9e69
...
...
@@ -7,6 +7,7 @@
* Get rid of struct ctree_path, limiting tree levels held at one time
* Add generation number to key pointer in nodes
* Add generation number to inode
* Add ability to switch a block group from data to metadata or vice versa
* Release
* Do real tree locking
* Add extent mirroring (backup copies of blocks)
...
...
fs/btrfs/bit-radix.c
View file @
e37c9e69
...
...
@@ -77,7 +77,7 @@ int clear_radix_bit(struct radix_tree_root *radix, unsigned long bit)
}
int
find_first_radix_bit
(
struct
radix_tree_root
*
radix
,
unsigned
long
*
retbits
,
int
nr
)
unsigned
long
start
,
int
nr
)
{
unsigned
long
*
bits
;
unsigned
long
*
gang
[
4
];
...
...
@@ -85,10 +85,13 @@ int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
int
ret
;
int
i
;
int
total_found
=
0
;
unsigned
long
slot
;
ret
=
radix_tree_gang_lookup
(
radix
,
(
void
**
)
gang
,
0
,
ARRAY_SIZE
(
gang
));
slot
=
start
/
BIT_RADIX_BITS_PER_ARRAY
;
ret
=
radix_tree_gang_lookup
(
radix
,
(
void
**
)
gang
,
slot
,
ARRAY_SIZE
(
gang
));
found
=
start
%
BIT_RADIX_BITS_PER_ARRAY
;
for
(
i
=
0
;
i
<
ret
&&
nr
>
0
;
i
++
)
{
found
=
0
;
bits
=
gang
[
i
];
while
(
nr
>
0
)
{
found
=
find_next_bit
(
bits
+
1
,
...
...
@@ -104,6 +107,7 @@ int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
}
else
break
;
}
found
=
0
;
}
return
total_found
;
}
fs/btrfs/bit-radix.h
View file @
e37c9e69
...
...
@@ -6,7 +6,7 @@ int set_radix_bit(struct radix_tree_root *radix, unsigned long bit);
int
test_radix_bit
(
struct
radix_tree_root
*
radix
,
unsigned
long
bit
);
int
clear_radix_bit
(
struct
radix_tree_root
*
radix
,
unsigned
long
bit
);
int
find_first_radix_bit
(
struct
radix_tree_root
*
radix
,
unsigned
long
*
retbits
,
int
nr
);
unsigned
long
start
,
int
nr
);
static
inline
void
init_bit_radix
(
struct
radix_tree_root
*
radix
)
{
...
...
fs/btrfs/ctree.h
View file @
e37c9e69
...
...
@@ -259,7 +259,9 @@ struct btrfs_block_group_cache {
u64
first_free
;
u64
last_alloc
;
u64
pinned
;
u64
last_prealloc
;
int
data
;
int
cached
;
};
struct
crypto_hash
;
...
...
@@ -273,6 +275,7 @@ struct btrfs_fs_info {
struct
radix_tree_root
dev_radix
;
struct
radix_tree_root
block_group_radix
;
struct
radix_tree_root
block_group_data_radix
;
struct
radix_tree_root
extent_map_radix
;
u64
extent_tree_insert
[
BTRFS_MAX_LEVEL
*
3
];
int
extent_tree_insert_nr
;
...
...
fs/btrfs/disk-io.c
View file @
e37c9e69
...
...
@@ -551,6 +551,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
init_bit_radix
(
&
fs_info
->
pinned_radix
);
init_bit_radix
(
&
fs_info
->
pending_del_radix
);
init_bit_radix
(
&
fs_info
->
extent_map_radix
);
INIT_RADIX_TREE
(
&
fs_info
->
fs_roots_radix
,
GFP_NOFS
);
INIT_RADIX_TREE
(
&
fs_info
->
dev_radix
,
GFP_NOFS
);
INIT_RADIX_TREE
(
&
fs_info
->
block_group_radix
,
GFP_KERNEL
);
...
...
fs/btrfs/extent-tree.c
View file @
e37c9e69
This diff is collapsed.
Click to expand it.
fs/btrfs/super.c
View file @
e37c9e69
...
...
@@ -1539,7 +1539,7 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans,
kunmap
(
pages
[
i
]);
}
SetPageChecked
(
pages
[
i
]);
btrfs_update_inode_block_group
(
trans
,
inode
);
//
btrfs_update_inode_block_group(trans, inode);
ret
=
btrfs_end_transaction
(
trans
,
root
);
BUG_ON
(
ret
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
...
...
@@ -1914,7 +1914,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
}
BUG_ON
(
ret
);
alloc_extent_start
=
ins
.
objectid
;
btrfs_update_inode_block_group
(
trans
,
inode
);
//
btrfs_update_inode_block_group(trans, inode);
ret
=
btrfs_end_transaction
(
trans
,
root
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
...
...
fs/btrfs/transaction.c
View file @
e37c9e69
...
...
@@ -122,7 +122,8 @@ int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
}
dirty_pages
=
&
trans
->
transaction
->
dirty_pages
;
while
(
1
)
{
ret
=
find_first_radix_bit
(
dirty_pages
,
gang
,
ARRAY_SIZE
(
gang
));
ret
=
find_first_radix_bit
(
dirty_pages
,
gang
,
0
,
ARRAY_SIZE
(
gang
));
if
(
!
ret
)
break
;
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
...
...
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