Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
05459ca8
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
05459ca8
编写于
6月 07, 2009
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
repair sysv_write_inode(), switch sysv to simple_fsync()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0d7916d7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
47 deletion
+18
-47
fs/sysv/dir.c
fs/sysv/dir.c
+1
-1
fs/sysv/file.c
fs/sysv/file.c
+1
-16
fs/sysv/inode.c
fs/sysv/inode.c
+16
-29
fs/sysv/sysv.h
fs/sysv/sysv.h
+0
-1
未找到文件。
fs/sysv/dir.c
浏览文件 @
05459ca8
...
...
@@ -24,7 +24,7 @@ static int sysv_readdir(struct file *, void *, filldir_t);
const
struct
file_operations
sysv_dir_operations
=
{
.
read
=
generic_read_dir
,
.
readdir
=
sysv_readdir
,
.
fsync
=
s
ysv_sync_file
,
.
fsync
=
s
imple_fsync
,
};
static
inline
void
dir_put_page
(
struct
page
*
page
)
...
...
fs/sysv/file.c
浏览文件 @
05459ca8
...
...
@@ -26,7 +26,7 @@ const struct file_operations sysv_file_operations = {
.
write
=
do_sync_write
,
.
aio_write
=
generic_file_aio_write
,
.
mmap
=
generic_file_mmap
,
.
fsync
=
s
ysv_sync_file
,
.
fsync
=
s
imple_fsync
,
.
splice_read
=
generic_file_splice_read
,
};
...
...
@@ -34,18 +34,3 @@ const struct inode_operations sysv_file_inode_operations = {
.
truncate
=
sysv_truncate
,
.
getattr
=
sysv_getattr
,
};
int
sysv_sync_file
(
struct
file
*
file
,
struct
dentry
*
dentry
,
int
datasync
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
int
err
;
err
=
sync_mapping_buffers
(
inode
->
i_mapping
);
if
(
!
(
inode
->
i_state
&
I_DIRTY
))
return
err
;
if
(
datasync
&&
!
(
inode
->
i_state
&
I_DIRTY_DATASYNC
))
return
err
;
err
|=
sysv_sync_inode
(
inode
);
return
err
?
-
EIO
:
0
;
}
fs/sysv/inode.c
浏览文件 @
05459ca8
...
...
@@ -247,7 +247,7 @@ struct inode *sysv_iget(struct super_block *sb, unsigned int ino)
return
ERR_PTR
(
-
EIO
);
}
static
struct
buffer_head
*
sysv_update_inode
(
struct
inode
*
inode
)
int
sysv_write_inode
(
struct
inode
*
inode
,
int
wait
)
{
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
sysv_sb_info
*
sbi
=
SYSV_SB
(
sb
);
...
...
@@ -255,19 +255,21 @@ static struct buffer_head * sysv_update_inode(struct inode * inode)
struct
sysv_inode
*
raw_inode
;
struct
sysv_inode_info
*
si
;
unsigned
int
ino
,
block
;
int
err
=
0
;
ino
=
inode
->
i_ino
;
if
(
!
ino
||
ino
>
sbi
->
s_ninodes
)
{
printk
(
"Bad inode number on dev %s: %d is out of range
\n
"
,
inode
->
i_sb
->
s_id
,
ino
);
return
NULL
;
return
-
EIO
;
}
raw_inode
=
sysv_raw_inode
(
sb
,
ino
,
&
bh
);
if
(
!
raw_inode
)
{
printk
(
"unable to read i-node block
\n
"
);
return
NULL
;
return
-
EIO
;
}
lock_kernel
();
raw_inode
->
i_mode
=
cpu_to_fs16
(
sbi
,
inode
->
i_mode
);
raw_inode
->
i_uid
=
cpu_to_fs16
(
sbi
,
fs_high2lowuid
(
inode
->
i_uid
));
raw_inode
->
i_gid
=
cpu_to_fs16
(
sbi
,
fs_high2lowgid
(
inode
->
i_gid
));
...
...
@@ -283,38 +285,23 @@ static struct buffer_head * sysv_update_inode(struct inode * inode)
for
(
block
=
0
;
block
<
10
+
1
+
1
+
1
;
block
++
)
write3byte
(
sbi
,
(
u8
*
)
&
si
->
i_data
[
block
],
&
raw_inode
->
i_data
[
3
*
block
]);
unlock_kernel
();
mark_buffer_dirty
(
bh
);
return
bh
;
}
int
sysv_write_inode
(
struct
inode
*
inode
,
int
wait
)
{
struct
buffer_head
*
bh
;
lock_kernel
();
bh
=
sysv_update_inode
(
inode
);
if
(
wait
)
{
sync_dirty_buffer
(
bh
);
if
(
buffer_req
(
bh
)
&&
!
buffer_uptodate
(
bh
))
{
printk
(
"IO error syncing sysv inode [%s:%08x]
\n
"
,
sb
->
s_id
,
ino
);
err
=
-
EIO
;
}
}
brelse
(
bh
);
unlock_kernel
();
return
0
;
}
int
sysv_sync_inode
(
struct
inode
*
inode
)
int
sysv_sync_inode
(
struct
inode
*
inode
)
{
int
err
=
0
;
struct
buffer_head
*
bh
;
bh
=
sysv_update_inode
(
inode
);
if
(
bh
&&
buffer_dirty
(
bh
))
{
sync_dirty_buffer
(
bh
);
if
(
buffer_req
(
bh
)
&&
!
buffer_uptodate
(
bh
))
{
printk
(
"IO error syncing sysv inode [%s:%08lx]
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
err
=
-
1
;
}
}
else
if
(
!
bh
)
err
=
-
1
;
brelse
(
bh
);
return
err
;
return
sysv_write_inode
(
inode
,
1
);
}
static
void
sysv_delete_inode
(
struct
inode
*
inode
)
...
...
fs/sysv/sysv.h
浏览文件 @
05459ca8
...
...
@@ -144,7 +144,6 @@ extern int __sysv_write_begin(struct file *file, struct address_space *mapping,
extern
struct
inode
*
sysv_iget
(
struct
super_block
*
,
unsigned
int
);
extern
int
sysv_write_inode
(
struct
inode
*
,
int
);
extern
int
sysv_sync_inode
(
struct
inode
*
);
extern
int
sysv_sync_file
(
struct
file
*
,
struct
dentry
*
,
int
);
extern
void
sysv_set_inode
(
struct
inode
*
,
dev_t
);
extern
int
sysv_getattr
(
struct
vfsmount
*
,
struct
dentry
*
,
struct
kstat
*
);
extern
int
sysv_init_icache
(
void
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录