Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
72edc4d0
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
72edc4d0
编写于
6月 04, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge ext2 delete_inode and clear_inode, switch to ->evict_inode()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
3937871d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
37 deletion
+36
-37
fs/ext2/ext2.h
fs/ext2/ext2.h
+1
-1
fs/ext2/ialloc.c
fs/ext2/ialloc.c
+4
-9
fs/ext2/inode.c
fs/ext2/inode.c
+30
-14
fs/ext2/super.c
fs/ext2/super.c
+1
-13
未找到文件。
fs/ext2/ext2.h
浏览文件 @
72edc4d0
...
...
@@ -119,7 +119,7 @@ extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
/* inode.c */
extern
struct
inode
*
ext2_iget
(
struct
super_block
*
,
unsigned
long
);
extern
int
ext2_write_inode
(
struct
inode
*
,
struct
writeback_control
*
);
extern
void
ext2_
delete_inode
(
struct
inode
*
);
extern
void
ext2_
evict_inode
(
struct
inode
*
);
extern
int
ext2_sync_inode
(
struct
inode
*
);
extern
int
ext2_get_block
(
struct
inode
*
,
sector_t
,
struct
buffer_head
*
,
int
);
extern
int
ext2_setattr
(
struct
dentry
*
,
struct
iattr
*
);
...
...
fs/ext2/ialloc.c
浏览文件 @
72edc4d0
...
...
@@ -118,19 +118,14 @@ void ext2_free_inode (struct inode * inode)
* Note: we must free any quota before locking the superblock,
* as writing the quota to disk may need the lock as well.
*/
if
(
!
is_bad_inode
(
inode
))
{
/* Quota is already initialized in iput() */
ext2_xattr_delete_inode
(
inode
);
dquot_free_inode
(
inode
);
dquot_drop
(
inode
);
}
/* Quota is already initialized in iput() */
ext2_xattr_delete_inode
(
inode
);
dquot_free_inode
(
inode
);
dquot_drop
(
inode
);
es
=
EXT2_SB
(
sb
)
->
s_es
;
is_directory
=
S_ISDIR
(
inode
->
i_mode
);
/* Do this BEFORE marking the inode not in use or returning an error */
clear_inode
(
inode
);
if
(
ino
<
EXT2_FIRST_INO
(
sb
)
||
ino
>
le32_to_cpu
(
es
->
s_inodes_count
))
{
ext2_error
(
sb
,
"ext2_free_inode"
,
...
...
fs/ext2/inode.c
浏览文件 @
72edc4d0
...
...
@@ -69,26 +69,42 @@ static void ext2_write_failed(struct address_space *mapping, loff_t to)
/*
* Called at the last iput() if i_nlink is zero.
*/
void
ext2_
delete_inode
(
struct
inode
*
inode
)
void
ext2_
evict_inode
(
struct
inode
*
inode
)
{
if
(
!
is_bad_inode
(
inode
))
struct
ext2_block_alloc_info
*
rsv
;
int
want_delete
=
0
;
if
(
!
inode
->
i_nlink
&&
!
is_bad_inode
(
inode
))
{
want_delete
=
1
;
dquot_initialize
(
inode
);
}
else
{
dquot_drop
(
inode
);
}
truncate_inode_pages
(
&
inode
->
i_data
,
0
);
if
(
is_bad_inode
(
inode
))
goto
no_delete
;
EXT2_I
(
inode
)
->
i_dtime
=
get_seconds
();
mark_inode_dirty
(
inode
);
__ext2_write_inode
(
inode
,
inode_needs_sync
(
inode
));
if
(
want_delete
)
{
/* set dtime */
EXT2_I
(
inode
)
->
i_dtime
=
get_seconds
();
mark_inode_dirty
(
inode
);
__ext2_write_inode
(
inode
,
inode_needs_sync
(
inode
));
/* truncate to 0 */
inode
->
i_size
=
0
;
if
(
inode
->
i_blocks
)
ext2_truncate_blocks
(
inode
,
0
);
}
inode
->
i_size
=
0
;
if
(
inode
->
i_blocks
)
ext2_truncate_blocks
(
inode
,
0
);
ext2_free_inode
(
inode
);
invalidate_inode_buffers
(
inode
);
end_writeback
(
inode
);
ext2_discard_reservation
(
inode
);
rsv
=
EXT2_I
(
inode
)
->
i_block_alloc_info
;
EXT2_I
(
inode
)
->
i_block_alloc_info
=
NULL
;
if
(
unlikely
(
rsv
))
kfree
(
rsv
);
return
;
no_delete:
clear_inode
(
inode
);
/* We must guarantee clearing of inode... */
if
(
want_delete
)
ext2_free_inode
(
inode
);
}
typedef
struct
{
...
...
fs/ext2/super.c
浏览文件 @
72edc4d0
...
...
@@ -195,17 +195,6 @@ static void destroy_inodecache(void)
kmem_cache_destroy
(
ext2_inode_cachep
);
}
static
void
ext2_clear_inode
(
struct
inode
*
inode
)
{
struct
ext2_block_alloc_info
*
rsv
=
EXT2_I
(
inode
)
->
i_block_alloc_info
;
dquot_drop
(
inode
);
ext2_discard_reservation
(
inode
);
EXT2_I
(
inode
)
->
i_block_alloc_info
=
NULL
;
if
(
unlikely
(
rsv
))
kfree
(
rsv
);
}
static
int
ext2_show_options
(
struct
seq_file
*
seq
,
struct
vfsmount
*
vfs
)
{
struct
super_block
*
sb
=
vfs
->
mnt_sb
;
...
...
@@ -299,13 +288,12 @@ static const struct super_operations ext2_sops = {
.
alloc_inode
=
ext2_alloc_inode
,
.
destroy_inode
=
ext2_destroy_inode
,
.
write_inode
=
ext2_write_inode
,
.
delete_inode
=
ext2_delete
_inode
,
.
evict_inode
=
ext2_evict
_inode
,
.
put_super
=
ext2_put_super
,
.
write_super
=
ext2_write_super
,
.
sync_fs
=
ext2_sync_fs
,
.
statfs
=
ext2_statfs
,
.
remount_fs
=
ext2_remount
,
.
clear_inode
=
ext2_clear_inode
,
.
show_options
=
ext2_show_options
,
#ifdef CONFIG_QUOTA
.
quota_read
=
ext2_quota_read
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录