Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
18fc84da
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看板
提交
18fc84da
编写于
9月 27, 2016
作者:
M
Miklos Szeredi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: remove unused i_op->rename
No in-tree uses remain. Signed-off-by:
N
Miklos Szeredi
<
mszeredi@redhat.com
>
上级
1cd66c93
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
10 addition
and
31 deletion
+10
-31
Documentation/filesystems/Locking
Documentation/filesystems/Locking
+1
-5
Documentation/filesystems/directory-locking
Documentation/filesystems/directory-locking
+1
-1
Documentation/filesystems/vfs.txt
Documentation/filesystems/vfs.txt
+2
-7
fs/cachefiles/namei.c
fs/cachefiles/namei.c
+1
-2
fs/namei.c
fs/namei.c
+3
-12
include/linux/fs.h
include/linux/fs.h
+0
-2
security/tomoyo/realpath.c
security/tomoyo/realpath.c
+2
-2
未找到文件。
Documentation/filesystems/Locking
浏览文件 @
18fc84da
...
@@ -50,8 +50,6 @@ prototypes:
...
@@ -50,8 +50,6 @@ prototypes:
int (*mkdir) (struct inode *,struct dentry *,umode_t);
int (*mkdir) (struct inode *,struct dentry *,umode_t);
int (*rmdir) (struct inode *,struct dentry *);
int (*rmdir) (struct inode *,struct dentry *);
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
int (*rename) (struct inode *, struct dentry *,
struct inode *, struct dentry *);
int (*rename2) (struct inode *, struct dentry *,
int (*rename2) (struct inode *, struct dentry *,
struct inode *, struct dentry *, unsigned int);
struct inode *, struct dentry *, unsigned int);
int (*readlink) (struct dentry *, char __user *,int);
int (*readlink) (struct dentry *, char __user *,int);
...
@@ -83,7 +81,6 @@ symlink: yes
...
@@ -83,7 +81,6 @@ symlink: yes
mkdir: yes
mkdir: yes
unlink: yes (both)
unlink: yes (both)
rmdir: yes (both) (see below)
rmdir: yes (both) (see below)
rename: yes (all) (see below)
rename2: yes (all) (see below)
rename2: yes (all) (see below)
readlink: no
readlink: no
get_link: no
get_link: no
...
@@ -102,8 +99,7 @@ tmpfile: no
...
@@ -102,8 +99,7 @@ tmpfile: no
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
victim.
victim.
cross-directory ->rename() and rename2() has (per-superblock)
cross-directory ->rename2() has (per-superblock) ->s_vfs_rename_sem.
->s_vfs_rename_sem.
See Documentation/filesystems/directory-locking for more detailed discussion
See Documentation/filesystems/directory-locking for more detailed discussion
of the locking scheme for directory operations.
of the locking scheme for directory operations.
...
...
Documentation/filesystems/directory-locking
浏览文件 @
18fc84da
...
@@ -19,7 +19,7 @@ locks victim and calls the method. Locks are exclusive.
...
@@ -19,7 +19,7 @@ locks victim and calls the method. Locks are exclusive.
4) rename() that is _not_ cross-directory. Locking rules: caller locks
4) rename() that is _not_ cross-directory. Locking rules: caller locks
the parent and finds source and target. In case of exchange (with
the parent and finds source and target. In case of exchange (with
RENAME_EXCHANGE in
rename2()
flags argument) lock both. In any case,
RENAME_EXCHANGE in flags argument) lock both. In any case,
if the target already exists, lock it. If the source is a non-directory,
if the target already exists, lock it. If the source is a non-directory,
lock it. If we need to lock both, lock them in inode pointer order.
lock it. If we need to lock both, lock them in inode pointer order.
Then call the method. All locks are exclusive.
Then call the method. All locks are exclusive.
...
...
Documentation/filesystems/vfs.txt
浏览文件 @
18fc84da
...
@@ -345,8 +345,6 @@ struct inode_operations {
...
@@ -345,8 +345,6 @@ struct inode_operations {
int (*mkdir) (struct inode *,struct dentry *,umode_t);
int (*mkdir) (struct inode *,struct dentry *,umode_t);
int (*rmdir) (struct inode *,struct dentry *);
int (*rmdir) (struct inode *,struct dentry *);
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
int (*rename) (struct inode *, struct dentry *,
struct inode *, struct dentry *);
int (*rename2) (struct inode *, struct dentry *,
int (*rename2) (struct inode *, struct dentry *,
struct inode *, struct dentry *, unsigned int);
struct inode *, struct dentry *, unsigned int);
int (*readlink) (struct dentry *, char __user *,int);
int (*readlink) (struct dentry *, char __user *,int);
...
@@ -416,11 +414,8 @@ otherwise noted.
...
@@ -416,11 +414,8 @@ otherwise noted.
rename: called by the rename(2) system call to rename the object to
rename: called by the rename(2) system call to rename the object to
have the parent and name given by the second inode and dentry.
have the parent and name given by the second inode and dentry.
rename2: this has an additional flags argument compared to rename.
The filesystem must return -EINVAL for any unsupported or
If no flags are supported by the filesystem then this method
unknown flags. Currently the following flags are implemented:
need not be implemented. If some flags are supported then the
filesystem must return -EINVAL for any unsupported or unknown
flags. Currently the following flags are implemented:
(1) RENAME_NOREPLACE: this flag indicates that if the target
(1) RENAME_NOREPLACE: this flag indicates that if the target
of the rename exists the rename should fail with -EEXIST
of the rename exists the rename should fail with -EEXIST
instead of replacing the target. The VFS already checks for
instead of replacing the target. The VFS already checks for
...
...
fs/cachefiles/namei.c
浏览文件 @
18fc84da
...
@@ -804,8 +804,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
...
@@ -804,8 +804,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
!
d_backing_inode
(
subdir
)
->
i_op
->
lookup
||
!
d_backing_inode
(
subdir
)
->
i_op
->
lookup
||
!
d_backing_inode
(
subdir
)
->
i_op
->
mkdir
||
!
d_backing_inode
(
subdir
)
->
i_op
->
mkdir
||
!
d_backing_inode
(
subdir
)
->
i_op
->
create
||
!
d_backing_inode
(
subdir
)
->
i_op
->
create
||
(
!
d_backing_inode
(
subdir
)
->
i_op
->
rename
&&
!
d_backing_inode
(
subdir
)
->
i_op
->
rename2
||
!
d_backing_inode
(
subdir
)
->
i_op
->
rename2
)
||
!
d_backing_inode
(
subdir
)
->
i_op
->
rmdir
||
!
d_backing_inode
(
subdir
)
->
i_op
->
rmdir
||
!
d_backing_inode
(
subdir
)
->
i_op
->
unlink
)
!
d_backing_inode
(
subdir
)
->
i_op
->
unlink
)
goto
check_error
;
goto
check_error
;
...
...
fs/namei.c
浏览文件 @
18fc84da
...
@@ -4369,12 +4369,9 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -4369,12 +4369,9 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if
(
error
)
if
(
error
)
return
error
;
return
error
;
if
(
!
old_dir
->
i_op
->
rename
&&
!
old_dir
->
i_op
->
rename
2
)
if
(
!
old_dir
->
i_op
->
rename2
)
return
-
EPERM
;
return
-
EPERM
;
if
(
flags
&&
!
old_dir
->
i_op
->
rename2
)
return
-
EINVAL
;
/*
/*
* If we are going to change the parent - check write permissions,
* If we are going to change the parent - check write permissions,
* we'll need to flip '..'.
* we'll need to flip '..'.
...
@@ -4428,14 +4425,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -4428,14 +4425,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if
(
error
)
if
(
error
)
goto
out
;
goto
out
;
}
}
if
(
!
old_dir
->
i_op
->
rename2
)
{
error
=
old_dir
->
i_op
->
rename
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
);
}
else
{
WARN_ON
(
old_dir
->
i_op
->
rename
!=
NULL
);
error
=
old_dir
->
i_op
->
rename2
(
old_dir
,
old_dentry
,
error
=
old_dir
->
i_op
->
rename2
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
,
flags
);
new_dir
,
new_dentry
,
flags
);
}
if
(
error
)
if
(
error
)
goto
out
;
goto
out
;
...
...
include/linux/fs.h
浏览文件 @
18fc84da
...
@@ -1732,8 +1732,6 @@ struct inode_operations {
...
@@ -1732,8 +1732,6 @@ struct inode_operations {
int
(
*
mkdir
)
(
struct
inode
*
,
struct
dentry
*
,
umode_t
);
int
(
*
mkdir
)
(
struct
inode
*
,
struct
dentry
*
,
umode_t
);
int
(
*
rmdir
)
(
struct
inode
*
,
struct
dentry
*
);
int
(
*
rmdir
)
(
struct
inode
*
,
struct
dentry
*
);
int
(
*
mknod
)
(
struct
inode
*
,
struct
dentry
*
,
umode_t
,
dev_t
);
int
(
*
mknod
)
(
struct
inode
*
,
struct
dentry
*
,
umode_t
,
dev_t
);
int
(
*
rename
)
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
);
int
(
*
rename2
)
(
struct
inode
*
,
struct
dentry
*
,
int
(
*
rename2
)
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
,
unsigned
int
);
struct
inode
*
,
struct
dentry
*
,
unsigned
int
);
int
(
*
setattr
)
(
struct
dentry
*
,
struct
iattr
*
);
int
(
*
setattr
)
(
struct
dentry
*
,
struct
iattr
*
);
...
...
security/tomoyo/realpath.c
浏览文件 @
18fc84da
...
@@ -173,7 +173,7 @@ static char *tomoyo_get_local_path(struct dentry *dentry, char * const buffer,
...
@@ -173,7 +173,7 @@ static char *tomoyo_get_local_path(struct dentry *dentry, char * const buffer,
* Use filesystem name if filesystem does not support rename()
* Use filesystem name if filesystem does not support rename()
* operation.
* operation.
*/
*/
if
(
!
inode
->
i_op
->
rename
&&
!
inode
->
i_op
->
rename
2
)
if
(
!
inode
->
i_op
->
rename2
)
goto
prepend_filesystem_name
;
goto
prepend_filesystem_name
;
}
}
/* Prepend device name. */
/* Prepend device name. */
...
@@ -283,7 +283,7 @@ char *tomoyo_realpath_from_path(const struct path *path)
...
@@ -283,7 +283,7 @@ char *tomoyo_realpath_from_path(const struct path *path)
* or dentry without vfsmount.
* or dentry without vfsmount.
*/
*/
if
(
!
path
->
mnt
||
if
(
!
path
->
mnt
||
(
!
inode
->
i_op
->
rename
&&
!
inode
->
i_op
->
rename
2
))
(
!
inode
->
i_op
->
rename2
))
pos
=
tomoyo_get_local_path
(
path
->
dentry
,
buf
,
pos
=
tomoyo_get_local_path
(
path
->
dentry
,
buf
,
buf_len
-
1
);
buf_len
-
1
);
/* Get absolute name for the rest. */
/* Get absolute name for the rest. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录