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
c62a1920
Commit
c62a1920
authored
Apr 24, 2007
by
Chris Mason
Committed by
David Woodhouse
Apr 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: get rid of the extent_item type field
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
b5133862
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
21 deletions
+3
-21
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-15
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+1
-4
fs/btrfs/super.c
fs/btrfs/super.c
+1
-2
No files found.
fs/btrfs/ctree.h
View file @
c62a1920
...
@@ -152,9 +152,6 @@ struct btrfs_path {
...
@@ -152,9 +152,6 @@ struct btrfs_path {
int
slots
[
BTRFS_MAX_LEVEL
];
int
slots
[
BTRFS_MAX_LEVEL
];
};
};
/* values for the type field in btrfs_extent_item */
#define BTRFS_EXTENT_TREE 1
#define BTRFS_EXTENT_FILE 2
/*
/*
* items in the extent btree are used to record the objectid of the
* items in the extent btree are used to record the objectid of the
* owner of the block and the number of references
* owner of the block and the number of references
...
@@ -162,7 +159,6 @@ struct btrfs_path {
...
@@ -162,7 +159,6 @@ struct btrfs_path {
struct
btrfs_extent_item
{
struct
btrfs_extent_item
{
__le32
refs
;
__le32
refs
;
__le64
owner
;
__le64
owner
;
u8
type
;
}
__attribute__
((
__packed__
));
}
__attribute__
((
__packed__
));
struct
btrfs_inode_timespec
{
struct
btrfs_inode_timespec
{
...
@@ -489,16 +485,6 @@ static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
...
@@ -489,16 +485,6 @@ static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
ei
->
owner
=
cpu_to_le64
(
val
);
ei
->
owner
=
cpu_to_le64
(
val
);
}
}
static
inline
u8
btrfs_extent_type
(
struct
btrfs_extent_item
*
ei
)
{
return
ei
->
type
;
}
static
inline
void
btrfs_set_extent_type
(
struct
btrfs_extent_item
*
ei
,
u8
val
)
{
ei
->
type
=
val
;
}
static
inline
u64
btrfs_node_blockptr
(
struct
btrfs_node
*
n
,
int
nr
)
static
inline
u64
btrfs_node_blockptr
(
struct
btrfs_node
*
n
,
int
nr
)
{
{
return
le64_to_cpu
(
n
->
ptrs
[
nr
].
blockptr
);
return
le64_to_cpu
(
n
->
ptrs
[
nr
].
blockptr
);
...
@@ -1036,7 +1022,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
...
@@ -1036,7 +1022,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
struct
btrfs_root
*
root
);
struct
btrfs_root
*
root
);
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
u64
owner
,
struct
btrfs_root
*
root
,
u64
owner
,
u
8
type
,
u
64
num_blocks
,
u64
search_start
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
struct
btrfs_key
*
ins
);
u64
search_end
,
struct
btrfs_key
*
ins
);
int
btrfs_inc_ref
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
int
btrfs_inc_ref
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
struct
buffer_head
*
buf
);
struct
buffer_head
*
buf
);
...
...
fs/btrfs/extent-tree.c
View file @
c62a1920
...
@@ -167,7 +167,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
...
@@ -167,7 +167,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
ins
.
offset
=
1
;
ins
.
offset
=
1
;
ins
.
flags
=
0
;
ins
.
flags
=
0
;
btrfs_set_key_type
(
&
ins
,
BTRFS_EXTENT_ITEM_KEY
);
btrfs_set_key_type
(
&
ins
,
BTRFS_EXTENT_ITEM_KEY
);
btrfs_set_extent_type
(
&
extent_item
,
BTRFS_EXTENT_TREE
);
btrfs_set_extent_owner
(
&
extent_item
,
extent_root
->
root_key
.
objectid
);
btrfs_set_extent_owner
(
&
extent_item
,
extent_root
->
root_key
.
objectid
);
for
(
i
=
0
;
i
<
extent_root
->
fs_info
->
current_insert
.
flags
;
i
++
)
{
for
(
i
=
0
;
i
<
extent_root
->
fs_info
->
current_insert
.
flags
;
i
++
)
{
...
@@ -464,7 +463,7 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
...
@@ -464,7 +463,7 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
*/
*/
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
u64
owner
,
struct
btrfs_root
*
root
,
u64
owner
,
u
8
type
,
u
64
num_blocks
,
u64
search_start
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
struct
btrfs_key
*
ins
)
u64
search_end
,
struct
btrfs_key
*
ins
)
{
{
int
ret
;
int
ret
;
...
@@ -476,7 +475,6 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
...
@@ -476,7 +475,6 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
btrfs_set_extent_refs
(
&
extent_item
,
1
);
btrfs_set_extent_refs
(
&
extent_item
,
1
);
btrfs_set_extent_owner
(
&
extent_item
,
owner
);
btrfs_set_extent_owner
(
&
extent_item
,
owner
);
btrfs_set_extent_type
(
&
extent_item
,
type
);
if
(
root
==
extent_root
)
{
if
(
root
==
extent_root
)
{
BUG_ON
(
extent_root
->
fs_info
->
current_insert
.
offset
==
0
);
BUG_ON
(
extent_root
->
fs_info
->
current_insert
.
offset
==
0
);
...
@@ -520,7 +518,6 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
...
@@ -520,7 +518,6 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
struct
buffer_head
*
buf
;
struct
buffer_head
*
buf
;
ret
=
btrfs_alloc_extent
(
trans
,
root
,
root
->
root_key
.
objectid
,
ret
=
btrfs_alloc_extent
(
trans
,
root
,
root
->
root_key
.
objectid
,
BTRFS_EXTENT_TREE
,
1
,
0
,
(
unsigned
long
)
-
1
,
&
ins
);
1
,
0
,
(
unsigned
long
)
-
1
,
&
ins
);
if
(
ret
)
{
if
(
ret
)
{
BUG
();
BUG
();
...
...
fs/btrfs/super.c
View file @
c62a1920
...
@@ -1830,8 +1830,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
...
@@ -1830,8 +1830,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
if
(
inode
->
i_size
>=
PAGE_CACHE_SIZE
||
pos
+
count
<
inode
->
i_size
||
if
(
inode
->
i_size
>=
PAGE_CACHE_SIZE
||
pos
+
count
<
inode
->
i_size
||
pos
+
count
-
start_pos
>
BTRFS_MAX_INLINE_DATA_SIZE
(
root
))
{
pos
+
count
-
start_pos
>
BTRFS_MAX_INLINE_DATA_SIZE
(
root
))
{
ret
=
btrfs_alloc_extent
(
trans
,
root
,
inode
->
i_ino
,
ret
=
btrfs_alloc_extent
(
trans
,
root
,
inode
->
i_ino
,
BTRFS_EXTENT_FILE
,
num_blocks
,
1
,
num_blocks
,
1
,
(
u64
)
-
1
,
&
ins
);
(
u64
)
-
1
,
&
ins
);
BUG_ON
(
ret
);
BUG_ON
(
ret
);
ret
=
btrfs_insert_file_extent
(
trans
,
root
,
inode
->
i_ino
,
ret
=
btrfs_insert_file_extent
(
trans
,
root
,
inode
->
i_ino
,
start_pos
,
ins
.
objectid
,
ins
.
offset
);
start_pos
,
ins
.
objectid
,
ins
.
offset
);
...
...
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