Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2233f31a
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2233f31a
编写于
5月 22, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] ->readdir() is gone
everything's converted to ->iterate() Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2de5f059
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
16 deletion
+13
-16
Documentation/filesystems/Locking
Documentation/filesystems/Locking
+1
-1
Documentation/filesystems/porting
Documentation/filesystems/porting
+3
-0
Documentation/filesystems/vfs.txt
Documentation/filesystems/vfs.txt
+2
-2
fs/bad_inode.c
fs/bad_inode.c
+2
-2
fs/exportfs/expfs.c
fs/exportfs/expfs.c
+1
-1
fs/readdir.c
fs/readdir.c
+4
-9
include/linux/fs.h
include/linux/fs.h
+0
-1
未找到文件。
Documentation/filesystems/Locking
浏览文件 @
2233f31a
...
@@ -414,7 +414,7 @@ prototypes:
...
@@ -414,7 +414,7 @@ prototypes:
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
int (*
readdir) (struct file *, void *, filldir_t
);
int (*
iterate) (struct file *, struct dir_context *
);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
...
...
Documentation/filesystems/porting
浏览文件 @
2233f31a
...
@@ -448,3 +448,6 @@ in your dentry operations instead.
...
@@ -448,3 +448,6 @@ in your dentry operations instead.
--
--
[mandatory]
[mandatory]
vfs_readdir() is gone; switch to iterate_dir() instead
vfs_readdir() is gone; switch to iterate_dir() instead
--
[mandatory]
->readdir() is gone now; switch to ->iterate()
Documentation/filesystems/vfs.txt
浏览文件 @
2233f31a
...
@@ -777,7 +777,7 @@ struct file_operations {
...
@@ -777,7 +777,7 @@ struct file_operations {
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
int (*
readdir) (struct file *, void *, filldir_t
);
int (*
iterate) (struct file *, struct dir_context *
);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
...
@@ -815,7 +815,7 @@ otherwise noted.
...
@@ -815,7 +815,7 @@ otherwise noted.
aio_write: called by io_submit(2) and other asynchronous I/O operations
aio_write: called by io_submit(2) and other asynchronous I/O operations
readdir
: called when the VFS needs to read the directory contents
iterate
: called when the VFS needs to read the directory contents
poll: called by the VFS when a process wants to check if there is
poll: called by the VFS when a process wants to check if there is
activity on this file and (optionally) go to sleep until there
activity on this file and (optionally) go to sleep until there
...
...
fs/bad_inode.c
浏览文件 @
2233f31a
...
@@ -45,7 +45,7 @@ static ssize_t bad_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
...
@@ -45,7 +45,7 @@ static ssize_t bad_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
-
EIO
;
return
-
EIO
;
}
}
static
int
bad_file_readdir
(
struct
file
*
fil
p
,
void
*
dirent
,
filldir_t
filldir
)
static
int
bad_file_readdir
(
struct
file
*
fil
e
,
struct
dir_context
*
ctx
)
{
{
return
-
EIO
;
return
-
EIO
;
}
}
...
@@ -152,7 +152,7 @@ static const struct file_operations bad_file_ops =
...
@@ -152,7 +152,7 @@ static const struct file_operations bad_file_ops =
.
write
=
bad_file_write
,
.
write
=
bad_file_write
,
.
aio_read
=
bad_file_aio_read
,
.
aio_read
=
bad_file_aio_read
,
.
aio_write
=
bad_file_aio_write
,
.
aio_write
=
bad_file_aio_write
,
.
readdir
=
bad_file_readdir
,
.
iterate
=
bad_file_readdir
,
.
poll
=
bad_file_poll
,
.
poll
=
bad_file_poll
,
.
unlocked_ioctl
=
bad_file_unlocked_ioctl
,
.
unlocked_ioctl
=
bad_file_unlocked_ioctl
,
.
compat_ioctl
=
bad_file_compat_ioctl
,
.
compat_ioctl
=
bad_file_compat_ioctl
,
...
...
fs/exportfs/expfs.c
浏览文件 @
2233f31a
...
@@ -272,7 +272,7 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
...
@@ -272,7 +272,7 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
goto
out
;
goto
out
;
error
=
-
EINVAL
;
error
=
-
EINVAL
;
if
(
!
file
->
f_op
->
readdir
&&
!
file
->
f_op
->
iterate
)
if
(
!
file
->
f_op
->
iterate
)
goto
out_close
;
goto
out_close
;
buffer
.
name
=
name
;
buffer
.
name
=
name
;
...
...
fs/readdir.c
浏览文件 @
2233f31a
...
@@ -24,7 +24,7 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
...
@@ -24,7 +24,7 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
{
{
struct
inode
*
inode
=
file_inode
(
file
);
struct
inode
*
inode
=
file_inode
(
file
);
int
res
=
-
ENOTDIR
;
int
res
=
-
ENOTDIR
;
if
(
!
file
->
f_op
||
(
!
file
->
f_op
->
readdir
&&
!
file
->
f_op
->
iterate
)
)
if
(
!
file
->
f_op
||
!
file
->
f_op
->
iterate
)
goto
out
;
goto
out
;
res
=
security_file_permission
(
file
,
MAY_READ
);
res
=
security_file_permission
(
file
,
MAY_READ
);
...
@@ -37,14 +37,9 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
...
@@ -37,14 +37,9 @@ int iterate_dir(struct file *file, struct dir_context *ctx)
res
=
-
ENOENT
;
res
=
-
ENOENT
;
if
(
!
IS_DEADDIR
(
inode
))
{
if
(
!
IS_DEADDIR
(
inode
))
{
if
(
file
->
f_op
->
iterate
)
{
ctx
->
pos
=
file
->
f_pos
;
ctx
->
pos
=
file
->
f_pos
;
res
=
file
->
f_op
->
iterate
(
file
,
ctx
);
res
=
file
->
f_op
->
iterate
(
file
,
ctx
);
file
->
f_pos
=
ctx
->
pos
;
file
->
f_pos
=
ctx
->
pos
;
}
else
{
res
=
file
->
f_op
->
readdir
(
file
,
ctx
,
ctx
->
actor
);
ctx
->
pos
=
file
->
f_pos
;
}
file_accessed
(
file
);
file_accessed
(
file
);
}
}
mutex_unlock
(
&
inode
->
i_mutex
);
mutex_unlock
(
&
inode
->
i_mutex
);
...
...
include/linux/fs.h
浏览文件 @
2233f31a
...
@@ -1526,7 +1526,6 @@ struct file_operations {
...
@@ -1526,7 +1526,6 @@ struct file_operations {
ssize_t
(
*
write
)
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
write
)
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
aio_read
)
(
struct
kiocb
*
,
const
struct
iovec
*
,
unsigned
long
,
loff_t
);
ssize_t
(
*
aio_read
)
(
struct
kiocb
*
,
const
struct
iovec
*
,
unsigned
long
,
loff_t
);
ssize_t
(
*
aio_write
)
(
struct
kiocb
*
,
const
struct
iovec
*
,
unsigned
long
,
loff_t
);
ssize_t
(
*
aio_write
)
(
struct
kiocb
*
,
const
struct
iovec
*
,
unsigned
long
,
loff_t
);
int
(
*
readdir
)
(
struct
file
*
,
void
*
,
filldir_t
);
int
(
*
iterate
)
(
struct
file
*
,
struct
dir_context
*
);
int
(
*
iterate
)
(
struct
file
*
,
struct
dir_context
*
);
unsigned
int
(
*
poll
)
(
struct
file
*
,
struct
poll_table_struct
*
);
unsigned
int
(
*
poll
)
(
struct
file
*
,
struct
poll_table_struct
*
);
long
(
*
unlocked_ioctl
)
(
struct
file
*
,
unsigned
int
,
unsigned
long
);
long
(
*
unlocked_ioctl
)
(
struct
file
*
,
unsigned
int
,
unsigned
long
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录