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
2638ffba
Commit
2638ffba
authored
May 17, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[readdir] convert adfs
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
46d07338
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
fs/adfs/dir.c
fs/adfs/dir.c
+18
-24
No files found.
fs/adfs/dir.c
View file @
2638ffba
...
...
@@ -17,47 +17,43 @@
static
DEFINE_RWLOCK
(
adfs_dir_lock
);
static
int
adfs_readdir
(
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
)
adfs_readdir
(
struct
file
*
fil
e
,
struct
dir_context
*
ctx
)
{
struct
inode
*
inode
=
file_inode
(
fil
p
);
struct
inode
*
inode
=
file_inode
(
fil
e
);
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
adfs_dir_ops
*
ops
=
ADFS_SB
(
sb
)
->
s_dir
;
struct
object_info
obj
;
struct
adfs_dir
dir
;
int
ret
=
0
;
if
(
filp
->
f_
pos
>>
32
)
goto
out
;
if
(
ctx
->
pos
>>
32
)
return
0
;
ret
=
ops
->
read
(
sb
,
inode
->
i_ino
,
inode
->
i_size
,
&
dir
);
if
(
ret
)
goto
ou
t
;
return
re
t
;
switch
((
unsigned
long
)
filp
->
f_pos
)
{
case
0
:
if
(
filldir
(
dirent
,
"."
,
1
,
0
,
inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
ctx
->
pos
==
0
)
{
if
(
!
dir_emit_dot
(
file
,
ctx
))
goto
free_out
;
filp
->
f_pos
+
=
1
;
case
1
:
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
dir
.
parent_id
,
DT_DIR
)
<
0
)
ctx
->
pos
=
1
;
}
if
(
ctx
->
pos
==
1
)
{
if
(
!
dir_emit
(
ctx
,
".."
,
2
,
dir
.
parent_id
,
DT_DIR
)
)
goto
free_out
;
filp
->
f_pos
+=
1
;
default:
break
;
ctx
->
pos
=
2
;
}
read_lock
(
&
adfs_dir_lock
);
ret
=
ops
->
setpos
(
&
dir
,
filp
->
f_
pos
-
2
);
ret
=
ops
->
setpos
(
&
dir
,
ctx
->
pos
-
2
);
if
(
ret
)
goto
unlock_out
;
while
(
ops
->
getnext
(
&
dir
,
&
obj
)
==
0
)
{
if
(
filldir
(
dirent
,
obj
.
name
,
obj
.
name_len
,
filp
->
f_pos
,
obj
.
file_id
,
DT_UNKNOWN
)
<
0
)
goto
unlock_out
;
filp
->
f_pos
+=
1
;
if
(
!
dir_emit
(
ctx
,
obj
.
name
,
obj
.
name_len
,
obj
.
file_id
,
DT_UNKNOWN
)
)
break
;
ctx
->
pos
++
;
}
unlock_out:
...
...
@@ -65,8 +61,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
free_out:
ops
->
free
(
&
dir
);
out:
return
ret
;
}
...
...
@@ -192,7 +186,7 @@ adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_inf
const
struct
file_operations
adfs_dir_operations
=
{
.
read
=
generic_read_dir
,
.
llseek
=
generic_file_llseek
,
.
readdir
=
adfs_readdir
,
.
iterate
=
adfs_readdir
,
.
fsync
=
generic_file_fsync
,
};
...
...
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