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
9a6f11ed
Commit
9a6f11ed
authored
Mar 27, 2007
by
Chris Mason
Committed by
David Woodhouse
Mar 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: split out level field in struct header
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
6407bf6d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
10 deletions
+4
-10
fs/btrfs/TODO
fs/btrfs/TODO
+0
-5
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+1
-0
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+3
-5
No files found.
fs/btrfs/TODO
View file @
9a6f11ed
* cleanup, add more error checking, get rid of BUG_ONs
* Make IO functions look more like the page cache
* Fix ENOSPC handling
* make a real mkfs and superblock
* Do checksumming
* Use a real check instead of mark_buffer_dirty
* Define FS objects in terms of different item types
* Add block mapping tree (simple dm layer)
* Add simple tree locking (semaphore per tree)
* Make allocator smarter
* make level a field in header
* add a block group to struct inode
...
...
fs/btrfs/ctree.c
View file @
9a6f11ed
...
...
@@ -753,6 +753,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
split_buffer
=
btrfs_alloc_free_block
(
trans
,
root
);
split
=
btrfs_buffer_node
(
split_buffer
);
btrfs_set_header_flags
(
&
split
->
header
,
btrfs_header_flags
(
&
c
->
header
));
btrfs_set_header_level
(
&
split
->
header
,
btrfs_header_level
(
&
c
->
header
));
btrfs_set_header_blocknr
(
&
split
->
header
,
split_buffer
->
b_blocknr
);
btrfs_set_header_generation
(
&
split
->
header
,
trans
->
transid
);
btrfs_set_header_parentid
(
&
split
->
header
,
...
...
fs/btrfs/ctree.h
View file @
9a6f11ed
...
...
@@ -59,7 +59,7 @@ struct btrfs_header {
__le32
ham
;
__le16
nritems
;
__le16
flags
;
/* generation flags to be added */
u8
level
;
}
__attribute__
((
__packed__
));
#define BTRFS_MAX_LEVEL 8
...
...
@@ -648,15 +648,13 @@ static inline void btrfs_set_header_flags(struct btrfs_header *h, u16 val)
static
inline
int
btrfs_header_level
(
struct
btrfs_header
*
h
)
{
return
btrfs_header_flags
(
h
)
&
(
BTRFS_MAX_LEVEL
-
1
)
;
return
h
->
level
;
}
static
inline
void
btrfs_set_header_level
(
struct
btrfs_header
*
h
,
int
level
)
{
u16
flags
;
BUG_ON
(
level
>
BTRFS_MAX_LEVEL
);
flags
=
btrfs_header_flags
(
h
)
&
~
(
BTRFS_MAX_LEVEL
-
1
);
btrfs_set_header_flags
(
h
,
flags
|
level
);
h
->
level
=
level
;
}
static
inline
int
btrfs_is_leaf
(
struct
btrfs_node
*
n
)
...
...
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