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
f38b6e75
Commit
f38b6e75
authored
Mar 14, 2011
by
Li Zefan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Use bitmap_set/clear()
No functional change. Signed-off-by:
Li Zefan
<
lizf@cn.fujitsu.com
>
parent
92c42311
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.c
+8
-12
No files found.
fs/btrfs/free-space-cache.c
View file @
f38b6e75
...
@@ -1134,15 +1134,13 @@ static void bitmap_clear_bits(struct btrfs_block_group_cache *block_group,
...
@@ -1134,15 +1134,13 @@ static void bitmap_clear_bits(struct btrfs_block_group_cache *block_group,
struct
btrfs_free_space
*
info
,
u64
offset
,
struct
btrfs_free_space
*
info
,
u64
offset
,
u64
bytes
)
u64
bytes
)
{
{
unsigned
long
start
,
end
;
unsigned
long
start
,
count
;
unsigned
long
i
;
start
=
offset_to_bit
(
info
->
offset
,
block_group
->
sectorsize
,
offset
);
start
=
offset_to_bit
(
info
->
offset
,
block_group
->
sectorsize
,
offset
);
end
=
start
+
bytes_to_bits
(
bytes
,
block_group
->
sectorsize
);
count
=
bytes_to_bits
(
bytes
,
block_group
->
sectorsize
);
BUG_ON
(
end
>
BITS_PER_BITMAP
);
BUG_ON
(
start
+
count
>
BITS_PER_BITMAP
);
for
(
i
=
start
;
i
<
end
;
i
++
)
bitmap_clear
(
info
->
bitmap
,
start
,
count
);
clear_bit
(
i
,
info
->
bitmap
);
info
->
bytes
-=
bytes
;
info
->
bytes
-=
bytes
;
block_group
->
free_space
-=
bytes
;
block_group
->
free_space
-=
bytes
;
...
@@ -1152,15 +1150,13 @@ static void bitmap_set_bits(struct btrfs_block_group_cache *block_group,
...
@@ -1152,15 +1150,13 @@ static void bitmap_set_bits(struct btrfs_block_group_cache *block_group,
struct
btrfs_free_space
*
info
,
u64
offset
,
struct
btrfs_free_space
*
info
,
u64
offset
,
u64
bytes
)
u64
bytes
)
{
{
unsigned
long
start
,
end
;
unsigned
long
start
,
count
;
unsigned
long
i
;
start
=
offset_to_bit
(
info
->
offset
,
block_group
->
sectorsize
,
offset
);
start
=
offset_to_bit
(
info
->
offset
,
block_group
->
sectorsize
,
offset
);
end
=
start
+
bytes_to_bits
(
bytes
,
block_group
->
sectorsize
);
count
=
bytes_to_bits
(
bytes
,
block_group
->
sectorsize
);
BUG_ON
(
end
>
BITS_PER_BITMAP
);
BUG_ON
(
start
+
count
>
BITS_PER_BITMAP
);
for
(
i
=
start
;
i
<
end
;
i
++
)
bitmap_set
(
info
->
bitmap
,
start
,
count
);
set_bit
(
i
,
info
->
bitmap
);
info
->
bytes
+=
bytes
;
info
->
bytes
+=
bytes
;
block_group
->
free_space
+=
bytes
;
block_group
->
free_space
+=
bytes
;
...
...
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