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
4134bf81
Commit
4134bf81
authored
Jan 19, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qnx4: reduce the insane nesting in qnx4_checkroot()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1aab323e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
34 deletions
+22
-34
fs/qnx4/inode.c
fs/qnx4/inode.c
+22
-34
No files found.
fs/qnx4/inode.c
View file @
4134bf81
...
...
@@ -179,45 +179,33 @@ static const char *qnx4_checkroot(struct super_block *sb)
struct
qnx4_inode_entry
*
rootdir
;
int
rd
,
rl
;
int
i
,
j
;
int
found
=
0
;
if
(
*
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_fname
)
!=
'/'
)
{
if
(
*
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_fname
)
!=
'/'
)
return
"no qnx4 filesystem (no root dir)."
;
}
else
{
QNX4DEBUG
((
KERN_NOTICE
"QNX4 filesystem found on dev %s.
\n
"
,
sb
->
s_id
));
rd
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_blk
)
-
1
;
rl
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_size
);
for
(
j
=
0
;
j
<
rl
;
j
++
)
{
bh
=
sb_bread
(
sb
,
rd
+
j
);
/* root dir, first block */
if
(
bh
==
NULL
)
{
return
"unable to read root entry."
;
}
for
(
i
=
0
;
i
<
QNX4_INODES_PER_BLOCK
;
i
++
)
{
rootdir
=
(
struct
qnx4_inode_entry
*
)
(
bh
->
b_data
+
i
*
QNX4_DIR_ENTRY_SIZE
);
QNX4DEBUG
((
KERN_INFO
"rootdir entry found : [%s]
\n
"
,
rootdir
->
di_fname
));
if
(
!
strcmp
(
rootdir
->
di_fname
,
QNX4_BMNAME
))
{
found
=
1
;
qnx4_sb
(
sb
)
->
BitMap
=
kmemdup
(
rootdir
,
sizeof
(
struct
qnx4_inode_entry
),
GFP_KERNEL
);
if
(
!
qnx4_sb
(
sb
)
->
BitMap
)
{
brelse
(
bh
);
return
"not enough memory for bitmap inode"
;
}
/* keep bitmap inode known */
break
;
}
}
QNX4DEBUG
((
KERN_NOTICE
"QNX4 filesystem found on dev %s.
\n
"
,
sb
->
s_id
));
rd
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_blk
)
-
1
;
rl
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_size
);
for
(
j
=
0
;
j
<
rl
;
j
++
)
{
bh
=
sb_bread
(
sb
,
rd
+
j
);
/* root dir, first block */
if
(
bh
==
NULL
)
return
"unable to read root entry."
;
rootdir
=
(
struct
qnx4_inode_entry
*
)
bh
->
b_data
;
for
(
i
=
0
;
i
<
QNX4_INODES_PER_BLOCK
;
i
++
,
rootdir
++
)
{
QNX4DEBUG
((
KERN_INFO
"rootdir entry found : [%s]
\n
"
,
rootdir
->
di_fname
));
if
(
strcmp
(
rootdir
->
di_fname
,
QNX4_BMNAME
)
!=
0
)
continue
;
qnx4_sb
(
sb
)
->
BitMap
=
kmemdup
(
rootdir
,
sizeof
(
struct
qnx4_inode_entry
),
GFP_KERNEL
);
brelse
(
bh
);
if
(
found
!=
0
)
{
break
;
}
}
if
(
found
==
0
)
{
return
"bitmap file not found."
;
if
(
!
qnx4_sb
(
sb
)
->
BitMap
)
return
"not enough memory for bitmap inode"
;
/* keep bitmap inode known */
return
NULL
;
}
brelse
(
bh
);
}
return
NULL
;
return
"bitmap file not found."
;
}
static
int
qnx4_fill_super
(
struct
super_block
*
s
,
void
*
data
,
int
silent
)
...
...
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