Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
56b453c9
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
56b453c9
编写于
1月 03, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Explicitly send a root objectid to count_snapshots_in_path
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
8f662a76
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
44 deletion
+11
-44
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+6
-10
fs/btrfs/inode.c
fs/btrfs/inode.c
+5
-34
未找到文件。
fs/btrfs/extent-tree.c
浏览文件 @
56b453c9
...
@@ -688,7 +688,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
...
@@ -688,7 +688,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
struct
btrfs_path
*
path
;
struct
btrfs_path
*
path
;
u64
bytenr
;
u64
bytenr
;
u64
found_objectid
;
u64
found_objectid
;
u64
root_objectid
=
0
;
u64
root_objectid
=
root
->
root_key
.
objectid
;
u32
total_count
=
0
;
u32
total_count
=
0
;
u32
cur_count
;
u32
cur_count
;
u32
refs
;
u32
refs
;
...
@@ -749,15 +749,11 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
...
@@ -749,15 +749,11 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
struct
btrfs_extent_ref
);
struct
btrfs_extent_ref
);
found_objectid
=
btrfs_ref_root
(
l
,
ref_item
);
found_objectid
=
btrfs_ref_root
(
l
,
ref_item
);
if
(
found_objectid
!=
root_objectid
)
if
(
found_objectid
!=
root_objectid
)
{
total_count
++
;
total_count
=
2
;
break
;
if
(
total_count
>
1
)
}
goto
out
;
total_count
=
1
;
if
(
root_objectid
==
0
)
root_objectid
=
found_objectid
;
path
->
slots
[
0
]
++
;
path
->
slots
[
0
]
++
;
}
}
if
(
cur_count
==
0
)
{
if
(
cur_count
==
0
)
{
...
...
fs/btrfs/inode.c
浏览文件 @
56b453c9
...
@@ -1770,6 +1770,11 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
...
@@ -1770,6 +1770,11 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
again:
again:
em
=
lookup_extent_mapping
(
em_tree
,
start
,
end
);
em
=
lookup_extent_mapping
(
em_tree
,
start
,
end
);
if
(
em
)
{
if
(
em
)
{
if
(
em
->
start
>
start
)
{
printk
(
"get_extent start %Lu em start %Lu
\n
"
,
start
,
em
->
start
);
WARN_ON
(
1
);
}
goto
out
;
goto
out
;
}
}
if
(
!
em
)
{
if
(
!
em
)
{
...
@@ -1952,23 +1957,6 @@ static sector_t btrfs_bmap(struct address_space *mapping, sector_t iblock)
...
@@ -1952,23 +1957,6 @@ static sector_t btrfs_bmap(struct address_space *mapping, sector_t iblock)
return
extent_bmap
(
mapping
,
iblock
,
btrfs_get_extent
);
return
extent_bmap
(
mapping
,
iblock
,
btrfs_get_extent
);
}
}
static
int
btrfs_prepare_write
(
struct
file
*
file
,
struct
page
*
page
,
unsigned
from
,
unsigned
to
)
{
struct
btrfs_root
*
root
=
BTRFS_I
(
page
->
mapping
->
host
)
->
root
;
int
err
;
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
err
=
btrfs_check_free_space
(
root
,
PAGE_CACHE_SIZE
,
0
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
if
(
err
)
return
-
ENOSPC
;
return
extent_prepare_write
(
&
BTRFS_I
(
page
->
mapping
->
host
)
->
extent_tree
,
page
->
mapping
->
host
,
page
,
from
,
to
,
btrfs_get_extent
);
}
int
btrfs_readpage
(
struct
file
*
file
,
struct
page
*
page
)
int
btrfs_readpage
(
struct
file
*
file
,
struct
page
*
page
)
{
{
struct
extent_map_tree
*
tree
;
struct
extent_map_tree
*
tree
;
...
@@ -2120,21 +2108,6 @@ static void btrfs_truncate(struct inode *inode)
...
@@ -2120,21 +2108,6 @@ static void btrfs_truncate(struct inode *inode)
btrfs_btree_balance_dirty
(
root
,
nr
);
btrfs_btree_balance_dirty
(
root
,
nr
);
}
}
int
btrfs_commit_write
(
struct
file
*
file
,
struct
page
*
page
,
unsigned
from
,
unsigned
to
)
{
loff_t
pos
=
((
loff_t
)
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
to
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
btrfs_cow_one_page
(
inode
,
page
,
PAGE_CACHE_SIZE
);
if
(
pos
>
inode
->
i_size
)
{
i_size_write
(
inode
,
pos
);
mark_inode_dirty
(
inode
);
}
return
0
;
}
static
int
create_subvol
(
struct
btrfs_root
*
root
,
char
*
name
,
int
namelen
)
static
int
create_subvol
(
struct
btrfs_root
*
root
,
char
*
name
,
int
namelen
)
{
{
struct
btrfs_trans_handle
*
trans
;
struct
btrfs_trans_handle
*
trans
;
...
@@ -2930,8 +2903,6 @@ static struct address_space_operations btrfs_aops = {
...
@@ -2930,8 +2903,6 @@ static struct address_space_operations btrfs_aops = {
.
writepages
=
btrfs_writepages
,
.
writepages
=
btrfs_writepages
,
.
readpages
=
btrfs_readpages
,
.
readpages
=
btrfs_readpages
,
.
sync_page
=
block_sync_page
,
.
sync_page
=
block_sync_page
,
.
prepare_write
=
btrfs_prepare_write
,
.
commit_write
=
btrfs_commit_write
,
.
bmap
=
btrfs_bmap
,
.
bmap
=
btrfs_bmap
,
.
invalidatepage
=
btrfs_invalidatepage
,
.
invalidatepage
=
btrfs_invalidatepage
,
.
releasepage
=
btrfs_releasepage
,
.
releasepage
=
btrfs_releasepage
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录