Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
290c263b
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看板
提交
290c263b
编写于
6月 08, 2009
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch jffs2 to inode->i_acl
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
05fc0790
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
48 deletion
+19
-48
fs/jffs2/acl.c
fs/jffs2/acl.c
+19
-35
fs/jffs2/acl.h
fs/jffs2/acl.h
+0
-4
fs/jffs2/jffs2_fs_i.h
fs/jffs2/jffs2_fs_i.h
+0
-4
fs/jffs2/os-linux.h
fs/jffs2/os-linux.h
+0
-4
fs/jffs2/readinode.c
fs/jffs2/readinode.c
+0
-1
未找到文件。
fs/jffs2/acl.c
浏览文件 @
290c263b
...
...
@@ -158,10 +158,10 @@ static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size)
static
struct
posix_acl
*
jffs2_iget_acl
(
struct
inode
*
inode
,
struct
posix_acl
**
i_acl
)
{
struct
posix_acl
*
acl
=
JFFS2_
ACL_NOT_CACHED
;
struct
posix_acl
*
acl
=
ACL_NOT_CACHED
;
spin_lock
(
&
inode
->
i_lock
);
if
(
*
i_acl
!=
JFFS2_
ACL_NOT_CACHED
)
if
(
*
i_acl
!=
ACL_NOT_CACHED
)
acl
=
posix_acl_dup
(
*
i_acl
);
spin_unlock
(
&
inode
->
i_lock
);
return
acl
;
...
...
@@ -170,7 +170,7 @@ static struct posix_acl *jffs2_iget_acl(struct inode *inode, struct posix_acl **
static
void
jffs2_iset_acl
(
struct
inode
*
inode
,
struct
posix_acl
**
i_acl
,
struct
posix_acl
*
acl
)
{
spin_lock
(
&
inode
->
i_lock
);
if
(
*
i_acl
!=
JFFS2_
ACL_NOT_CACHED
)
if
(
*
i_acl
!=
ACL_NOT_CACHED
)
posix_acl_release
(
*
i_acl
);
*
i_acl
=
posix_acl_dup
(
acl
);
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -178,21 +178,20 @@ static void jffs2_iset_acl(struct inode *inode, struct posix_acl **i_acl, struct
static
struct
posix_acl
*
jffs2_get_acl
(
struct
inode
*
inode
,
int
type
)
{
struct
jffs2_inode_info
*
f
=
JFFS2_INODE_INFO
(
inode
);
struct
posix_acl
*
acl
;
char
*
value
=
NULL
;
int
rc
,
xprefix
;
switch
(
type
)
{
case
ACL_TYPE_ACCESS
:
acl
=
jffs2_iget_acl
(
inode
,
&
f
->
i_acl_access
);
if
(
acl
!=
JFFS2_
ACL_NOT_CACHED
)
acl
=
jffs2_iget_acl
(
inode
,
&
inode
->
i_acl
);
if
(
acl
!=
ACL_NOT_CACHED
)
return
acl
;
xprefix
=
JFFS2_XPREFIX_ACL_ACCESS
;
break
;
case
ACL_TYPE_DEFAULT
:
acl
=
jffs2_iget_acl
(
inode
,
&
f
->
i_acl_default
);
if
(
acl
!=
JFFS2_
ACL_NOT_CACHED
)
acl
=
jffs2_iget_acl
(
inode
,
&
inode
->
i_default_acl
);
if
(
acl
!=
ACL_NOT_CACHED
)
return
acl
;
xprefix
=
JFFS2_XPREFIX_ACL_DEFAULT
;
break
;
...
...
@@ -218,10 +217,10 @@ static struct posix_acl *jffs2_get_acl(struct inode *inode, int type)
if
(
!
IS_ERR
(
acl
))
{
switch
(
type
)
{
case
ACL_TYPE_ACCESS
:
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_access
,
acl
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_acl
,
acl
);
break
;
case
ACL_TYPE_DEFAULT
:
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_default
,
acl
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_default_acl
,
acl
);
break
;
}
}
...
...
@@ -249,7 +248,6 @@ static int __jffs2_set_acl(struct inode *inode, int xprefix, struct posix_acl *a
static
int
jffs2_set_acl
(
struct
inode
*
inode
,
int
type
,
struct
posix_acl
*
acl
)
{
struct
jffs2_inode_info
*
f
=
JFFS2_INODE_INFO
(
inode
);
int
rc
,
xprefix
;
if
(
S_ISLNK
(
inode
->
i_mode
))
...
...
@@ -288,10 +286,10 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
if
(
!
rc
)
{
switch
(
type
)
{
case
ACL_TYPE_ACCESS
:
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_access
,
acl
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_acl
,
acl
);
break
;
case
ACL_TYPE_DEFAULT
:
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_default
,
acl
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_default_acl
,
acl
);
break
;
}
}
...
...
@@ -321,12 +319,11 @@ int jffs2_permission(struct inode *inode, int mask)
int
jffs2_init_acl_pre
(
struct
inode
*
dir_i
,
struct
inode
*
inode
,
int
*
i_mode
)
{
struct
jffs2_inode_info
*
f
=
JFFS2_INODE_INFO
(
inode
);
struct
posix_acl
*
acl
,
*
clone
;
int
rc
;
f
->
i_acl_default
=
NULL
;
f
->
i_acl_access
=
NULL
;
inode
->
i_default_acl
=
NULL
;
inode
->
i_acl
=
NULL
;
if
(
S_ISLNK
(
*
i_mode
))
return
0
;
/* Symlink always has no-ACL */
...
...
@@ -339,7 +336,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
*
i_mode
&=
~
current_umask
();
}
else
{
if
(
S_ISDIR
(
*
i_mode
))
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_default
,
acl
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_default_acl
,
acl
);
clone
=
posix_acl_clone
(
acl
,
GFP_KERNEL
);
if
(
!
clone
)
...
...
@@ -350,7 +347,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
return
rc
;
}
if
(
rc
>
0
)
jffs2_iset_acl
(
inode
,
&
f
->
i_acl_access
,
clone
);
jffs2_iset_acl
(
inode
,
&
inode
->
i_acl
,
clone
);
posix_acl_release
(
clone
);
}
...
...
@@ -359,17 +356,16 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
int
jffs2_init_acl_post
(
struct
inode
*
inode
)
{
struct
jffs2_inode_info
*
f
=
JFFS2_INODE_INFO
(
inode
);
int
rc
;
if
(
f
->
i_acl_default
)
{
rc
=
__jffs2_set_acl
(
inode
,
JFFS2_XPREFIX_ACL_DEFAULT
,
f
->
i_acl_default
);
if
(
inode
->
i_default_acl
)
{
rc
=
__jffs2_set_acl
(
inode
,
JFFS2_XPREFIX_ACL_DEFAULT
,
inode
->
i_default_acl
);
if
(
rc
)
return
rc
;
}
if
(
f
->
i_acl_access
)
{
rc
=
__jffs2_set_acl
(
inode
,
JFFS2_XPREFIX_ACL_ACCESS
,
f
->
i_acl_access
);
if
(
inode
->
i_acl
)
{
rc
=
__jffs2_set_acl
(
inode
,
JFFS2_XPREFIX_ACL_ACCESS
,
inode
->
i_acl
);
if
(
rc
)
return
rc
;
}
...
...
@@ -377,18 +373,6 @@ int jffs2_init_acl_post(struct inode *inode)
return
0
;
}
void
jffs2_clear_acl
(
struct
jffs2_inode_info
*
f
)
{
if
(
f
->
i_acl_access
&&
f
->
i_acl_access
!=
JFFS2_ACL_NOT_CACHED
)
{
posix_acl_release
(
f
->
i_acl_access
);
f
->
i_acl_access
=
JFFS2_ACL_NOT_CACHED
;
}
if
(
f
->
i_acl_default
&&
f
->
i_acl_default
!=
JFFS2_ACL_NOT_CACHED
)
{
posix_acl_release
(
f
->
i_acl_default
);
f
->
i_acl_default
=
JFFS2_ACL_NOT_CACHED
;
}
}
int
jffs2_acl_chmod
(
struct
inode
*
inode
)
{
struct
posix_acl
*
acl
,
*
clone
;
...
...
fs/jffs2/acl.h
浏览文件 @
290c263b
...
...
@@ -26,13 +26,10 @@ struct jffs2_acl_header {
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
#define JFFS2_ACL_NOT_CACHED ((void *)-1)
extern
int
jffs2_permission
(
struct
inode
*
,
int
);
extern
int
jffs2_acl_chmod
(
struct
inode
*
);
extern
int
jffs2_init_acl_pre
(
struct
inode
*
,
struct
inode
*
,
int
*
);
extern
int
jffs2_init_acl_post
(
struct
inode
*
);
extern
void
jffs2_clear_acl
(
struct
jffs2_inode_info
*
);
extern
struct
xattr_handler
jffs2_acl_access_xattr_handler
;
extern
struct
xattr_handler
jffs2_acl_default_xattr_handler
;
...
...
@@ -43,6 +40,5 @@ extern struct xattr_handler jffs2_acl_default_xattr_handler;
#define jffs2_acl_chmod(inode) (0)
#define jffs2_init_acl_pre(dir_i,inode,mode) (0)
#define jffs2_init_acl_post(inode) (0)
#define jffs2_clear_acl(f)
#endif
/* CONFIG_JFFS2_FS_POSIX_ACL */
fs/jffs2/jffs2_fs_i.h
浏览文件 @
290c263b
...
...
@@ -50,10 +50,6 @@ struct jffs2_inode_info {
uint16_t
flags
;
uint8_t
usercompr
;
struct
inode
vfs_inode
;
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
struct
posix_acl
*
i_acl_access
;
struct
posix_acl
*
i_acl_default
;
#endif
};
#endif
/* _JFFS2_FS_I */
fs/jffs2/os-linux.h
浏览文件 @
290c263b
...
...
@@ -56,10 +56,6 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
f
->
target
=
NULL
;
f
->
flags
=
0
;
f
->
usercompr
=
0
;
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
f
->
i_acl_access
=
JFFS2_ACL_NOT_CACHED
;
f
->
i_acl_default
=
JFFS2_ACL_NOT_CACHED
;
#endif
}
...
...
fs/jffs2/readinode.c
浏览文件 @
290c263b
...
...
@@ -1424,7 +1424,6 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
struct
jffs2_full_dirent
*
fd
,
*
fds
;
int
deleted
;
jffs2_clear_acl
(
f
);
jffs2_xattr_delete_inode
(
c
,
f
->
inocache
);
mutex_lock
(
&
f
->
sem
);
deleted
=
f
->
inocache
&&
!
f
->
inocache
->
pino_nlink
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录