Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ac6614b7
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ac6614b7
编写于
5月 22, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] constify ->actor
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2233f31a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
57 addition
and
68 deletion
+57
-68
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/osf_sys.c
+6
-7
arch/parisc/hpux/fs.c
arch/parisc/hpux/fs.c
+5
-7
fs/compat.c
fs/compat.c
+14
-19
fs/exportfs/expfs.c
fs/exportfs/expfs.c
+5
-5
fs/gfs2/export.c
fs/gfs2/export.c
+4
-4
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4recover.c
+4
-3
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+4
-3
fs/readdir.c
fs/readdir.c
+14
-19
include/linux/fs.h
include/linux/fs.h
+1
-1
未找到文件。
arch/alpha/kernel/osf_sys.c
浏览文件 @
ac6614b7
...
...
@@ -147,17 +147,16 @@ SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd,
{
int
error
;
struct
fd
arg
=
fdget
(
fd
);
struct
osf_dirent_callback
buf
;
struct
osf_dirent_callback
buf
=
{
.
ctx
.
actor
=
osf_filldir
,
.
dirent
=
dirent
,
.
basep
=
basep
,
.
count
=
count
};
if
(
!
arg
.
file
)
return
-
EBADF
;
buf
.
dirent
=
dirent
;
buf
.
basep
=
basep
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
osf_filldir
;
error
=
iterate_dir
(
arg
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
arch/parisc/hpux/fs.c
浏览文件 @
ac6614b7
...
...
@@ -111,19 +111,17 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i
{
struct
fd
arg
;
struct
hpux_dirent
__user
*
lastdirent
;
struct
getdents_callback
buf
;
struct
getdents_callback
buf
=
{
.
ctx
.
actor
=
filldir
,
.
current_dir
=
dirent
,
.
count
=
count
};
int
error
;
arg
=
fdget
(
fd
);
if
(
!
arg
.
file
)
return
-
EBADF
;
buf
.
current_dir
=
dirent
;
buf
.
previous
=
NULL
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
filldir
;
error
=
iterate_dir
(
arg
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
fs/compat.c
浏览文件 @
ac6614b7
...
...
@@ -874,15 +874,14 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
{
int
error
;
struct
fd
f
=
fdget
(
fd
);
struct
compat_readdir_callback
buf
;
struct
compat_readdir_callback
buf
=
{
.
ctx
.
actor
=
compat_fillonedir
,
.
dirent
=
dirent
};
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
result
=
0
;
buf
.
dirent
=
dirent
;
buf
.
ctx
.
actor
=
compat_fillonedir
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
buf
.
result
)
error
=
buf
.
result
;
...
...
@@ -954,7 +953,11 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
{
struct
fd
f
;
struct
compat_linux_dirent
__user
*
lastdirent
;
struct
compat_getdents_callback
buf
;
struct
compat_getdents_callback
buf
=
{
.
ctx
.
actor
=
compat_filldir
,
.
current_dir
=
dirent
,
.
count
=
count
};
int
error
;
if
(
!
access_ok
(
VERIFY_WRITE
,
dirent
,
count
))
...
...
@@ -964,12 +967,6 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
current_dir
=
dirent
;
buf
.
previous
=
NULL
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
compat_filldir
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
@@ -1041,7 +1038,11 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
{
struct
fd
f
;
struct
linux_dirent64
__user
*
lastdirent
;
struct
compat_getdents_callback64
buf
;
struct
compat_getdents_callback64
buf
=
{
.
ctx
.
actor
=
compat_filldir64
,
.
current_dir
=
dirent
,
.
count
=
count
};
int
error
;
if
(
!
access_ok
(
VERIFY_WRITE
,
dirent
,
count
))
...
...
@@ -1051,12 +1052,6 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
current_dir
=
dirent
;
buf
.
previous
=
NULL
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
compat_filldir64
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
fs/exportfs/expfs.c
浏览文件 @
ac6614b7
...
...
@@ -255,7 +255,11 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
struct
inode
*
dir
=
path
->
dentry
->
d_inode
;
int
error
;
struct
file
*
file
;
struct
getdents_callback
buffer
;
struct
getdents_callback
buffer
=
{
.
ctx
.
actor
=
filldir_one
,
.
name
=
name
,
.
ino
=
child
->
d_inode
->
i_ino
};
error
=
-
ENOTDIR
;
if
(
!
dir
||
!
S_ISDIR
(
dir
->
i_mode
))
...
...
@@ -275,11 +279,7 @@ static int get_name(const struct path *path, char *name, struct dentry *child)
if
(
!
file
->
f_op
->
iterate
)
goto
out_close
;
buffer
.
name
=
name
;
buffer
.
ino
=
child
->
d_inode
->
i_ino
;
buffer
.
found
=
0
;
buffer
.
sequence
=
0
;
buffer
.
ctx
.
actor
=
filldir_one
;
while
(
1
)
{
int
old_seq
=
buffer
.
sequence
;
...
...
fs/gfs2/export.c
浏览文件 @
ac6614b7
...
...
@@ -89,7 +89,10 @@ static int gfs2_get_name(struct dentry *parent, char *name,
struct
inode
*
dir
=
parent
->
d_inode
;
struct
inode
*
inode
=
child
->
d_inode
;
struct
gfs2_inode
*
dip
,
*
ip
;
struct
get_name_filldir
gnfd
;
struct
get_name_filldir
gnfd
=
{
.
ctx
.
actor
=
get_name_filldir
,
.
name
=
name
};
struct
gfs2_holder
gh
;
int
error
;
struct
file_ra_state
f_ra
=
{
.
start
=
0
};
...
...
@@ -106,9 +109,6 @@ static int gfs2_get_name(struct dentry *parent, char *name,
*
name
=
0
;
gnfd
.
inum
.
no_addr
=
ip
->
i_no_addr
;
gnfd
.
inum
.
no_formal_ino
=
ip
->
i_no_formal_ino
;
gnfd
.
name
=
name
;
gnfd
.
ctx
.
actor
=
get_name_filldir
;
gnfd
.
ctx
.
pos
=
0
;
error
=
gfs2_glock_nq_init
(
dip
->
i_gl
,
LM_ST_SHARED
,
0
,
&
gh
);
if
(
error
)
...
...
fs/nfsd/nfs4recover.c
浏览文件 @
ac6614b7
...
...
@@ -268,7 +268,10 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn)
{
const
struct
cred
*
original_cred
;
struct
dentry
*
dir
=
nn
->
rec_file
->
f_path
.
dentry
;
struct
nfs4_dir_ctx
ctx
;
struct
nfs4_dir_ctx
ctx
=
{
.
ctx
.
actor
=
nfsd4_build_namelist
,
.
names
=
LIST_HEAD_INIT
(
ctx
.
names
)
};
int
status
;
status
=
nfs4_save_creds
(
&
original_cred
);
...
...
@@ -281,8 +284,6 @@ nfsd4_list_rec_dir(recdir_func *f, struct nfsd_net *nn)
return
status
;
}
INIT_LIST_HEAD
(
&
ctx
.
names
);
ctx
.
ctx
.
actor
=
nfsd4_build_namelist
;
status
=
iterate_dir
(
nn
->
rec_file
,
&
ctx
.
ctx
);
mutex_lock_nested
(
&
dir
->
d_inode
->
i_mutex
,
I_MUTEX_PARENT
);
while
(
!
list_empty
(
&
ctx
.
names
))
{
...
...
fs/nfsd/vfs.c
浏览文件 @
ac6614b7
...
...
@@ -1944,14 +1944,15 @@ static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen,
static
__be32
nfsd_buffered_readdir
(
struct
file
*
file
,
filldir_t
func
,
struct
readdir_cd
*
cdp
,
loff_t
*
offsetp
)
{
struct
readdir_data
buf
;
struct
buffered_dirent
*
de
;
int
host_err
;
int
size
;
loff_t
offset
;
struct
readdir_data
buf
=
{
.
ctx
.
actor
=
nfsd_buffered_filldir
,
.
dirent
=
(
void
*
)
__get_free_page
(
GFP_KERNEL
)
};
buf
.
ctx
.
actor
=
nfsd_buffered_filldir
;
buf
.
dirent
=
(
void
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
!
buf
.
dirent
)
return
nfserrno
(
-
ENOMEM
);
...
...
fs/readdir.c
浏览文件 @
ac6614b7
...
...
@@ -109,15 +109,14 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
{
int
error
;
struct
fd
f
=
fdget
(
fd
);
struct
readdir_callback
buf
;
struct
readdir_callback
buf
=
{
.
ctx
.
actor
=
fillonedir
,
.
dirent
=
dirent
};
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
ctx
.
actor
=
fillonedir
;
buf
.
result
=
0
;
buf
.
dirent
=
dirent
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
buf
.
result
)
error
=
buf
.
result
;
...
...
@@ -195,7 +194,11 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
{
struct
fd
f
;
struct
linux_dirent
__user
*
lastdirent
;
struct
getdents_callback
buf
;
struct
getdents_callback
buf
=
{
.
ctx
.
actor
=
filldir
,
.
count
=
count
,
.
current_dir
=
dirent
};
int
error
;
if
(
!
access_ok
(
VERIFY_WRITE
,
dirent
,
count
))
...
...
@@ -205,12 +208,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
current_dir
=
dirent
;
buf
.
previous
=
NULL
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
filldir
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
@@ -277,7 +274,11 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
{
struct
fd
f
;
struct
linux_dirent64
__user
*
lastdirent
;
struct
getdents_callback64
buf
;
struct
getdents_callback64
buf
=
{
.
ctx
.
actor
=
filldir64
,
.
count
=
count
,
.
current_dir
=
dirent
};
int
error
;
if
(
!
access_ok
(
VERIFY_WRITE
,
dirent
,
count
))
...
...
@@ -287,12 +288,6 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd,
if
(
!
f
.
file
)
return
-
EBADF
;
buf
.
current_dir
=
dirent
;
buf
.
previous
=
NULL
;
buf
.
count
=
count
;
buf
.
error
=
0
;
buf
.
ctx
.
actor
=
filldir64
;
error
=
iterate_dir
(
f
.
file
,
&
buf
.
ctx
);
if
(
error
>=
0
)
error
=
buf
.
error
;
...
...
include/linux/fs.h
浏览文件 @
ac6614b7
...
...
@@ -1507,7 +1507,7 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
*/
typedef
int
(
*
filldir_t
)(
void
*
,
const
char
*
,
int
,
loff_t
,
u64
,
unsigned
);
struct
dir_context
{
filldir_t
actor
;
const
filldir_t
actor
;
loff_t
pos
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录