Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a063ff1e
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看板
提交
a063ff1e
编写于
5月 09, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-linus' into work.lookups
上级
5963ded8
99d82582
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
19 deletion
+65
-19
fs/ecryptfs/file.c
fs/ecryptfs/file.c
+55
-16
fs/isofs/rock.c
fs/isofs/rock.c
+10
-3
未找到文件。
fs/ecryptfs/file.c
浏览文件 @
a063ff1e
...
...
@@ -112,7 +112,6 @@ static int ecryptfs_readdir(struct file *file, struct dir_context *ctx)
.
sb
=
inode
->
i_sb
,
};
lower_file
=
ecryptfs_file_to_lower
(
file
);
lower_file
->
f_pos
=
ctx
->
pos
;
rc
=
iterate_dir
(
lower_file
,
&
buf
.
ctx
);
ctx
->
pos
=
buf
.
ctx
.
pos
;
if
(
rc
<
0
)
...
...
@@ -223,14 +222,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
}
ecryptfs_set_file_lower
(
file
,
ecryptfs_inode_to_private
(
inode
)
->
lower_file
);
if
(
d_is_dir
(
ecryptfs_dentry
))
{
ecryptfs_printk
(
KERN_DEBUG
,
"This is a directory
\n
"
);
mutex_lock
(
&
crypt_stat
->
cs_mutex
);
crypt_stat
->
flags
&=
~
(
ECRYPTFS_ENCRYPTED
);
mutex_unlock
(
&
crypt_stat
->
cs_mutex
);
rc
=
0
;
goto
out
;
}
rc
=
read_or_initialize_metadata
(
ecryptfs_dentry
);
if
(
rc
)
goto
out_put
;
...
...
@@ -247,6 +238,45 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
return
rc
;
}
/**
* ecryptfs_dir_open
* @inode: inode speciying file to open
* @file: Structure to return filled in
*
* Opens the file specified by inode.
*
* Returns zero on success; non-zero otherwise
*/
static
int
ecryptfs_dir_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
struct
dentry
*
ecryptfs_dentry
=
file
->
f_path
.
dentry
;
/* Private value of ecryptfs_dentry allocated in
* ecryptfs_lookup() */
struct
ecryptfs_file_info
*
file_info
;
struct
file
*
lower_file
;
/* Released in ecryptfs_release or end of function if failure */
file_info
=
kmem_cache_zalloc
(
ecryptfs_file_info_cache
,
GFP_KERNEL
);
ecryptfs_set_file_private
(
file
,
file_info
);
if
(
unlikely
(
!
file_info
))
{
ecryptfs_printk
(
KERN_ERR
,
"Error attempting to allocate memory
\n
"
);
return
-
ENOMEM
;
}
lower_file
=
dentry_open
(
ecryptfs_dentry_to_lower_path
(
ecryptfs_dentry
),
file
->
f_flags
,
current_cred
());
if
(
IS_ERR
(
lower_file
))
{
printk
(
KERN_ERR
"%s: Error attempting to initialize "
"the lower file for the dentry with name "
"[%pd]; rc = [%ld]
\n
"
,
__func__
,
ecryptfs_dentry
,
PTR_ERR
(
lower_file
));
kmem_cache_free
(
ecryptfs_file_info_cache
,
file_info
);
return
PTR_ERR
(
lower_file
);
}
ecryptfs_set_file_lower
(
file
,
lower_file
);
return
0
;
}
static
int
ecryptfs_flush
(
struct
file
*
file
,
fl_owner_t
td
)
{
struct
file
*
lower_file
=
ecryptfs_file_to_lower
(
file
);
...
...
@@ -267,6 +297,19 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
return
0
;
}
static
int
ecryptfs_dir_release
(
struct
inode
*
inode
,
struct
file
*
file
)
{
fput
(
ecryptfs_file_to_lower
(
file
));
kmem_cache_free
(
ecryptfs_file_info_cache
,
ecryptfs_file_to_private
(
file
));
return
0
;
}
static
loff_t
ecryptfs_dir_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
whence
)
{
return
vfs_llseek
(
ecryptfs_file_to_lower
(
file
),
offset
,
whence
);
}
static
int
ecryptfs_fsync
(
struct
file
*
file
,
loff_t
start
,
loff_t
end
,
int
datasync
)
{
...
...
@@ -346,20 +389,16 @@ const struct file_operations ecryptfs_dir_fops = {
#ifdef CONFIG_COMPAT
.
compat_ioctl
=
ecryptfs_compat_ioctl
,
#endif
.
open
=
ecryptfs_open
,
.
flush
=
ecryptfs_flush
,
.
release
=
ecryptfs_release
,
.
open
=
ecryptfs_dir_open
,
.
release
=
ecryptfs_dir_release
,
.
fsync
=
ecryptfs_fsync
,
.
fasync
=
ecryptfs_fasync
,
.
splice_read
=
generic_file_splice_read
,
.
llseek
=
default_llseek
,
.
llseek
=
ecryptfs_dir_llseek
,
};
const
struct
file_operations
ecryptfs_main_fops
=
{
.
llseek
=
generic_file_llseek
,
.
read_iter
=
ecryptfs_read_update_atime
,
.
write_iter
=
generic_file_write_iter
,
.
iterate
=
ecryptfs_readdir
,
.
unlocked_ioctl
=
ecryptfs_unlocked_ioctl
,
#ifdef CONFIG_COMPAT
.
compat_ioctl
=
ecryptfs_compat_ioctl
,
...
...
fs/isofs/rock.c
浏览文件 @
a063ff1e
...
...
@@ -203,6 +203,8 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
int
retnamlen
=
0
;
int
truncate
=
0
;
int
ret
=
0
;
char
*
p
;
int
len
;
if
(
!
ISOFS_SB
(
inode
->
i_sb
)
->
s_rock
)
return
0
;
...
...
@@ -267,12 +269,17 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
rr
->
u
.
NM
.
flags
);
break
;
}
if
((
strlen
(
retname
)
+
rr
->
len
-
5
)
>=
254
)
{
len
=
rr
->
len
-
5
;
if
(
retnamlen
+
len
>=
254
)
{
truncate
=
1
;
break
;
}
strncat
(
retname
,
rr
->
u
.
NM
.
name
,
rr
->
len
-
5
);
retnamlen
+=
rr
->
len
-
5
;
p
=
memchr
(
rr
->
u
.
NM
.
name
,
'\0'
,
len
);
if
(
unlikely
(
p
))
len
=
p
-
rr
->
u
.
NM
.
name
;
memcpy
(
retname
+
retnamlen
,
rr
->
u
.
NM
.
name
,
len
);
retnamlen
+=
len
;
retname
[
retnamlen
]
=
'\0'
;
break
;
case
SIG
(
'R'
,
'E'
):
kfree
(
rs
.
buffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录