Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
35ebb934
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看板
提交
35ebb934
编写于
10月 30, 2007
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Fix PAGE_CACHE_SHIFT shifts on 32 bit machines
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
2ff3e9b6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
22 deletion
+26
-22
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-1
fs/btrfs/extent_map.c
fs/btrfs/extent_map.c
+15
-12
fs/btrfs/file.c
fs/btrfs/file.c
+2
-1
fs/btrfs/inode.c
fs/btrfs/inode.c
+7
-7
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+1
-1
未找到文件。
fs/btrfs/disk-io.c
浏览文件 @
35ebb934
...
@@ -159,7 +159,7 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
...
@@ -159,7 +159,7 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
int
csum_dirty_buffer
(
struct
btrfs_root
*
root
,
struct
page
*
page
)
int
csum_dirty_buffer
(
struct
btrfs_root
*
root
,
struct
page
*
page
)
{
{
struct
extent_map_tree
*
tree
;
struct
extent_map_tree
*
tree
;
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
found_start
;
u64
found_start
;
int
found_level
;
int
found_level
;
unsigned
long
len
;
unsigned
long
len
;
...
...
fs/btrfs/extent_map.c
浏览文件 @
35ebb934
...
@@ -1229,7 +1229,7 @@ EXPORT_SYMBOL(test_range_bit);
...
@@ -1229,7 +1229,7 @@ EXPORT_SYMBOL(test_range_bit);
static
int
check_page_uptodate
(
struct
extent_map_tree
*
tree
,
static
int
check_page_uptodate
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
)
struct
page
*
page
)
{
{
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
if
(
test_range_bit
(
tree
,
start
,
end
,
EXTENT_UPTODATE
,
1
))
if
(
test_range_bit
(
tree
,
start
,
end
,
EXTENT_UPTODATE
,
1
))
SetPageUptodate
(
page
);
SetPageUptodate
(
page
);
...
@@ -1243,7 +1243,7 @@ static int check_page_uptodate(struct extent_map_tree *tree,
...
@@ -1243,7 +1243,7 @@ static int check_page_uptodate(struct extent_map_tree *tree,
static
int
check_page_locked
(
struct
extent_map_tree
*
tree
,
static
int
check_page_locked
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
)
struct
page
*
page
)
{
{
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
if
(
!
test_range_bit
(
tree
,
start
,
end
,
EXTENT_LOCKED
,
0
))
if
(
!
test_range_bit
(
tree
,
start
,
end
,
EXTENT_LOCKED
,
0
))
unlock_page
(
page
);
unlock_page
(
page
);
...
@@ -1257,7 +1257,7 @@ static int check_page_locked(struct extent_map_tree *tree,
...
@@ -1257,7 +1257,7 @@ static int check_page_locked(struct extent_map_tree *tree,
static
int
check_page_writeback
(
struct
extent_map_tree
*
tree
,
static
int
check_page_writeback
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
)
struct
page
*
page
)
{
{
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
if
(
!
test_range_bit
(
tree
,
start
,
end
,
EXTENT_WRITEBACK
,
0
))
if
(
!
test_range_bit
(
tree
,
start
,
end
,
EXTENT_WRITEBACK
,
0
))
end_page_writeback
(
page
);
end_page_writeback
(
page
);
...
@@ -1296,7 +1296,8 @@ static int end_bio_extent_writepage(struct bio *bio,
...
@@ -1296,7 +1296,8 @@ static int end_bio_extent_writepage(struct bio *bio,
do
{
do
{
struct
page
*
page
=
bvec
->
bv_page
;
struct
page
*
page
=
bvec
->
bv_page
;
start
=
(
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
start
=
((
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
end
=
start
+
bvec
->
bv_len
-
1
;
end
=
start
+
bvec
->
bv_len
-
1
;
if
(
bvec
->
bv_offset
==
0
&&
bvec
->
bv_len
==
PAGE_CACHE_SIZE
)
if
(
bvec
->
bv_offset
==
0
&&
bvec
->
bv_len
==
PAGE_CACHE_SIZE
)
...
@@ -1361,7 +1362,8 @@ static int end_bio_extent_readpage(struct bio *bio,
...
@@ -1361,7 +1362,8 @@ static int end_bio_extent_readpage(struct bio *bio,
do
{
do
{
struct
page
*
page
=
bvec
->
bv_page
;
struct
page
*
page
=
bvec
->
bv_page
;
start
=
(
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
start
=
((
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
end
=
start
+
bvec
->
bv_len
-
1
;
end
=
start
+
bvec
->
bv_len
-
1
;
if
(
bvec
->
bv_offset
==
0
&&
bvec
->
bv_len
==
PAGE_CACHE_SIZE
)
if
(
bvec
->
bv_offset
==
0
&&
bvec
->
bv_len
==
PAGE_CACHE_SIZE
)
...
@@ -1427,7 +1429,8 @@ static int end_bio_extent_preparewrite(struct bio *bio,
...
@@ -1427,7 +1429,8 @@ static int end_bio_extent_preparewrite(struct bio *bio,
do
{
do
{
struct
page
*
page
=
bvec
->
bv_page
;
struct
page
*
page
=
bvec
->
bv_page
;
start
=
(
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
start
=
((
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
)
+
bvec
->
bv_offset
;
end
=
start
+
bvec
->
bv_len
-
1
;
end
=
start
+
bvec
->
bv_len
-
1
;
if
(
--
bvec
>=
bio
->
bi_io_vec
)
if
(
--
bvec
>=
bio
->
bi_io_vec
)
...
@@ -1503,7 +1506,7 @@ int extent_read_full_page(struct extent_map_tree *tree, struct page *page,
...
@@ -1503,7 +1506,7 @@ int extent_read_full_page(struct extent_map_tree *tree, struct page *page,
get_extent_t
*
get_extent
)
get_extent_t
*
get_extent
)
{
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
page_end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
;
u64
end
;
u64
cur
=
start
;
u64
cur
=
start
;
...
@@ -1608,7 +1611,7 @@ int extent_write_full_page(struct extent_map_tree *tree, struct page *page,
...
@@ -1608,7 +1611,7 @@ int extent_write_full_page(struct extent_map_tree *tree, struct page *page,
struct
writeback_control
*
wbc
)
struct
writeback_control
*
wbc
)
{
{
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
page_end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
;
u64
end
;
u64
cur
=
start
;
u64
cur
=
start
;
...
@@ -1750,7 +1753,7 @@ EXPORT_SYMBOL(extent_write_full_page);
...
@@ -1750,7 +1753,7 @@ EXPORT_SYMBOL(extent_write_full_page);
int
extent_invalidatepage
(
struct
extent_map_tree
*
tree
,
int
extent_invalidatepage
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
,
unsigned
long
offset
)
struct
page
*
page
,
unsigned
long
offset
)
{
{
u64
start
=
(
page
->
index
<<
PAGE_CACHE_SHIFT
);
u64
start
=
(
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
);
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
size_t
blocksize
=
page
->
mapping
->
host
->
i_sb
->
s_blocksize
;
size_t
blocksize
=
page
->
mapping
->
host
->
i_sb
->
s_blocksize
;
...
@@ -1792,7 +1795,7 @@ int extent_prepare_write(struct extent_map_tree *tree,
...
@@ -1792,7 +1795,7 @@ int extent_prepare_write(struct extent_map_tree *tree,
struct
inode
*
inode
,
struct
page
*
page
,
struct
inode
*
inode
,
struct
page
*
page
,
unsigned
from
,
unsigned
to
,
get_extent_t
*
get_extent
)
unsigned
from
,
unsigned
to
,
get_extent_t
*
get_extent
)
{
{
u64
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
u64
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
u64
block_start
;
u64
block_start
;
u64
orig_block_start
;
u64
orig_block_start
;
...
@@ -1890,7 +1893,7 @@ EXPORT_SYMBOL(extent_prepare_write);
...
@@ -1890,7 +1893,7 @@ EXPORT_SYMBOL(extent_prepare_write);
int
try_release_extent_mapping
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
)
int
try_release_extent_mapping
(
struct
extent_map_tree
*
tree
,
struct
page
*
page
)
{
{
struct
extent_map
*
em
;
struct
extent_map
*
em
;
u64
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
u64
orig_start
=
start
;
u64
orig_start
=
start
;
int
ret
=
1
;
int
ret
=
1
;
...
@@ -2202,7 +2205,7 @@ int clear_extent_buffer_dirty(struct extent_map_tree *tree,
...
@@ -2202,7 +2205,7 @@ int clear_extent_buffer_dirty(struct extent_map_tree *tree,
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
((
i
==
num_pages
-
1
)
&&
((
i
==
num_pages
-
1
)
&&
((
eb
->
start
+
eb
->
len
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
((
eb
->
start
+
eb
->
len
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
if
(
test_range_bit
(
tree
,
start
,
end
,
if
(
test_range_bit
(
tree
,
start
,
end
,
EXTENT_DIRTY
,
0
))
{
EXTENT_DIRTY
,
0
))
{
...
...
fs/btrfs/file.c
浏览文件 @
35ebb934
...
@@ -301,7 +301,8 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans,
...
@@ -301,7 +301,8 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans,
SetPageUptodate
(
p
);
SetPageUptodate
(
p
);
set_page_dirty
(
p
);
set_page_dirty
(
p
);
}
}
last_end
=
pages
[
num_pages
-
1
]
->
index
<<
PAGE_CACHE_SHIFT
;
last_end
=
(
u64
)(
pages
[
num_pages
-
1
]
->
index
)
<<
PAGE_CACHE_SHIFT
;
last_end
+=
PAGE_CACHE_SIZE
-
1
;
last_end
+=
PAGE_CACHE_SIZE
-
1
;
set_extent_delalloc
(
em_tree
,
start_pos
,
end_of_last_block
,
set_extent_delalloc
(
em_tree
,
start_pos
,
end_of_last_block
,
GFP_NOFS
);
GFP_NOFS
);
...
...
fs/btrfs/inode.c
浏览文件 @
35ebb934
...
@@ -111,7 +111,7 @@ int btrfs_writepage_io_hook(struct page *page, u64 start, u64 end)
...
@@ -111,7 +111,7 @@ int btrfs_writepage_io_hook(struct page *page, u64 start, u64 end)
struct
btrfs_trans_handle
*
trans
;
struct
btrfs_trans_handle
*
trans
;
char
*
kaddr
;
char
*
kaddr
;
int
ret
;
int
ret
;
u64
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
size_t
offset
=
start
-
page_start
;
size_t
offset
=
start
-
page_start
;
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
...
@@ -160,7 +160,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
...
@@ -160,7 +160,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
int
btrfs_readpage_end_io_hook
(
struct
page
*
page
,
u64
start
,
u64
end
)
int
btrfs_readpage_end_io_hook
(
struct
page
*
page
,
u64
start
,
u64
end
)
{
{
size_t
offset
=
start
-
(
page
->
index
<<
PAGE_CACHE_SHIFT
);
size_t
offset
=
start
-
(
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
);
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
extent_map_tree
*
em_tree
=
&
BTRFS_I
(
inode
)
->
extent_tree
;
struct
extent_map_tree
*
em_tree
=
&
BTRFS_I
(
inode
)
->
extent_tree
;
char
*
kaddr
;
char
*
kaddr
;
...
@@ -688,7 +688,7 @@ static int btrfs_cow_one_page(struct inode *inode, struct page *page,
...
@@ -688,7 +688,7 @@ static int btrfs_cow_one_page(struct inode *inode, struct page *page,
char
*
kaddr
;
char
*
kaddr
;
int
ret
=
0
;
int
ret
=
0
;
struct
extent_map_tree
*
em_tree
=
&
BTRFS_I
(
inode
)
->
extent_tree
;
struct
extent_map_tree
*
em_tree
=
&
BTRFS_I
(
inode
)
->
extent_tree
;
u64
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
u64
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
u64
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
set_page_extent_mapped
(
page
);
set_page_extent_mapped
(
page
);
...
@@ -739,7 +739,7 @@ static int btrfs_truncate_page(struct address_space *mapping, loff_t from)
...
@@ -739,7 +739,7 @@ static int btrfs_truncate_page(struct address_space *mapping, loff_t from)
goto
out
;
goto
out
;
}
}
}
}
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
ret
=
btrfs_cow_one_page
(
inode
,
page
,
offset
);
ret
=
btrfs_cow_one_page
(
inode
,
page
,
offset
);
...
@@ -1618,7 +1618,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
...
@@ -1618,7 +1618,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
goto
out
;
goto
out
;
}
}
extent_offset
=
(
page
->
index
<<
PAGE_CACHE_SHIFT
)
-
extent_offset
=
(
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
)
-
extent_start
+
page_offset
;
extent_start
+
page_offset
;
copy_size
=
min_t
(
u64
,
PAGE_CACHE_SIZE
-
page_offset
,
copy_size
=
min_t
(
u64
,
PAGE_CACHE_SIZE
-
page_offset
,
size
-
extent_offset
);
size
-
extent_offset
);
...
@@ -1769,7 +1769,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page)
...
@@ -1769,7 +1769,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page)
lock_page
(
page
);
lock_page
(
page
);
wait_on_page_writeback
(
page
);
wait_on_page_writeback
(
page
);
size
=
i_size_read
(
inode
);
size
=
i_size_read
(
inode
);
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
if
((
page
->
mapping
!=
inode
->
i_mapping
)
||
if
((
page
->
mapping
!=
inode
->
i_mapping
)
||
(
page_start
>
size
))
{
(
page_start
>
size
))
{
...
@@ -2065,7 +2065,7 @@ int btrfs_defrag_file(struct file *file) {
...
@@ -2065,7 +2065,7 @@ int btrfs_defrag_file(struct file *file) {
goto
out_unlock
;
goto
out_unlock
;
}
}
}
}
page_start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
page_start
=
(
u64
)
page
->
index
<<
PAGE_CACHE_SHIFT
;
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
page_end
=
page_start
+
PAGE_CACHE_SIZE
-
1
;
lock_extent
(
em_tree
,
page_start
,
page_end
,
GFP_NOFS
);
lock_extent
(
em_tree
,
page_start
,
page_end
,
GFP_NOFS
);
...
...
fs/btrfs/transaction.c
浏览文件 @
35ebb934
...
@@ -169,7 +169,7 @@ int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
...
@@ -169,7 +169,7 @@ int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
clear_extent_dirty
(
dirty_pages
,
start
,
end
,
GFP_NOFS
);
clear_extent_dirty
(
dirty_pages
,
start
,
end
,
GFP_NOFS
);
while
(
start
<=
end
)
{
while
(
start
<=
end
)
{
index
=
start
>>
PAGE_CACHE_SHIFT
;
index
=
start
>>
PAGE_CACHE_SHIFT
;
start
=
(
index
+
1
)
<<
PAGE_CACHE_SHIFT
;
start
=
(
u64
)(
index
+
1
)
<<
PAGE_CACHE_SHIFT
;
page
=
find_lock_page
(
btree_inode
->
i_mapping
,
index
);
page
=
find_lock_page
(
btree_inode
->
i_mapping
,
index
);
if
(
!
page
)
if
(
!
page
)
continue
;
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录