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
f0f49ef5
Commit
f0f49ef5
authored
May 22, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[readdir] convert befs
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
be4ccdcc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
fs/befs/linuxvfs.c
fs/befs/linuxvfs.c
+22
-18
No files found.
fs/befs/linuxvfs.c
View file @
f0f49ef5
...
...
@@ -31,7 +31,7 @@ MODULE_LICENSE("GPL");
/* The units the vfs expects inode->i_blocks to be in */
#define VFS_BLOCK_SIZE 512
static
int
befs_readdir
(
struct
file
*
,
void
*
,
filldir_t
);
static
int
befs_readdir
(
struct
file
*
,
struct
dir_context
*
);
static
int
befs_get_block
(
struct
inode
*
,
sector_t
,
struct
buffer_head
*
,
int
);
static
int
befs_readpage
(
struct
file
*
file
,
struct
page
*
page
);
static
sector_t
befs_bmap
(
struct
address_space
*
mapping
,
sector_t
block
);
...
...
@@ -66,7 +66,7 @@ static struct kmem_cache *befs_inode_cachep;
static
const
struct
file_operations
befs_dir_operations
=
{
.
read
=
generic_read_dir
,
.
readdir
=
befs_readdir
,
.
iterate
=
befs_readdir
,
.
llseek
=
generic_file_llseek
,
};
...
...
@@ -211,9 +211,9 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
}
static
int
befs_readdir
(
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
)
befs_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
;
befs_data_stream
*
ds
=
&
BEFS_I
(
inode
)
->
i_data
.
ds
;
befs_off_t
value
;
...
...
@@ -221,15 +221,14 @@ befs_readdir(struct file *filp, void *dirent, filldir_t filldir)
size_t
keysize
;
unsigned
char
d_type
;
char
keybuf
[
BEFS_NAME_LEN
+
1
];
char
*
nlsname
;
int
nlsnamelen
;
const
char
*
dirname
=
filp
->
f_path
.
dentry
->
d_name
.
name
;
const
char
*
dirname
=
file
->
f_path
.
dentry
->
d_name
.
name
;
befs_debug
(
sb
,
"---> befs_readdir() "
"name %s, inode %ld,
filp->f_
pos %Ld"
,
dirname
,
inode
->
i_ino
,
filp
->
f_
pos
);
"name %s, inode %ld,
ctx->
pos %Ld"
,
dirname
,
inode
->
i_ino
,
ctx
->
pos
);
result
=
befs_btree_read
(
sb
,
ds
,
filp
->
f_pos
,
BEFS_NAME_LEN
+
1
,
more:
result
=
befs_btree_read
(
sb
,
ds
,
ctx
->
pos
,
BEFS_NAME_LEN
+
1
,
keybuf
,
&
keysize
,
&
value
);
if
(
result
==
BEFS_ERR
)
{
...
...
@@ -251,24 +250,29 @@ befs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/* Convert to NLS */
if
(
BEFS_SB
(
sb
)
->
nls
)
{
char
*
nlsname
;
int
nlsnamelen
;
result
=
befs_utf2nls
(
sb
,
keybuf
,
keysize
,
&
nlsname
,
&
nlsnamelen
);
if
(
result
<
0
)
{
befs_debug
(
sb
,
"<--- befs_readdir() ERROR"
);
return
result
;
}
result
=
filldir
(
dirent
,
nlsname
,
nlsnamelen
,
filp
->
f_pos
,
(
ino_t
)
value
,
d_type
);
if
(
!
dir_emit
(
ctx
,
nlsname
,
nlsnamelen
,
(
ino_t
)
value
,
d_type
))
{
kfree
(
nlsname
);
return
0
;
}
kfree
(
nlsname
);
}
else
{
result
=
filldir
(
dirent
,
keybuf
,
keysize
,
filp
->
f_pos
,
(
ino_t
)
value
,
d_type
);
if
(
!
dir_emit
(
ctx
,
keybuf
,
keysize
,
(
ino_t
)
value
,
d_type
))
return
0
;
}
if
(
!
result
)
filp
->
f_pos
++
;
ctx
->
pos
++
;
goto
more
;
befs_debug
(
sb
,
"<--- befs_readdir()
filp->f_pos %Ld"
,
filp
->
f_
pos
);
befs_debug
(
sb
,
"<--- befs_readdir()
pos %Ld"
,
ctx
->
pos
);
return
0
;
}
...
...
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