Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9717a91b
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9717a91b
编写于
5月 12, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hfs: switch to ->iterate_shared()
exact parallel of hfsplus analogue Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
323ee8fc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
3 deletion
+15
-3
fs/hfs/catalog.c
fs/hfs/catalog.c
+3
-0
fs/hfs/dir.c
fs/hfs/dir.c
+9
-3
fs/hfs/hfs_fs.h
fs/hfs/hfs_fs.h
+1
-0
fs/hfs/inode.c
fs/hfs/inode.c
+2
-0
未找到文件。
fs/hfs/catalog.c
浏览文件 @
9717a91b
...
@@ -240,10 +240,13 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
...
@@ -240,10 +240,13 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
}
}
}
}
/* we only need to take spinlock for exclusion with ->release() */
spin_lock
(
&
HFS_I
(
dir
)
->
open_dir_lock
);
list_for_each_entry
(
rd
,
&
HFS_I
(
dir
)
->
open_dir_list
,
list
)
{
list_for_each_entry
(
rd
,
&
HFS_I
(
dir
)
->
open_dir_list
,
list
)
{
if
(
fd
.
tree
->
keycmp
(
fd
.
search_key
,
(
void
*
)
&
rd
->
key
)
<
0
)
if
(
fd
.
tree
->
keycmp
(
fd
.
search_key
,
(
void
*
)
&
rd
->
key
)
<
0
)
rd
->
file
->
f_pos
--
;
rd
->
file
->
f_pos
--
;
}
}
spin_unlock
(
&
HFS_I
(
dir
)
->
open_dir_lock
);
res
=
hfs_brec_remove
(
&
fd
);
res
=
hfs_brec_remove
(
&
fd
);
if
(
res
)
if
(
res
)
...
...
fs/hfs/dir.c
浏览文件 @
9717a91b
...
@@ -161,8 +161,14 @@ static int hfs_readdir(struct file *file, struct dir_context *ctx)
...
@@ -161,8 +161,14 @@ static int hfs_readdir(struct file *file, struct dir_context *ctx)
}
}
file
->
private_data
=
rd
;
file
->
private_data
=
rd
;
rd
->
file
=
file
;
rd
->
file
=
file
;
spin_lock
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
list_add
(
&
rd
->
list
,
&
HFS_I
(
inode
)
->
open_dir_list
);
list_add
(
&
rd
->
list
,
&
HFS_I
(
inode
)
->
open_dir_list
);
spin_unlock
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
}
}
/*
* Can be done after the list insertion; exclusion with
* hfs_delete_cat() is provided by directory lock.
*/
memcpy
(
&
rd
->
key
,
&
fd
.
key
,
sizeof
(
struct
hfs_cat_key
));
memcpy
(
&
rd
->
key
,
&
fd
.
key
,
sizeof
(
struct
hfs_cat_key
));
out:
out:
hfs_find_exit
(
&
fd
);
hfs_find_exit
(
&
fd
);
...
@@ -173,9 +179,9 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
...
@@ -173,9 +179,9 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
{
{
struct
hfs_readdir_data
*
rd
=
file
->
private_data
;
struct
hfs_readdir_data
*
rd
=
file
->
private_data
;
if
(
rd
)
{
if
(
rd
)
{
inode_lock
(
inode
);
spin_lock
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
list_del
(
&
rd
->
list
);
list_del
(
&
rd
->
list
);
inode_unlock
(
inode
);
spin_unlock
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
kfree
(
rd
);
kfree
(
rd
);
}
}
return
0
;
return
0
;
...
@@ -303,7 +309,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -303,7 +309,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
const
struct
file_operations
hfs_dir_operations
=
{
const
struct
file_operations
hfs_dir_operations
=
{
.
read
=
generic_read_dir
,
.
read
=
generic_read_dir
,
.
iterate
=
hfs_readdir
,
.
iterate
_shared
=
hfs_readdir
,
.
llseek
=
generic_file_llseek
,
.
llseek
=
generic_file_llseek
,
.
release
=
hfs_dir_release
,
.
release
=
hfs_dir_release
,
};
};
...
...
fs/hfs/hfs_fs.h
浏览文件 @
9717a91b
...
@@ -69,6 +69,7 @@ struct hfs_inode_info {
...
@@ -69,6 +69,7 @@ struct hfs_inode_info {
struct
hfs_cat_key
cat_key
;
struct
hfs_cat_key
cat_key
;
struct
list_head
open_dir_list
;
struct
list_head
open_dir_list
;
spinlock_t
open_dir_lock
;
struct
inode
*
rsrc_inode
;
struct
inode
*
rsrc_inode
;
struct
mutex
extents_lock
;
struct
mutex
extents_lock
;
...
...
fs/hfs/inode.c
浏览文件 @
9717a91b
...
@@ -187,6 +187,7 @@ struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode)
...
@@ -187,6 +187,7 @@ struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode)
mutex_init
(
&
HFS_I
(
inode
)
->
extents_lock
);
mutex_init
(
&
HFS_I
(
inode
)
->
extents_lock
);
INIT_LIST_HEAD
(
&
HFS_I
(
inode
)
->
open_dir_list
);
INIT_LIST_HEAD
(
&
HFS_I
(
inode
)
->
open_dir_list
);
spin_lock_init
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
hfs_cat_build_key
(
sb
,
(
btree_key
*
)
&
HFS_I
(
inode
)
->
cat_key
,
dir
->
i_ino
,
name
);
hfs_cat_build_key
(
sb
,
(
btree_key
*
)
&
HFS_I
(
inode
)
->
cat_key
,
dir
->
i_ino
,
name
);
inode
->
i_ino
=
HFS_SB
(
sb
)
->
next_id
++
;
inode
->
i_ino
=
HFS_SB
(
sb
)
->
next_id
++
;
inode
->
i_mode
=
mode
;
inode
->
i_mode
=
mode
;
...
@@ -318,6 +319,7 @@ static int hfs_read_inode(struct inode *inode, void *data)
...
@@ -318,6 +319,7 @@ static int hfs_read_inode(struct inode *inode, void *data)
HFS_I
(
inode
)
->
rsrc_inode
=
NULL
;
HFS_I
(
inode
)
->
rsrc_inode
=
NULL
;
mutex_init
(
&
HFS_I
(
inode
)
->
extents_lock
);
mutex_init
(
&
HFS_I
(
inode
)
->
extents_lock
);
INIT_LIST_HEAD
(
&
HFS_I
(
inode
)
->
open_dir_list
);
INIT_LIST_HEAD
(
&
HFS_I
(
inode
)
->
open_dir_list
);
spin_lock_init
(
&
HFS_I
(
inode
)
->
open_dir_lock
);
/* Initialize the inode */
/* Initialize the inode */
inode
->
i_uid
=
hsb
->
s_uid
;
inode
->
i_uid
=
hsb
->
s_uid
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录