Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d561c025
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
提交
d561c025
编写于
3月 23, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
3月 23, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: very minimal locking
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
7f5c1516
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
11 deletion
+22
-11
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-0
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-0
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+3
-2
fs/btrfs/super.c
fs/btrfs/super.c
+17
-9
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
d561c025
...
...
@@ -231,6 +231,7 @@ struct btrfs_fs_info {
struct
buffer_head
*
sb_buffer
;
struct
super_block
*
sb
;
struct
mutex
trans_mutex
;
struct
mutex
fs_mutex
;
};
/*
...
...
fs/btrfs/disk-io.c
浏览文件 @
d561c025
...
...
@@ -116,6 +116,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info
->
sb_buffer
=
sb_buffer
;
fs_info
->
sb
=
sb
;
mutex_init
(
&
fs_info
->
trans_mutex
);
mutex_init
(
&
fs_info
->
fs_mutex
);
memset
(
&
fs_info
->
current_insert
,
0
,
sizeof
(
fs_info
->
current_insert
));
memset
(
&
fs_info
->
last_insert
,
0
,
sizeof
(
fs_info
->
last_insert
));
...
...
fs/btrfs/extent-tree.c
浏览文件 @
d561c025
...
...
@@ -168,9 +168,10 @@ static int pin_down_block(struct btrfs_root *root, u64 blocknr, int tag)
BUG_ON
(
!
bh
);
err
=
radix_tree_insert
(
&
root
->
fs_info
->
pinned_radix
,
blocknr
,
bh
);
BUG_ON
(
err
);
if
(
err
)
if
(
err
&&
err
!=
-
EEXIST
)
{
BUG
();
return
err
;
}
radix_tree_tag_set
(
&
root
->
fs_info
->
pinned_radix
,
blocknr
,
tag
);
return
0
;
...
...
fs/btrfs/super.c
浏览文件 @
d561c025
...
...
@@ -453,25 +453,21 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
struct
inode
*
inode
;
int
err
;
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
trans
=
btrfs_start_transaction
(
root
,
1
);
inode
=
btrfs_new_inode
(
trans
,
dir
,
mode
);
err
=
PTR_ERR
(
inode
);
if
(
IS_ERR
(
inode
))
return
err
;
goto
out_unlock
;
// FIXME mark the inode dirty
err
=
btrfs_add_nondir
(
trans
,
dentry
,
inode
);
dir
->
i_sb
->
s_dirt
=
1
;
btrfs_end_transaction
(
trans
,
root
);
out_unlock:
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
return
err
;
}
static
void
btrfs_write_super
(
struct
super_block
*
sb
)
{
sb
->
s_dirt
=
0
;
printk
(
"btrfs write_super!
\n
"
);
filemap_flush
(
sb
->
s_bdev
->
bd_inode
->
i_mapping
);
}
static
int
btrfs_sync_fs
(
struct
super_block
*
sb
,
int
wait
)
{
struct
btrfs_trans_handle
*
trans
;
...
...
@@ -479,17 +475,29 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
int
ret
;
sb
->
s_dirt
=
0
;
return
0
;
if
(
!
wait
)
{
filemap_flush
(
sb
->
s_bdev
->
bd_inode
->
i_mapping
);
return
0
;
}
filemap_write_and_wait
(
sb
->
s_bdev
->
bd_inode
->
i_mapping
);
root
=
btrfs_sb
(
sb
);
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
trans
=
btrfs_start_transaction
(
root
,
1
);
ret
=
btrfs_commit_transaction
(
trans
,
root
);
sb
->
s_dirt
=
0
;
BUG_ON
(
ret
);
printk
(
"btrfs sync_fs
\n
"
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
return
0
;
}
static
void
btrfs_write_super
(
struct
super_block
*
sb
)
{
btrfs_sync_fs
(
sb
,
1
);
}
static
int
btrfs_get_sb
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
vfsmount
*
mnt
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录