Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ea14b57f
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看板
提交
ea14b57f
编写于
6月 22, 2017
作者:
D
David Sterba
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
btrfs: fix spelling of snapshotting
Signed-off-by:
N
David Sterba
<
dsterba@suse.com
>
上级
e38ae7a0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
36 deletion
+36
-36
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+3
-3
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-1
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+11
-11
fs/btrfs/file.c
fs/btrfs/file.c
+5
-5
fs/btrfs/inode.c
fs/btrfs/inode.c
+11
-11
fs/btrfs/ioctl.c
fs/btrfs/ioctl.c
+5
-5
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
ea14b57f
...
...
@@ -1258,7 +1258,7 @@ struct btrfs_root {
*/
int
send_in_progress
;
struct
btrfs_subvolume_writers
*
subv_writers
;
atomic_t
will_be_snapshoted
;
atomic_t
will_be_snapshot
t
ed
;
/* For qgroup metadata space reserve */
atomic64_t
qgroup_meta_rsv
;
...
...
@@ -2773,8 +2773,8 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
int
btrfs_delayed_refs_qgroup_accounting
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_fs_info
*
fs_info
);
int
__get_raid_index
(
u64
flags
);
int
btrfs_start_write_no_snapshoting
(
struct
btrfs_root
*
root
);
void
btrfs_end_write_no_snapshoting
(
struct
btrfs_root
*
root
);
int
btrfs_start_write_no_snapshot
t
ing
(
struct
btrfs_root
*
root
);
void
btrfs_end_write_no_snapshot
t
ing
(
struct
btrfs_root
*
root
);
void
btrfs_wait_for_snapshot_creation
(
struct
btrfs_root
*
root
);
void
check_system_chunk
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_fs_info
*
fs_info
,
const
u64
type
);
...
...
fs/btrfs/disk-io.c
浏览文件 @
ea14b57f
...
...
@@ -1343,7 +1343,7 @@ static void __setup_root(struct btrfs_root *root, struct btrfs_fs_info *fs_info,
atomic_set
(
&
root
->
log_batch
,
0
);
atomic_set
(
&
root
->
orphan_inodes
,
0
);
refcount_set
(
&
root
->
refs
,
1
);
atomic_set
(
&
root
->
will_be_snapshoted
,
0
);
atomic_set
(
&
root
->
will_be_snapshot
t
ed
,
0
);
atomic64_set
(
&
root
->
qgroup_meta_rsv
,
0
);
root
->
log_transid
=
0
;
root
->
log_transid_committed
=
-
1
;
...
...
fs/btrfs/extent-tree.c
浏览文件 @
ea14b57f
...
...
@@ -10989,14 +10989,14 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
}
/*
* btrfs_{start,end}_write_no_snapshoting() are similar to
* btrfs_{start,end}_write_no_snapshot
t
ing() are similar to
* mnt_{want,drop}_write(), they are used to prevent some tasks from writing
* data into the page cache through nocow before the subvolume is snapshoted,
* but flush the data into disk after the snapshot creation, or to prevent
* operations while snapshoting is ongoing and that cause the snapshot to be
* operations while snapshot
t
ing is ongoing and that cause the snapshot to be
* inconsistent (writes followed by expanding truncates for example).
*/
void
btrfs_end_write_no_snapshoting
(
struct
btrfs_root
*
root
)
void
btrfs_end_write_no_snapshot
t
ing
(
struct
btrfs_root
*
root
)
{
percpu_counter_dec
(
&
root
->
subv_writers
->
counter
);
/*
...
...
@@ -11007,9 +11007,9 @@ void btrfs_end_write_no_snapshoting(struct btrfs_root *root)
wake_up
(
&
root
->
subv_writers
->
wait
);
}
int
btrfs_start_write_no_snapshoting
(
struct
btrfs_root
*
root
)
int
btrfs_start_write_no_snapshot
t
ing
(
struct
btrfs_root
*
root
)
{
if
(
atomic_read
(
&
root
->
will_be_snapshoted
))
if
(
atomic_read
(
&
root
->
will_be_snapshot
t
ed
))
return
0
;
percpu_counter_inc
(
&
root
->
subv_writers
->
counter
);
...
...
@@ -11017,14 +11017,14 @@ int btrfs_start_write_no_snapshoting(struct btrfs_root *root)
* Make sure counter is updated before we check for snapshot creation.
*/
smp_mb
();
if
(
atomic_read
(
&
root
->
will_be_snapshoted
))
{
btrfs_end_write_no_snapshoting
(
root
);
if
(
atomic_read
(
&
root
->
will_be_snapshot
t
ed
))
{
btrfs_end_write_no_snapshot
t
ing
(
root
);
return
0
;
}
return
1
;
}
static
int
wait_snapshoting_atomic_t
(
atomic_t
*
a
)
static
int
wait_snapshot
t
ing_atomic_t
(
atomic_t
*
a
)
{
schedule
();
return
0
;
...
...
@@ -11035,11 +11035,11 @@ void btrfs_wait_for_snapshot_creation(struct btrfs_root *root)
while
(
true
)
{
int
ret
;
ret
=
btrfs_start_write_no_snapshoting
(
root
);
ret
=
btrfs_start_write_no_snapshot
t
ing
(
root
);
if
(
ret
)
break
;
wait_on_atomic_t
(
&
root
->
will_be_snapshoted
,
wait_snapshoting_atomic_t
,
wait_on_atomic_t
(
&
root
->
will_be_snapshot
t
ed
,
wait_snapshot
t
ing_atomic_t
,
TASK_UNINTERRUPTIBLE
);
}
}
fs/btrfs/file.c
浏览文件 @
ea14b57f
...
...
@@ -1536,7 +1536,7 @@ static noinline int check_can_nocow(struct btrfs_inode *inode, loff_t pos,
u64
num_bytes
;
int
ret
;
ret
=
btrfs_start_write_no_snapshoting
(
root
);
ret
=
btrfs_start_write_no_snapshot
t
ing
(
root
);
if
(
!
ret
)
return
-
ENOSPC
;
...
...
@@ -1561,7 +1561,7 @@ static noinline int check_can_nocow(struct btrfs_inode *inode, loff_t pos,
NULL
,
NULL
,
NULL
);
if
(
ret
<=
0
)
{
ret
=
0
;
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
}
else
{
*
write_bytes
=
min_t
(
size_t
,
*
write_bytes
,
num_bytes
-
pos
+
lockstart
);
...
...
@@ -1664,7 +1664,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
data_reserved
,
pos
,
write_bytes
);
else
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
break
;
}
...
...
@@ -1767,7 +1767,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
release_bytes
=
0
;
if
(
only_release_metadata
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
if
(
only_release_metadata
&&
copied
>
0
)
{
lockstart
=
round_down
(
pos
,
...
...
@@ -1797,7 +1797,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
if
(
release_bytes
)
{
if
(
only_release_metadata
)
{
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
btrfs_delalloc_release_metadata
(
BTRFS_I
(
inode
),
release_bytes
);
}
else
{
...
...
fs/btrfs/inode.c
浏览文件 @
ea14b57f
...
...
@@ -1381,7 +1381,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
* we fall into common COW way.
*/
if
(
!
nolock
)
{
err
=
btrfs_start_write_no_snapshoting
(
root
);
err
=
btrfs_start_write_no_snapshot
t
ing
(
root
);
if
(
!
err
)
goto
out_check
;
}
...
...
@@ -1393,12 +1393,12 @@ static noinline int run_delalloc_nocow(struct inode *inode,
if
(
csum_exist_in_range
(
fs_info
,
disk_bytenr
,
num_bytes
))
{
if
(
!
nolock
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
goto
out_check
;
}
if
(
!
btrfs_inc_nocow_writers
(
fs_info
,
disk_bytenr
))
{
if
(
!
nolock
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
goto
out_check
;
}
nocow
=
1
;
...
...
@@ -1415,7 +1415,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
if
(
extent_end
<=
start
)
{
path
->
slots
[
0
]
++
;
if
(
!
nolock
&&
nocow
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
if
(
nocow
)
btrfs_dec_nocow_writers
(
fs_info
,
disk_bytenr
);
goto
next_slot
;
...
...
@@ -1438,7 +1438,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
NULL
);
if
(
ret
)
{
if
(
!
nolock
&&
nocow
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
if
(
nocow
)
btrfs_dec_nocow_writers
(
fs_info
,
disk_bytenr
);
...
...
@@ -1459,7 +1459,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
BTRFS_ORDERED_PREALLOC
);
if
(
IS_ERR
(
em
))
{
if
(
!
nolock
&&
nocow
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
if
(
nocow
)
btrfs_dec_nocow_writers
(
fs_info
,
disk_bytenr
);
...
...
@@ -1499,7 +1499,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
PAGE_UNLOCK
|
PAGE_SET_PRIVATE2
);
if
(
!
nolock
&&
nocow
)
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
cur_offset
=
extent_end
;
/*
...
...
@@ -5053,7 +5053,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
if
(
newsize
>
oldsize
)
{
/*
* Don't do an expanding truncate while snapshoting is ongoing.
* Don't do an expanding truncate while snapshot
t
ing is ongoing.
* This is to ensure the snapshot captures a fully consistent
* state of this file - if the snapshot captures this expanding
* truncation, it must capture all writes that happened before
...
...
@@ -5062,13 +5062,13 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
btrfs_wait_for_snapshot_creation
(
root
);
ret
=
btrfs_cont_expand
(
inode
,
oldsize
,
newsize
);
if
(
ret
)
{
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
return
ret
;
}
trans
=
btrfs_start_transaction
(
root
,
1
);
if
(
IS_ERR
(
trans
))
{
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
return
PTR_ERR
(
trans
);
}
...
...
@@ -5076,7 +5076,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
btrfs_ordered_update_i_size
(
inode
,
i_size_read
(
inode
),
NULL
);
pagecache_isize_extended
(
inode
,
oldsize
,
newsize
);
ret
=
btrfs_update_inode
(
trans
,
root
,
inode
);
btrfs_end_write_no_snapshoting
(
root
);
btrfs_end_write_no_snapshot
t
ing
(
root
);
btrfs_end_transaction
(
trans
);
}
else
{
...
...
fs/btrfs/ioctl.c
浏览文件 @
ea14b57f
...
...
@@ -607,7 +607,7 @@ static noinline int create_subvol(struct inode *dir,
return
ret
;
}
static
void
btrfs_wait_for_no_snapshoting_writes
(
struct
btrfs_root
*
root
)
static
void
btrfs_wait_for_no_snapshot
t
ing_writes
(
struct
btrfs_root
*
root
)
{
s64
writers
;
DEFINE_WAIT
(
wait
);
...
...
@@ -650,9 +650,9 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
goto
free_pending
;
}
atomic_inc
(
&
root
->
will_be_snapshoted
);
atomic_inc
(
&
root
->
will_be_snapshot
t
ed
);
smp_mb__after_atomic
();
btrfs_wait_for_no_snapshoting_writes
(
root
);
btrfs_wait_for_no_snapshot
t
ing_writes
(
root
);
ret
=
btrfs_start_delalloc_inodes
(
root
,
0
);
if
(
ret
)
...
...
@@ -723,8 +723,8 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
fail:
btrfs_subvolume_release_metadata
(
fs_info
,
&
pending_snapshot
->
block_rsv
);
dec_and_free:
if
(
atomic_dec_and_test
(
&
root
->
will_be_snapshoted
))
wake_up_atomic_t
(
&
root
->
will_be_snapshoted
);
if
(
atomic_dec_and_test
(
&
root
->
will_be_snapshot
t
ed
))
wake_up_atomic_t
(
&
root
->
will_be_snapshot
t
ed
);
free_pending:
kfree
(
pending_snapshot
->
root_item
);
btrfs_free_path
(
pending_snapshot
->
path
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录