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
7cf75962
Commit
7cf75962
authored
Feb 26, 2007
by
Chris Mason
Committed by
David Woodhouse
Feb 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: u64 cleanups
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
c673024a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
17 deletions
+17
-17
fs/btrfs/Makefile
fs/btrfs/Makefile
+1
-1
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+2
-2
fs/btrfs/kerncompat.h
fs/btrfs/kerncompat.h
+1
-1
fs/btrfs/print-tree.c
fs/btrfs/print-tree.c
+5
-5
fs/btrfs/random-test.c
fs/btrfs/random-test.c
+8
-8
No files found.
fs/btrfs/Makefile
View file @
7cf75962
...
@@ -17,6 +17,6 @@ tester: $(objects) random-test.o
...
@@ -17,6 +17,6 @@ tester: $(objects) random-test.o
$(objects)
:
$(headers)
$(objects)
:
$(headers)
clean
:
clean
:
rm
ctree
*
.o
rm
debug-tree tester
*
.o
fs/btrfs/extent-tree.c
View file @
7cf75962
...
@@ -42,7 +42,7 @@ static int del_pending_extents(struct ctree_root *extent_root)
...
@@ -42,7 +42,7 @@ static int del_pending_extents(struct ctree_root *extent_root)
ret
=
search_slot
(
extent_root
,
&
key
,
&
path
,
0
);
ret
=
search_slot
(
extent_root
,
&
key
,
&
path
,
0
);
if
(
ret
)
{
if
(
ret
)
{
print_tree
(
extent_root
,
extent_root
->
node
);
print_tree
(
extent_root
,
extent_root
->
node
);
printf
(
"unable to find %
l
u
\n
"
,
key
.
objectid
);
printf
(
"unable to find %
L
u
\n
"
,
key
.
objectid
);
BUG
();
BUG
();
// FIXME undo it and return sane
// FIXME undo it and return sane
return
ret
;
return
ret
;
...
@@ -86,7 +86,7 @@ int free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
...
@@ -86,7 +86,7 @@ int free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
ret
=
search_slot
(
extent_root
,
&
key
,
&
path
,
0
);
ret
=
search_slot
(
extent_root
,
&
key
,
&
path
,
0
);
if
(
ret
)
{
if
(
ret
)
{
print_tree
(
extent_root
,
extent_root
->
node
);
print_tree
(
extent_root
,
extent_root
->
node
);
printf
(
"failed to find %
l
u
\n
"
,
key
.
objectid
);
printf
(
"failed to find %
L
u
\n
"
,
key
.
objectid
);
BUG
();
BUG
();
}
}
ret
=
del_item
(
extent_root
,
&
path
);
ret
=
del_item
(
extent_root
,
&
path
);
...
...
fs/btrfs/kerncompat.h
View file @
7cf75962
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define BUG() abort()
#define BUG() abort()
typedef
unsigned
int
u32
;
typedef
unsigned
int
u32
;
typedef
unsigned
long
u64
;
typedef
unsigned
long
long
u64
;
typedef
unsigned
char
u8
;
typedef
unsigned
char
u8
;
typedef
unsigned
short
u16
;
typedef
unsigned
short
u16
;
...
...
fs/btrfs/print-tree.c
View file @
7cf75962
...
@@ -11,19 +11,19 @@ void print_leaf(struct leaf *l)
...
@@ -11,19 +11,19 @@ void print_leaf(struct leaf *l)
int
nr
=
l
->
header
.
nritems
;
int
nr
=
l
->
header
.
nritems
;
struct
item
*
item
;
struct
item
*
item
;
struct
extent_item
*
ei
;
struct
extent_item
*
ei
;
printf
(
"leaf %
l
u total ptrs %d free space %d
\n
"
,
l
->
header
.
blocknr
,
nr
,
printf
(
"leaf %
L
u total ptrs %d free space %d
\n
"
,
l
->
header
.
blocknr
,
nr
,
leaf_free_space
(
l
));
leaf_free_space
(
l
));
fflush
(
stdout
);
fflush
(
stdout
);
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
item
=
l
->
items
+
i
;
item
=
l
->
items
+
i
;
printf
(
"
\t
item %d key (%
lu %u %l
u) itemoff %d itemsize %d
\n
"
,
printf
(
"
\t
item %d key (%
Lu %u %L
u) itemoff %d itemsize %d
\n
"
,
i
,
i
,
item
->
key
.
objectid
,
item
->
key
.
flags
,
item
->
key
.
offset
,
item
->
key
.
objectid
,
item
->
key
.
flags
,
item
->
key
.
offset
,
item
->
offset
,
item
->
size
);
item
->
offset
,
item
->
size
);
fflush
(
stdout
);
fflush
(
stdout
);
printf
(
"
\t\t
item data %.*s
\n
"
,
item
->
size
,
l
->
data
+
item
->
offset
);
printf
(
"
\t\t
item data %.*s
\n
"
,
item
->
size
,
l
->
data
+
item
->
offset
);
ei
=
(
struct
extent_item
*
)(
l
->
data
+
item
->
offset
);
ei
=
(
struct
extent_item
*
)(
l
->
data
+
item
->
offset
);
printf
(
"
\t\t
extent data %u %
l
u
\n
"
,
ei
->
refs
,
ei
->
owner
);
printf
(
"
\t\t
extent data %u %
L
u
\n
"
,
ei
->
refs
,
ei
->
owner
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
}
}
...
@@ -43,12 +43,12 @@ void print_tree(struct ctree_root *root, struct tree_buffer *t)
...
@@ -43,12 +43,12 @@ void print_tree(struct ctree_root *root, struct tree_buffer *t)
print_leaf
((
struct
leaf
*
)
c
);
print_leaf
((
struct
leaf
*
)
c
);
return
;
return
;
}
}
printf
(
"node %
l
u level %d total ptrs %d free spc %lu
\n
"
,
t
->
blocknr
,
printf
(
"node %
L
u level %d total ptrs %d free spc %lu
\n
"
,
t
->
blocknr
,
node_level
(
c
->
header
.
flags
),
c
->
header
.
nritems
,
node_level
(
c
->
header
.
flags
),
c
->
header
.
nritems
,
NODEPTRS_PER_BLOCK
-
c
->
header
.
nritems
);
NODEPTRS_PER_BLOCK
-
c
->
header
.
nritems
);
fflush
(
stdout
);
fflush
(
stdout
);
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
printf
(
"
\t
key %d (%
lu %u %lu) block %l
u
\n
"
,
printf
(
"
\t
key %d (%
Lu %u %Lu) block %L
u
\n
"
,
i
,
i
,
c
->
keys
[
i
].
objectid
,
c
->
keys
[
i
].
flags
,
c
->
keys
[
i
].
offset
,
c
->
keys
[
i
].
objectid
,
c
->
keys
[
i
].
flags
,
c
->
keys
[
i
].
offset
,
c
->
blockptrs
[
i
]);
c
->
blockptrs
[
i
]);
...
...
fs/btrfs/random-test.c
View file @
7cf75962
...
@@ -42,7 +42,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -42,7 +42,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
char
buf
[
128
];
char
buf
[
128
];
init_path
(
&
path
);
init_path
(
&
path
);
ret
=
setup_key
(
radix
,
&
key
,
0
);
ret
=
setup_key
(
radix
,
&
key
,
0
);
sprintf
(
buf
,
"str-%
l
u
\n
"
,
key
.
objectid
);
sprintf
(
buf
,
"str-%
L
u
\n
"
,
key
.
objectid
);
ret
=
insert_item
(
root
,
&
key
,
buf
,
strlen
(
buf
));
ret
=
insert_item
(
root
,
&
key
,
buf
,
strlen
(
buf
));
if
(
ret
)
if
(
ret
)
goto
error
;
goto
error
;
...
@@ -54,7 +54,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -54,7 +54,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
goto
error
;
goto
error
;
return
ret
;
return
ret
;
error:
error:
printf
(
"failed to insert %
l
u
\n
"
,
key
.
objectid
);
printf
(
"failed to insert %
L
u
\n
"
,
key
.
objectid
);
return
-
1
;
return
-
1
;
}
}
...
@@ -68,10 +68,10 @@ static int insert_dup(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -68,10 +68,10 @@ static int insert_dup(struct ctree_root *root, struct radix_tree_root *radix)
ret
=
setup_key
(
radix
,
&
key
,
1
);
ret
=
setup_key
(
radix
,
&
key
,
1
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
0
;
return
0
;
sprintf
(
buf
,
"str-%
l
u
\n
"
,
key
.
objectid
);
sprintf
(
buf
,
"str-%
L
u
\n
"
,
key
.
objectid
);
ret
=
insert_item
(
root
,
&
key
,
buf
,
strlen
(
buf
));
ret
=
insert_item
(
root
,
&
key
,
buf
,
strlen
(
buf
));
if
(
ret
!=
-
EEXIST
)
{
if
(
ret
!=
-
EEXIST
)
{
printf
(
"insert on %
l
u gave us %d
\n
"
,
key
.
objectid
,
ret
);
printf
(
"insert on %
L
u gave us %d
\n
"
,
key
.
objectid
,
ret
);
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
@@ -99,7 +99,7 @@ static int del_one(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -99,7 +99,7 @@ static int del_one(struct ctree_root *root, struct radix_tree_root *radix)
goto
error
;
goto
error
;
return
0
;
return
0
;
error:
error:
printf
(
"failed to delete %
l
u
\n
"
,
key
.
objectid
);
printf
(
"failed to delete %
L
u
\n
"
,
key
.
objectid
);
return
-
1
;
return
-
1
;
}
}
...
@@ -118,7 +118,7 @@ static int lookup_item(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -118,7 +118,7 @@ static int lookup_item(struct ctree_root *root, struct radix_tree_root *radix)
goto
error
;
goto
error
;
return
0
;
return
0
;
error:
error:
printf
(
"unable to find key %
l
u
\n
"
,
key
.
objectid
);
printf
(
"unable to find key %
L
u
\n
"
,
key
.
objectid
);
return
-
1
;
return
-
1
;
}
}
...
@@ -137,7 +137,7 @@ static int lookup_enoent(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -137,7 +137,7 @@ static int lookup_enoent(struct ctree_root *root, struct radix_tree_root *radix)
goto
error
;
goto
error
;
return
0
;
return
0
;
error:
error:
printf
(
"able to find key that should not exist %
l
u
\n
"
,
key
.
objectid
);
printf
(
"able to find key that should not exist %
L
u
\n
"
,
key
.
objectid
);
return
-
1
;
return
-
1
;
}
}
...
@@ -148,7 +148,7 @@ static int fill_radix(struct ctree_root *root, struct radix_tree_root *radix)
...
@@ -148,7 +148,7 @@ static int fill_radix(struct ctree_root *root, struct radix_tree_root *radix)
{
{
struct
ctree_path
path
;
struct
ctree_path
path
;
struct
key
key
;
struct
key
key
;
u
64
found
;
u
nsigned
long
found
;
int
ret
;
int
ret
;
int
slot
;
int
slot
;
int
i
;
int
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