Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a7400222
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看板
提交
a7400222
编写于
10月 21, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new helper: is_root_inode()
replace open-coded instances Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
ac7576f4
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
15 deletion
+13
-15
fs/coda/coda_linux.c
fs/coda/coda_linux.c
+0
-6
fs/coda/coda_linux.h
fs/coda/coda_linux.h
+0
-1
fs/coda/dir.c
fs/coda/dir.c
+6
-6
fs/ncpfs/dir.c
fs/ncpfs/dir.c
+2
-2
include/linux/fs.h
include/linux/fs.h
+5
-0
未找到文件。
fs/coda/coda_linux.c
浏览文件 @
a7400222
...
@@ -40,12 +40,6 @@ int coda_iscontrol(const char *name, size_t length)
...
@@ -40,12 +40,6 @@ int coda_iscontrol(const char *name, size_t length)
(
strncmp
(
name
,
CODA_CONTROL
,
CODA_CONTROLLEN
)
==
0
));
(
strncmp
(
name
,
CODA_CONTROL
,
CODA_CONTROLLEN
)
==
0
));
}
}
/* recognize /coda inode */
int
coda_isroot
(
struct
inode
*
i
)
{
return
(
i
->
i_sb
->
s_root
->
d_inode
==
i
);
}
unsigned
short
coda_flags_to_cflags
(
unsigned
short
flags
)
unsigned
short
coda_flags_to_cflags
(
unsigned
short
flags
)
{
{
unsigned
short
coda_flags
=
0
;
unsigned
short
coda_flags
=
0
;
...
...
fs/coda/coda_linux.h
浏览文件 @
a7400222
...
@@ -52,7 +52,6 @@ int coda_setattr(struct dentry *, struct iattr *);
...
@@ -52,7 +52,6 @@ int coda_setattr(struct dentry *, struct iattr *);
/* this file: heloers */
/* this file: heloers */
char
*
coda_f2s
(
struct
CodaFid
*
f
);
char
*
coda_f2s
(
struct
CodaFid
*
f
);
int
coda_isroot
(
struct
inode
*
i
);
int
coda_iscontrol
(
const
char
*
name
,
size_t
length
);
int
coda_iscontrol
(
const
char
*
name
,
size_t
length
);
void
coda_vattr_to_iattr
(
struct
inode
*
,
struct
coda_vattr
*
);
void
coda_vattr_to_iattr
(
struct
inode
*
,
struct
coda_vattr
*
);
...
...
fs/coda/dir.c
浏览文件 @
a7400222
...
@@ -107,7 +107,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsig
...
@@ -107,7 +107,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsig
}
}
/* control object, create inode on the fly */
/* control object, create inode on the fly */
if
(
coda_isroot
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
{
if
(
is_root_inode
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
{
inode
=
coda_cnode_makectl
(
sb
);
inode
=
coda_cnode_makectl
(
sb
);
type
=
CODA_NOCACHE
;
type
=
CODA_NOCACHE
;
}
else
{
}
else
{
...
@@ -195,7 +195,7 @@ static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, bool
...
@@ -195,7 +195,7 @@ static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, bool
struct
CodaFid
newfid
;
struct
CodaFid
newfid
;
struct
coda_vattr
attrs
;
struct
coda_vattr
attrs
;
if
(
coda_isroot
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
if
(
is_root_inode
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
return
-
EPERM
;
return
-
EPERM
;
error
=
venus_create
(
dir
->
i_sb
,
coda_i2f
(
dir
),
name
,
length
,
error
=
venus_create
(
dir
->
i_sb
,
coda_i2f
(
dir
),
name
,
length
,
...
@@ -227,7 +227,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, umode_t mode)
...
@@ -227,7 +227,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, umode_t mode)
int
error
;
int
error
;
struct
CodaFid
newfid
;
struct
CodaFid
newfid
;
if
(
coda_isroot
(
dir
)
&&
coda_iscontrol
(
name
,
len
))
if
(
is_root_inode
(
dir
)
&&
coda_iscontrol
(
name
,
len
))
return
-
EPERM
;
return
-
EPERM
;
attrs
.
va_mode
=
mode
;
attrs
.
va_mode
=
mode
;
...
@@ -261,7 +261,7 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode,
...
@@ -261,7 +261,7 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode,
int
len
=
de
->
d_name
.
len
;
int
len
=
de
->
d_name
.
len
;
int
error
;
int
error
;
if
(
coda_isroot
(
dir_inode
)
&&
coda_iscontrol
(
name
,
len
))
if
(
is_root_inode
(
dir_inode
)
&&
coda_iscontrol
(
name
,
len
))
return
-
EPERM
;
return
-
EPERM
;
error
=
venus_link
(
dir_inode
->
i_sb
,
coda_i2f
(
inode
),
error
=
venus_link
(
dir_inode
->
i_sb
,
coda_i2f
(
inode
),
...
@@ -287,7 +287,7 @@ static int coda_symlink(struct inode *dir_inode, struct dentry *de,
...
@@ -287,7 +287,7 @@ static int coda_symlink(struct inode *dir_inode, struct dentry *de,
int
symlen
;
int
symlen
;
int
error
;
int
error
;
if
(
coda_isroot
(
dir_inode
)
&&
coda_iscontrol
(
name
,
len
))
if
(
is_root_inode
(
dir_inode
)
&&
coda_iscontrol
(
name
,
len
))
return
-
EPERM
;
return
-
EPERM
;
symlen
=
strlen
(
symname
);
symlen
=
strlen
(
symname
);
...
@@ -507,7 +507,7 @@ static int coda_dentry_revalidate(struct dentry *de, unsigned int flags)
...
@@ -507,7 +507,7 @@ static int coda_dentry_revalidate(struct dentry *de, unsigned int flags)
return
-
ECHILD
;
return
-
ECHILD
;
inode
=
de
->
d_inode
;
inode
=
de
->
d_inode
;
if
(
!
inode
||
coda_isroot
(
inode
))
if
(
!
inode
||
is_root_inode
(
inode
))
goto
out
;
goto
out
;
if
(
is_bad_inode
(
inode
))
if
(
is_bad_inode
(
inode
))
goto
bad
;
goto
bad
;
...
...
fs/ncpfs/dir.c
浏览文件 @
a7400222
...
@@ -198,8 +198,8 @@ ncp_single_volume(struct ncp_server *server)
...
@@ -198,8 +198,8 @@ ncp_single_volume(struct ncp_server *server)
static
inline
int
ncp_is_server_root
(
struct
inode
*
inode
)
static
inline
int
ncp_is_server_root
(
struct
inode
*
inode
)
{
{
return
(
!
ncp_single_volume
(
NCP_SERVER
(
inode
))
&&
return
!
ncp_single_volume
(
NCP_SERVER
(
inode
))
&&
i
node
==
inode
->
i_sb
->
s_root
->
d_
inode
);
i
s_root_inode
(
inode
);
}
}
...
...
include/linux/fs.h
浏览文件 @
a7400222
...
@@ -2789,6 +2789,11 @@ static inline void inode_has_no_xattr(struct inode *inode)
...
@@ -2789,6 +2789,11 @@ static inline void inode_has_no_xattr(struct inode *inode)
inode
->
i_flags
|=
S_NOSEC
;
inode
->
i_flags
|=
S_NOSEC
;
}
}
static
inline
bool
is_root_inode
(
struct
inode
*
inode
)
{
return
inode
==
inode
->
i_sb
->
s_root
->
d_inode
;
}
static
inline
bool
dir_emit
(
struct
dir_context
*
ctx
,
static
inline
bool
dir_emit
(
struct
dir_context
*
ctx
,
const
char
*
name
,
int
namelen
,
const
char
*
name
,
int
namelen
,
u64
ino
,
unsigned
type
)
u64
ino
,
unsigned
type
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录