Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
c2536668
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看板
提交
c2536668
编写于
3月 29, 2006
作者:
N
Nathan Scott
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XFS] Cleanup in XFS after recent get_block_t interface tweaks.
Signed-off-by:
N
Nathan Scott
<
nathans@sgi.com
>
上级
0b7e56a4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
26 addition
and
31 deletion
+26
-31
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_aops.c
+24
-29
fs/xfs/linux-2.6/xfs_aops.h
fs/xfs/linux-2.6/xfs_aops.h
+1
-1
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_iops.c
+1
-1
未找到文件。
fs/xfs/linux-2.6/xfs_aops.c
浏览文件 @
c2536668
...
@@ -1223,10 +1223,9 @@ xfs_vm_releasepage(
...
@@ -1223,10 +1223,9 @@ xfs_vm_releasepage(
}
}
STATIC
int
STATIC
int
__xfs_get_block
(
__xfs_get_block
s
(
struct
inode
*
inode
,
struct
inode
*
inode
,
sector_t
iblock
,
sector_t
iblock
,
unsigned
long
blocks
,
struct
buffer_head
*
bh_result
,
struct
buffer_head
*
bh_result
,
int
create
,
int
create
,
int
direct
,
int
direct
,
...
@@ -1236,22 +1235,17 @@ __xfs_get_block(
...
@@ -1236,22 +1235,17 @@ __xfs_get_block(
xfs_iomap_t
iomap
;
xfs_iomap_t
iomap
;
xfs_off_t
offset
;
xfs_off_t
offset
;
ssize_t
size
;
ssize_t
size
;
int
retpbbm
=
1
;
int
niomap
=
1
;
int
error
;
int
error
;
offset
=
(
xfs_off_t
)
iblock
<<
inode
->
i_blkbits
;
offset
=
(
xfs_off_t
)
iblock
<<
inode
->
i_blkbits
;
if
(
blocks
)
ASSERT
(
bh_result
->
b_size
>=
(
1
<<
inode
->
i_blkbits
));
size
=
(
ssize_t
)
min_t
(
xfs_off_t
,
LONG_MAX
,
size
=
bh_result
->
b_size
;
(
xfs_off_t
)
blocks
<<
inode
->
i_blkbits
);
else
size
=
1
<<
inode
->
i_blkbits
;
VOP_BMAP
(
vp
,
offset
,
size
,
VOP_BMAP
(
vp
,
offset
,
size
,
create
?
flags
:
BMAPI_READ
,
&
iomap
,
&
retpbbm
,
error
);
create
?
flags
:
BMAPI_READ
,
&
iomap
,
&
niomap
,
error
);
if
(
error
)
if
(
error
)
return
-
error
;
return
-
error
;
if
(
niomap
==
0
)
if
(
retpbbm
==
0
)
return
0
;
return
0
;
if
(
iomap
.
iomap_bn
!=
IOMAP_DADDR_NULL
)
{
if
(
iomap
.
iomap_bn
!=
IOMAP_DADDR_NULL
)
{
...
@@ -1271,12 +1265,16 @@ __xfs_get_block(
...
@@ -1271,12 +1265,16 @@ __xfs_get_block(
}
}
}
}
/* If this is a realtime file, data might be on a new device */
/*
* If this is a realtime file, data may be on a different device.
* to that pointed to from the buffer_head b_bdev currently.
*/
bh_result
->
b_bdev
=
iomap
.
iomap_target
->
bt_bdev
;
bh_result
->
b_bdev
=
iomap
.
iomap_target
->
bt_bdev
;
/* If we previously allocated a block out beyond eof and
/*
* we are now coming back to use it then we will need to
* If we previously allocated a block out beyond eof and we are
* flag it as new even if it has a disk address.
* now coming back to use it then we will need to flag it as new
* even if it has a disk address.
*/
*/
if
(
create
&&
if
(
create
&&
((
!
buffer_mapped
(
bh_result
)
&&
!
buffer_uptodate
(
bh_result
))
||
((
!
buffer_mapped
(
bh_result
)
&&
!
buffer_uptodate
(
bh_result
))
||
...
@@ -1292,26 +1290,24 @@ __xfs_get_block(
...
@@ -1292,26 +1290,24 @@ __xfs_get_block(
}
}
}
}
if
(
blocks
)
{
if
(
direct
||
size
>
(
1
<<
inode
->
i_blkbits
)
)
{
ASSERT
(
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
>
0
);
ASSERT
(
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
>
0
);
offset
=
min_t
(
xfs_off_t
,
offset
=
min_t
(
xfs_off_t
,
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
,
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
,
size
);
(
xfs_off_t
)
blocks
<<
inode
->
i_blkbits
);
bh_result
->
b_size
=
(
ssize_t
)
min_t
(
xfs_off_t
,
LONG_MAX
,
offset
);
bh_result
->
b_size
=
(
u32
)
min_t
(
xfs_off_t
,
UINT_MAX
,
offset
);
}
}
return
0
;
return
0
;
}
}
int
int
xfs_get_block
(
xfs_get_block
s
(
struct
inode
*
inode
,
struct
inode
*
inode
,
sector_t
iblock
,
sector_t
iblock
,
struct
buffer_head
*
bh_result
,
struct
buffer_head
*
bh_result
,
int
create
)
int
create
)
{
{
return
__xfs_get_block
(
inode
,
iblock
,
return
__xfs_get_blocks
(
inode
,
iblock
,
bh_result
->
b_size
>>
inode
->
i_blkbits
,
bh_result
,
create
,
0
,
BMAPI_WRITE
);
bh_result
,
create
,
0
,
BMAPI_WRITE
);
}
}
...
@@ -1322,8 +1318,7 @@ xfs_get_blocks_direct(
...
@@ -1322,8 +1318,7 @@ xfs_get_blocks_direct(
struct
buffer_head
*
bh_result
,
struct
buffer_head
*
bh_result
,
int
create
)
int
create
)
{
{
return
__xfs_get_block
(
inode
,
iblock
,
return
__xfs_get_blocks
(
inode
,
iblock
,
bh_result
->
b_size
>>
inode
->
i_blkbits
,
bh_result
,
create
,
1
,
BMAPI_WRITE
|
BMAPI_DIRECT
);
bh_result
,
create
,
1
,
BMAPI_WRITE
|
BMAPI_DIRECT
);
}
}
...
@@ -1405,7 +1400,7 @@ xfs_vm_prepare_write(
...
@@ -1405,7 +1400,7 @@ xfs_vm_prepare_write(
unsigned
int
from
,
unsigned
int
from
,
unsigned
int
to
)
unsigned
int
to
)
{
{
return
block_prepare_write
(
page
,
from
,
to
,
xfs_get_block
);
return
block_prepare_write
(
page
,
from
,
to
,
xfs_get_block
s
);
}
}
STATIC
sector_t
STATIC
sector_t
...
@@ -1422,7 +1417,7 @@ xfs_vm_bmap(
...
@@ -1422,7 +1417,7 @@ xfs_vm_bmap(
VOP_RWLOCK
(
vp
,
VRWLOCK_READ
);
VOP_RWLOCK
(
vp
,
VRWLOCK_READ
);
VOP_FLUSH_PAGES
(
vp
,
(
xfs_off_t
)
0
,
-
1
,
0
,
FI_REMAPF
,
error
);
VOP_FLUSH_PAGES
(
vp
,
(
xfs_off_t
)
0
,
-
1
,
0
,
FI_REMAPF
,
error
);
VOP_RWUNLOCK
(
vp
,
VRWLOCK_READ
);
VOP_RWUNLOCK
(
vp
,
VRWLOCK_READ
);
return
generic_block_bmap
(
mapping
,
block
,
xfs_get_block
);
return
generic_block_bmap
(
mapping
,
block
,
xfs_get_block
s
);
}
}
STATIC
int
STATIC
int
...
@@ -1430,7 +1425,7 @@ xfs_vm_readpage(
...
@@ -1430,7 +1425,7 @@ xfs_vm_readpage(
struct
file
*
unused
,
struct
file
*
unused
,
struct
page
*
page
)
struct
page
*
page
)
{
{
return
mpage_readpage
(
page
,
xfs_get_block
);
return
mpage_readpage
(
page
,
xfs_get_block
s
);
}
}
STATIC
int
STATIC
int
...
@@ -1440,7 +1435,7 @@ xfs_vm_readpages(
...
@@ -1440,7 +1435,7 @@ xfs_vm_readpages(
struct
list_head
*
pages
,
struct
list_head
*
pages
,
unsigned
nr_pages
)
unsigned
nr_pages
)
{
{
return
mpage_readpages
(
mapping
,
pages
,
nr_pages
,
xfs_get_block
);
return
mpage_readpages
(
mapping
,
pages
,
nr_pages
,
xfs_get_block
s
);
}
}
STATIC
void
STATIC
void
...
...
fs/xfs/linux-2.6/xfs_aops.h
浏览文件 @
c2536668
...
@@ -41,6 +41,6 @@ typedef struct xfs_ioend {
...
@@ -41,6 +41,6 @@ typedef struct xfs_ioend {
}
xfs_ioend_t
;
}
xfs_ioend_t
;
extern
struct
address_space_operations
xfs_address_space_operations
;
extern
struct
address_space_operations
xfs_address_space_operations
;
extern
int
xfs_get_block
(
struct
inode
*
,
sector_t
,
struct
buffer_head
*
,
int
);
extern
int
xfs_get_block
s
(
struct
inode
*
,
sector_t
,
struct
buffer_head
*
,
int
);
#endif
/* __XFS_IOPS_H__ */
#endif
/* __XFS_IOPS_H__ */
fs/xfs/linux-2.6/xfs_iops.c
浏览文件 @
c2536668
...
@@ -708,7 +708,7 @@ STATIC void
...
@@ -708,7 +708,7 @@ STATIC void
xfs_vn_truncate
(
xfs_vn_truncate
(
struct
inode
*
inode
)
struct
inode
*
inode
)
{
{
block_truncate_page
(
inode
->
i_mapping
,
inode
->
i_size
,
xfs_get_block
);
block_truncate_page
(
inode
->
i_mapping
,
inode
->
i_size
,
xfs_get_block
s
);
}
}
STATIC
int
STATIC
int
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录