Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
568f8f5e
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
568f8f5e
编写于
5月 18, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] convert hpfs
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
cd62cdae
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
27 deletion
+29
-27
fs/hpfs/dir.c
fs/hpfs/dir.c
+29
-27
未找到文件。
fs/hpfs/dir.c
浏览文件 @
568f8f5e
...
...
@@ -57,14 +57,14 @@ static loff_t hpfs_dir_lseek(struct file *filp, loff_t off, int whence)
return
-
ESPIPE
;
}
static
int
hpfs_readdir
(
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
)
static
int
hpfs_readdir
(
struct
file
*
fil
e
,
struct
dir_context
*
ctx
)
{
struct
inode
*
inode
=
file_inode
(
fil
p
);
struct
inode
*
inode
=
file_inode
(
fil
e
);
struct
hpfs_inode_info
*
hpfs_inode
=
hpfs_i
(
inode
);
struct
quad_buffer_head
qbh
;
struct
hpfs_dirent
*
de
;
int
lc
;
lo
ng
old
_pos
;
lo
ff_t
next
_pos
;
unsigned
char
*
tempname
;
int
c1
,
c2
=
0
;
int
ret
=
0
;
...
...
@@ -105,11 +105,11 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
}
lc
=
hpfs_sb
(
inode
->
i_sb
)
->
sb_lowercase
;
if
(
filp
->
f_
pos
==
12
)
{
/* diff -r requires this (note, that diff -r */
filp
->
f_
pos
=
13
;
/* also fails on msdos filesystem in 2.0) */
if
(
ctx
->
pos
==
12
)
{
/* diff -r requires this (note, that diff -r */
ctx
->
pos
=
13
;
/* also fails on msdos filesystem in 2.0) */
goto
out
;
}
if
(
filp
->
f_
pos
==
13
)
{
if
(
ctx
->
pos
==
13
)
{
ret
=
-
ENOENT
;
goto
out
;
}
...
...
@@ -120,33 +120,34 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
accepted by filldir, but what can I do?
maybe killall -9 ls helps */
if
(
hpfs_sb
(
inode
->
i_sb
)
->
sb_chk
)
if
(
hpfs_stop_cycles
(
inode
->
i_sb
,
filp
->
f_
pos
,
&
c1
,
&
c2
,
"hpfs_readdir"
))
{
if
(
hpfs_stop_cycles
(
inode
->
i_sb
,
ctx
->
pos
,
&
c1
,
&
c2
,
"hpfs_readdir"
))
{
ret
=
-
EFSERROR
;
goto
out
;
}
if
(
filp
->
f_
pos
==
12
)
if
(
ctx
->
pos
==
12
)
goto
out
;
if
(
filp
->
f_pos
==
3
||
filp
->
f_pos
==
4
||
filp
->
f_
pos
==
5
)
{
printk
(
"HPFS: warning: pos==%d
\n
"
,(
int
)
filp
->
f_
pos
);
if
(
ctx
->
pos
==
3
||
ctx
->
pos
==
4
||
ctx
->
pos
==
5
)
{
printk
(
"HPFS: warning: pos==%d
\n
"
,(
int
)
ctx
->
pos
);
goto
out
;
}
if
(
filp
->
f_
pos
==
0
)
{
if
(
filldir
(
dirent
,
"."
,
1
,
filp
->
f_pos
,
inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
ctx
->
pos
==
0
)
{
if
(
!
dir_emit_dot
(
file
,
ctx
)
)
goto
out
;
filp
->
f_
pos
=
11
;
ctx
->
pos
=
11
;
}
if
(
filp
->
f_
pos
==
11
)
{
if
(
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
hpfs_inode
->
i_parent_dir
,
DT_DIR
)
<
0
)
if
(
ctx
->
pos
==
11
)
{
if
(
!
dir_emit
(
ctx
,
".."
,
2
,
hpfs_inode
->
i_parent_dir
,
DT_DIR
)
)
goto
out
;
filp
->
f_
pos
=
1
;
ctx
->
pos
=
1
;
}
if
(
filp
->
f_
pos
==
1
)
{
filp
->
f_
pos
=
((
loff_t
)
hpfs_de_as_down_as_possible
(
inode
->
i_sb
,
hpfs_inode
->
i_dno
)
<<
4
)
+
1
;
hpfs_add_pos
(
inode
,
&
fil
p
->
f_pos
);
fil
p
->
f_version
=
inode
->
i_version
;
if
(
ctx
->
pos
==
1
)
{
ctx
->
pos
=
((
loff_t
)
hpfs_de_as_down_as_possible
(
inode
->
i_sb
,
hpfs_inode
->
i_dno
)
<<
4
)
+
1
;
hpfs_add_pos
(
inode
,
&
fil
e
->
f_pos
);
fil
e
->
f_version
=
inode
->
i_version
;
}
old_pos
=
filp
->
f_pos
;
if
(
!
(
de
=
map_pos_dirent
(
inode
,
&
filp
->
f_pos
,
&
qbh
)))
{
next_pos
=
ctx
->
pos
;
if
(
!
(
de
=
map_pos_dirent
(
inode
,
&
next_pos
,
&
qbh
)))
{
ctx
->
pos
=
next_pos
;
ret
=
-
EIOERROR
;
goto
out
;
}
...
...
@@ -154,20 +155,21 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if
(
hpfs_sb
(
inode
->
i_sb
)
->
sb_chk
)
{
if
(
de
->
first
&&
!
de
->
last
&&
(
de
->
namelen
!=
2
||
de
->
name
[
0
]
!=
1
||
de
->
name
[
1
]
!=
1
))
hpfs_error
(
inode
->
i_sb
,
"hpfs_readdir: bad ^A^A entry; pos = %08lx"
,
old_
pos
);
hpfs_error
(
inode
->
i_sb
,
"hpfs_readdir: bad ^A^A entry; pos = %08lx"
,
(
unsigned
long
)
ctx
->
pos
);
if
(
de
->
last
&&
(
de
->
namelen
!=
1
||
de
->
name
[
0
]
!=
255
))
hpfs_error
(
inode
->
i_sb
,
"hpfs_readdir: bad
\\
377 entry; pos = %08lx"
,
old_
pos
);
hpfs_error
(
inode
->
i_sb
,
"hpfs_readdir: bad
\\
377 entry; pos = %08lx"
,
(
unsigned
long
)
ctx
->
pos
);
}
hpfs_brelse4
(
&
qbh
);
ctx
->
pos
=
next_pos
;
goto
again
;
}
tempname
=
hpfs_translate_name
(
inode
->
i_sb
,
de
->
name
,
de
->
namelen
,
lc
,
de
->
not_8x3
);
if
(
filldir
(
dirent
,
tempname
,
de
->
namelen
,
old_pos
,
le32_to_cpu
(
de
->
fnode
),
DT_UNKNOWN
)
<
0
)
{
filp
->
f_pos
=
old_pos
;
if
(
!
dir_emit
(
ctx
,
tempname
,
de
->
namelen
,
le32_to_cpu
(
de
->
fnode
),
DT_UNKNOWN
))
{
if
(
tempname
!=
de
->
name
)
kfree
(
tempname
);
hpfs_brelse4
(
&
qbh
);
goto
out
;
}
ctx
->
pos
=
next_pos
;
if
(
tempname
!=
de
->
name
)
kfree
(
tempname
);
hpfs_brelse4
(
&
qbh
);
}
...
...
@@ -322,7 +324,7 @@ const struct file_operations hpfs_dir_ops =
{
.
llseek
=
hpfs_dir_lseek
,
.
read
=
generic_read_dir
,
.
readdir
=
hpfs_readdir
,
.
iterate
=
hpfs_readdir
,
.
release
=
hpfs_dir_release
,
.
fsync
=
hpfs_file_fsync
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录