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
8da81535
Commit
8da81535
authored
Jul 15, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] hfs and hfsplus switched to use of ffs(3) instead of homegrown versions
parent
42d08441
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
fs/hfs/btree.c
fs/hfs/btree.c
+2
-5
fs/hfsplus/btree.c
fs/hfsplus/btree.c
+2
-4
No files found.
fs/hfs/btree.c
View file @
8da81535
...
...
@@ -19,7 +19,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
struct
hfs_btree_header_rec
*
head
;
struct
address_space
*
mapping
;
struct
page
*
page
;
unsigned
int
s
hift
,
s
ize
;
unsigned
int
size
;
tree
=
kmalloc
(
sizeof
(
*
tree
),
GFP_KERNEL
);
if
(
!
tree
)
...
...
@@ -82,10 +82,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
goto
fail_page
;
if
(
!
tree
->
node_count
)
goto
fail_page
;
for
(
shift
=
0
;
size
>>=
1
;
shift
+=
1
)
;
tree
->
node_size_shift
=
shift
;
tree
->
node_size_shift
=
ffs
(
size
)
-
1
;
tree
->
pages_per_bnode
=
(
tree
->
node_size
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
kunmap
(
page
);
...
...
fs/hfsplus/btree.c
View file @
8da81535
...
...
@@ -22,7 +22,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
struct
hfs_btree_header_rec
*
head
;
struct
address_space
*
mapping
;
struct
page
*
page
;
unsigned
int
s
hift
,
s
ize
;
unsigned
int
size
;
tree
=
kmalloc
(
sizeof
(
*
tree
),
GFP_KERNEL
);
if
(
!
tree
)
...
...
@@ -69,9 +69,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
goto
fail_page
;
if
(
!
tree
->
node_count
)
goto
fail_page
;
for
(
shift
=
0
;
size
>>=
1
;
shift
+=
1
)
;
tree
->
node_size_shift
=
shift
;
tree
->
node_size_shift
=
ffs
(
size
)
-
1
;
tree
->
pages_per_bnode
=
(
tree
->
node_size
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
...
...
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