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
3903b38c
Commit
3903b38c
authored
May 16, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[readdir] convert romfs
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5f6039ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
fs/romfs/super.c
fs/romfs/super.c
+9
-12
No files found.
fs/romfs/super.c
View file @
3903b38c
...
...
@@ -145,19 +145,18 @@ static const struct address_space_operations romfs_aops = {
/*
* read the entries from a directory
*/
static
int
romfs_readdir
(
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
)
static
int
romfs_readdir
(
struct
file
*
fil
e
,
struct
dir_context
*
ctx
)
{
struct
inode
*
i
=
file_inode
(
fil
p
);
struct
inode
*
i
=
file_inode
(
fil
e
);
struct
romfs_inode
ri
;
unsigned
long
offset
,
maxoff
;
int
j
,
ino
,
nextfh
;
int
stored
=
0
;
char
fsname
[
ROMFS_MAXFN
];
/* XXX dynamic? */
int
ret
;
maxoff
=
romfs_maxsize
(
i
->
i_sb
);
offset
=
filp
->
f_
pos
;
offset
=
ctx
->
pos
;
if
(
!
offset
)
{
offset
=
i
->
i_ino
&
ROMFH_MASK
;
ret
=
romfs_dev_read
(
i
->
i_sb
,
offset
,
&
ri
,
ROMFH_SIZE
);
...
...
@@ -170,10 +169,10 @@ static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
for
(;;)
{
if
(
!
offset
||
offset
>=
maxoff
)
{
offset
=
maxoff
;
filp
->
f_
pos
=
offset
;
ctx
->
pos
=
offset
;
goto
out
;
}
filp
->
f_
pos
=
offset
;
ctx
->
pos
=
offset
;
/* Fetch inode info */
ret
=
romfs_dev_read
(
i
->
i_sb
,
offset
,
&
ri
,
ROMFH_SIZE
);
...
...
@@ -194,16 +193,14 @@ static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
nextfh
=
be32_to_cpu
(
ri
.
next
);
if
((
nextfh
&
ROMFH_TYPE
)
==
ROMFH_HRD
)
ino
=
be32_to_cpu
(
ri
.
spec
);
if
(
filldir
(
dirent
,
fsname
,
j
,
offset
,
ino
,
romfs_dtype_table
[
nextfh
&
ROMFH_TYPE
])
<
0
)
if
(
!
dir_emit
(
ctx
,
fsname
,
j
,
ino
,
romfs_dtype_table
[
nextfh
&
ROMFH_TYPE
]))
goto
out
;
stored
++
;
offset
=
nextfh
&
ROMFH_MASK
;
}
out:
return
stored
;
return
0
;
}
/*
...
...
@@ -281,7 +278,7 @@ static struct dentry *romfs_lookup(struct inode *dir, struct dentry *dentry,
static
const
struct
file_operations
romfs_dir_operations
=
{
.
read
=
generic_read_dir
,
.
readdir
=
romfs_readdir
,
.
iterate
=
romfs_readdir
,
.
llseek
=
default_llseek
,
};
...
...
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