Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
bfee7169
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看板
提交
bfee7169
编写于
5月 17, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] convert isofs
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0312fa7c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
22 deletion
+20
-22
fs/isofs/dir.c
fs/isofs/dir.c
+20
-22
未找到文件。
fs/isofs/dir.c
浏览文件 @
bfee7169
...
...
@@ -78,8 +78,8 @@ int get_acorn_filename(struct iso_directory_record *de,
/*
* This should _really_ be cleaned up some day..
*/
static
int
do_isofs_readdir
(
struct
inode
*
inode
,
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
,
static
int
do_isofs_readdir
(
struct
inode
*
inode
,
struct
file
*
fil
e
,
struct
dir_context
*
ctx
,
char
*
tmpname
,
struct
iso_directory_record
*
tmpde
)
{
unsigned
long
bufsize
=
ISOFS_BUFFER_SIZE
(
inode
);
...
...
@@ -94,10 +94,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
struct
iso_directory_record
*
de
;
struct
isofs_sb_info
*
sbi
=
ISOFS_SB
(
inode
->
i_sb
);
offset
=
filp
->
f_
pos
&
(
bufsize
-
1
);
block
=
filp
->
f_
pos
>>
bufbits
;
offset
=
ctx
->
pos
&
(
bufsize
-
1
);
block
=
ctx
->
pos
>>
bufbits
;
while
(
filp
->
f_
pos
<
inode
->
i_size
)
{
while
(
ctx
->
pos
<
inode
->
i_size
)
{
int
de_len
;
if
(
!
bh
)
{
...
...
@@ -108,7 +108,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
de
=
(
struct
iso_directory_record
*
)
(
bh
->
b_data
+
offset
);
de_len
=
*
(
unsigned
char
*
)
de
;
de_len
=
*
(
unsigned
char
*
)
de
;
/*
* If the length byte is zero, we should move on to the next
...
...
@@ -119,8 +119,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
(
de_len
==
0
)
{
brelse
(
bh
);
bh
=
NULL
;
filp
->
f_pos
=
(
filp
->
f_
pos
+
ISOFS_BLOCK_SIZE
)
&
~
(
ISOFS_BLOCK_SIZE
-
1
);
block
=
filp
->
f_
pos
>>
bufbits
;
ctx
->
pos
=
(
ctx
->
pos
+
ISOFS_BLOCK_SIZE
)
&
~
(
ISOFS_BLOCK_SIZE
-
1
);
block
=
ctx
->
pos
>>
bufbits
;
offset
=
0
;
continue
;
}
...
...
@@ -164,16 +164,16 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
0x80
)
{
first_de
=
0
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
}
first_de
=
1
;
/* Handle the case of the '.' directory */
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
0
)
{
if
(
filldir
(
dirent
,
"."
,
1
,
filp
->
f_pos
,
inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
!
dir_emit_dot
(
file
,
ctx
)
)
break
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
}
...
...
@@ -181,10 +181,9 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
/* Handle the case of the '..' directory */
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
1
)
{
inode_number
=
parent_ino
(
filp
->
f_path
.
dentry
);
if
(
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
inode_number
,
DT_DIR
)
<
0
)
if
(
!
dir_emit_dotdot
(
file
,
ctx
))
break
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
}
...
...
@@ -198,7 +197,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
((
sbi
->
s_hide
&&
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
1
))
||
(
!
sbi
->
s_showassoc
&&
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
4
)))
{
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
}
...
...
@@ -230,10 +229,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
}
}
if
(
len
>
0
)
{
if
(
filldir
(
dirent
,
p
,
len
,
filp
->
f_pos
,
inode_number
,
DT_UNKNOWN
)
<
0
)
if
(
!
dir_emit
(
ctx
,
p
,
len
,
inode_number
,
DT_UNKNOWN
)
)
break
;
}
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
}
...
...
@@ -247,13 +246,12 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
* handling split directory entries.. The real work is done by
* "do_isofs_readdir()".
*/
static
int
isofs_readdir
(
struct
file
*
filp
,
void
*
dirent
,
filldir_t
filldir
)
static
int
isofs_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
{
int
result
;
char
*
tmpname
;
struct
iso_directory_record
*
tmpde
;
struct
inode
*
inode
=
file_inode
(
fil
p
);
struct
inode
*
inode
=
file_inode
(
fil
e
);
tmpname
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
tmpname
==
NULL
)
...
...
@@ -261,7 +259,7 @@ static int isofs_readdir(struct file *filp,
tmpde
=
(
struct
iso_directory_record
*
)
(
tmpname
+
1024
);
result
=
do_isofs_readdir
(
inode
,
fil
p
,
dirent
,
filldir
,
tmpname
,
tmpde
);
result
=
do_isofs_readdir
(
inode
,
fil
e
,
ctx
,
tmpname
,
tmpde
);
free_page
((
unsigned
long
)
tmpname
);
return
result
;
...
...
@@ -271,7 +269,7 @@ const struct file_operations isofs_dir_operations =
{
.
llseek
=
generic_file_llseek
,
.
read
=
generic_read_dir
,
.
readdir
=
isofs_readdir
,
.
iterate
=
isofs_readdir
,
};
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录