Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ac14a95b
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
14
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看板
提交
ac14a95b
编写于
6月 06, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert ext3 to ->evict_inode()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0f3f63a4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
36 deletion
+29
-36
fs/ext3/ialloc.c
fs/ext3/ialloc.c
+0
-12
fs/ext3/inode.c
fs/ext3/inode.c
+27
-10
fs/ext3/super.c
fs/ext3/super.c
+1
-13
include/linux/ext3_fs.h
include/linux/ext3_fs.h
+1
-1
未找到文件。
fs/ext3/ialloc.c
浏览文件 @
ac14a95b
...
@@ -119,20 +119,8 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
...
@@ -119,20 +119,8 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
ino
=
inode
->
i_ino
;
ino
=
inode
->
i_ino
;
ext3_debug
(
"freeing inode %lu
\n
"
,
ino
);
ext3_debug
(
"freeing inode %lu
\n
"
,
ino
);
/*
* Note: we must free any quota before locking the superblock,
* as writing the quota to disk may need the lock as well.
*/
dquot_initialize
(
inode
);
ext3_xattr_delete_inode
(
handle
,
inode
);
dquot_free_inode
(
inode
);
dquot_drop
(
inode
);
is_directory
=
S_ISDIR
(
inode
->
i_mode
);
is_directory
=
S_ISDIR
(
inode
->
i_mode
);
/* Do this BEFORE marking the inode not in use or returning an error */
clear_inode
(
inode
);
es
=
EXT3_SB
(
sb
)
->
s_es
;
es
=
EXT3_SB
(
sb
)
->
s_es
;
if
(
ino
<
EXT3_FIRST_INO
(
sb
)
||
ino
>
le32_to_cpu
(
es
->
s_inodes_count
))
{
if
(
ino
<
EXT3_FIRST_INO
(
sb
)
||
ino
>
le32_to_cpu
(
es
->
s_inodes_count
))
{
ext3_error
(
sb
,
"ext3_free_inode"
,
ext3_error
(
sb
,
"ext3_free_inode"
,
...
...
fs/ext3/inode.c
浏览文件 @
ac14a95b
...
@@ -190,18 +190,28 @@ static int truncate_restart_transaction(handle_t *handle, struct inode *inode)
...
@@ -190,18 +190,28 @@ static int truncate_restart_transaction(handle_t *handle, struct inode *inode)
}
}
/*
/*
* Called at
the last iput() if i_nlink is zero.
* Called at
inode eviction from icache
*/
*/
void
ext3_
delete_inode
(
struct
inode
*
inode
)
void
ext3_
evict_inode
(
struct
inode
*
inode
)
{
{
struct
ext3_block_alloc_info
*
rsv
;
handle_t
*
handle
;
handle_t
*
handle
;
int
want_delete
=
0
;
if
(
!
i
s_bad_inode
(
inode
))
if
(
!
i
node
->
i_nlink
&&
!
is_bad_inode
(
inode
))
{
dquot_initialize
(
inode
);
dquot_initialize
(
inode
);
want_delete
=
1
;
}
truncate_inode_pages
(
&
inode
->
i_data
,
0
);
truncate_inode_pages
(
&
inode
->
i_data
,
0
);
if
(
is_bad_inode
(
inode
))
ext3_discard_reservation
(
inode
);
rsv
=
EXT3_I
(
inode
)
->
i_block_alloc_info
;
EXT3_I
(
inode
)
->
i_block_alloc_info
=
NULL
;
if
(
unlikely
(
rsv
))
kfree
(
rsv
);
if
(
!
want_delete
)
goto
no_delete
;
goto
no_delete
;
handle
=
start_transaction
(
inode
);
handle
=
start_transaction
(
inode
);
...
@@ -238,15 +248,22 @@ void ext3_delete_inode (struct inode * inode)
...
@@ -238,15 +248,22 @@ void ext3_delete_inode (struct inode * inode)
* having errors), but we can't free the inode if the mark_dirty
* having errors), but we can't free the inode if the mark_dirty
* fails.
* fails.
*/
*/
if
(
ext3_mark_inode_dirty
(
handle
,
inode
))
if
(
ext3_mark_inode_dirty
(
handle
,
inode
))
{
/* If that failed, just do the required in-core inode clear. */
/* If that failed, just dquot_drop() and be done with that */
clear_inode
(
inode
);
dquot_drop
(
inode
);
else
end_writeback
(
inode
);
}
else
{
ext3_xattr_delete_inode
(
handle
,
inode
);
dquot_free_inode
(
inode
);
dquot_drop
(
inode
);
end_writeback
(
inode
);
ext3_free_inode
(
handle
,
inode
);
ext3_free_inode
(
handle
,
inode
);
}
ext3_journal_stop
(
handle
);
ext3_journal_stop
(
handle
);
return
;
return
;
no_delete:
no_delete:
clear_inode
(
inode
);
/* We must guarantee clearing of inode... */
end_writeback
(
inode
);
dquot_drop
(
inode
);
}
}
typedef
struct
{
typedef
struct
{
...
@@ -2564,7 +2581,7 @@ void ext3_truncate(struct inode *inode)
...
@@ -2564,7 +2581,7 @@ void ext3_truncate(struct inode *inode)
* If this was a simple ftruncate(), and the file will remain alive
* If this was a simple ftruncate(), and the file will remain alive
* then we need to clear up the orphan record which we created above.
* then we need to clear up the orphan record which we created above.
* However, if this was a real unlink then we were called by
* However, if this was a real unlink then we were called by
* ext3_
delete
_inode(), and we allow that function to clean up the
* ext3_
evict
_inode(), and we allow that function to clean up the
* orphan info for us.
* orphan info for us.
*/
*/
if
(
inode
->
i_nlink
)
if
(
inode
->
i_nlink
)
...
...
fs/ext3/super.c
浏览文件 @
ac14a95b
...
@@ -527,17 +527,6 @@ static void destroy_inodecache(void)
...
@@ -527,17 +527,6 @@ static void destroy_inodecache(void)
kmem_cache_destroy
(
ext3_inode_cachep
);
kmem_cache_destroy
(
ext3_inode_cachep
);
}
}
static
void
ext3_clear_inode
(
struct
inode
*
inode
)
{
struct
ext3_block_alloc_info
*
rsv
=
EXT3_I
(
inode
)
->
i_block_alloc_info
;
dquot_drop
(
inode
);
ext3_discard_reservation
(
inode
);
EXT3_I
(
inode
)
->
i_block_alloc_info
=
NULL
;
if
(
unlikely
(
rsv
))
kfree
(
rsv
);
}
static
inline
void
ext3_show_quota_options
(
struct
seq_file
*
seq
,
struct
super_block
*
sb
)
static
inline
void
ext3_show_quota_options
(
struct
seq_file
*
seq
,
struct
super_block
*
sb
)
{
{
#if defined(CONFIG_QUOTA)
#if defined(CONFIG_QUOTA)
...
@@ -783,14 +772,13 @@ static const struct super_operations ext3_sops = {
...
@@ -783,14 +772,13 @@ static const struct super_operations ext3_sops = {
.
destroy_inode
=
ext3_destroy_inode
,
.
destroy_inode
=
ext3_destroy_inode
,
.
write_inode
=
ext3_write_inode
,
.
write_inode
=
ext3_write_inode
,
.
dirty_inode
=
ext3_dirty_inode
,
.
dirty_inode
=
ext3_dirty_inode
,
.
delete_inode
=
ext3_delete
_inode
,
.
evict_inode
=
ext3_evict
_inode
,
.
put_super
=
ext3_put_super
,
.
put_super
=
ext3_put_super
,
.
sync_fs
=
ext3_sync_fs
,
.
sync_fs
=
ext3_sync_fs
,
.
freeze_fs
=
ext3_freeze
,
.
freeze_fs
=
ext3_freeze
,
.
unfreeze_fs
=
ext3_unfreeze
,
.
unfreeze_fs
=
ext3_unfreeze
,
.
statfs
=
ext3_statfs
,
.
statfs
=
ext3_statfs
,
.
remount_fs
=
ext3_remount
,
.
remount_fs
=
ext3_remount
,
.
clear_inode
=
ext3_clear_inode
,
.
show_options
=
ext3_show_options
,
.
show_options
=
ext3_show_options
,
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
.
quota_read
=
ext3_quota_read
,
.
quota_read
=
ext3_quota_read
,
...
...
include/linux/ext3_fs.h
浏览文件 @
ac14a95b
...
@@ -896,7 +896,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
...
@@ -896,7 +896,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
extern
struct
inode
*
ext3_iget
(
struct
super_block
*
,
unsigned
long
);
extern
struct
inode
*
ext3_iget
(
struct
super_block
*
,
unsigned
long
);
extern
int
ext3_write_inode
(
struct
inode
*
,
struct
writeback_control
*
);
extern
int
ext3_write_inode
(
struct
inode
*
,
struct
writeback_control
*
);
extern
int
ext3_setattr
(
struct
dentry
*
,
struct
iattr
*
);
extern
int
ext3_setattr
(
struct
dentry
*
,
struct
iattr
*
);
extern
void
ext3_
delete
_inode
(
struct
inode
*
);
extern
void
ext3_
evict
_inode
(
struct
inode
*
);
extern
int
ext3_sync_inode
(
handle_t
*
,
struct
inode
*
);
extern
int
ext3_sync_inode
(
handle_t
*
,
struct
inode
*
);
extern
void
ext3_discard_reservation
(
struct
inode
*
);
extern
void
ext3_discard_reservation
(
struct
inode
*
);
extern
void
ext3_dirty_inode
(
struct
inode
*
);
extern
void
ext3_dirty_inode
(
struct
inode
*
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录