Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
5f6039ce
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看板
提交
5f6039ce
编写于
5月 16, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] convert squashfs
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
01122e06
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
28 deletion
+12
-28
fs/squashfs/dir.c
fs/squashfs/dir.c
+12
-28
未找到文件。
fs/squashfs/dir.c
浏览文件 @
5f6039ce
...
...
@@ -100,7 +100,7 @@ static int get_dir_index_using_offset(struct super_block *sb,
}
static
int
squashfs_readdir
(
struct
file
*
file
,
void
*
dirent
,
filldir_t
filldir
)
static
int
squashfs_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
{
struct
inode
*
inode
=
file_inode
(
file
);
struct
squashfs_sb_info
*
msblk
=
inode
->
i_sb
->
s_fs_info
;
...
...
@@ -127,11 +127,11 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
* It also means that the external f_pos is offset by 3 from the
* on-disk directory f_pos.
*/
while
(
file
->
f_
pos
<
3
)
{
while
(
ctx
->
pos
<
3
)
{
char
*
name
;
int
i_ino
;
if
(
file
->
f_
pos
==
0
)
{
if
(
ctx
->
pos
==
0
)
{
name
=
"."
;
size
=
1
;
i_ino
=
inode
->
i_ino
;
...
...
@@ -141,24 +141,18 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
i_ino
=
squashfs_i
(
inode
)
->
parent
;
}
TRACE
(
"Calling filldir(%p, %s, %d, %lld, %d, %d)
\n
"
,
dirent
,
name
,
size
,
file
->
f_pos
,
i_ino
,
squashfs_filetype_table
[
1
]);
if
(
filldir
(
dirent
,
name
,
size
,
file
->
f_pos
,
i_ino
,
squashfs_filetype_table
[
1
])
<
0
)
{
TRACE
(
"Filldir returned less than 0
\n
"
);
if
(
!
dir_emit
(
ctx
,
name
,
size
,
i_ino
,
squashfs_filetype_table
[
1
]))
goto
finish
;
}
file
->
f_
pos
+=
size
;
ctx
->
pos
+=
size
;
}
length
=
get_dir_index_using_offset
(
inode
->
i_sb
,
&
block
,
&
offset
,
squashfs_i
(
inode
)
->
dir_idx_start
,
squashfs_i
(
inode
)
->
dir_idx_offset
,
squashfs_i
(
inode
)
->
dir_idx_cnt
,
file
->
f_
pos
);
ctx
->
pos
);
while
(
length
<
i_size_read
(
inode
))
{
/*
...
...
@@ -198,7 +192,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
length
+=
sizeof
(
*
dire
)
+
size
;
if
(
file
->
f_
pos
>=
length
)
if
(
ctx
->
pos
>=
length
)
continue
;
dire
->
name
[
size
]
=
'\0'
;
...
...
@@ -206,22 +200,12 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
((
short
)
le16_to_cpu
(
dire
->
inode_number
));
type
=
le16_to_cpu
(
dire
->
type
);
TRACE
(
"Calling filldir(%p, %s, %d, %lld, %x:%x, %d, %d)"
"
\n
"
,
dirent
,
dire
->
name
,
size
,
file
->
f_pos
,
le32_to_cpu
(
dirh
.
start_block
),
le16_to_cpu
(
dire
->
offset
),
inode_number
,
squashfs_filetype_table
[
type
]);
if
(
filldir
(
dirent
,
dire
->
name
,
size
,
file
->
f_pos
,
if
(
!
dir_emit
(
ctx
,
dire
->
name
,
size
,
inode_number
,
squashfs_filetype_table
[
type
])
<
0
)
{
TRACE
(
"Filldir returned less than 0
\n
"
);
squashfs_filetype_table
[
type
]))
goto
finish
;
}
file
->
f_
pos
=
length
;
ctx
->
pos
=
length
;
}
}
...
...
@@ -238,6 +222,6 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
const
struct
file_operations
squashfs_dir_ops
=
{
.
read
=
generic_read_dir
,
.
readdir
=
squashfs_readdir
,
.
iterate
=
squashfs_readdir
,
.
llseek
=
default_llseek
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录