mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
convert ext4 to ->evict_inode()
pretty much brute-force... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
7da08fd17a
commit
0930fcc1ee
4 changed files with 16 additions and 10 deletions
|
@ -1571,7 +1571,8 @@ extern int ext4_write_inode(struct inode *, struct writeback_control *);
|
||||||
extern int ext4_setattr(struct dentry *, struct iattr *);
|
extern int ext4_setattr(struct dentry *, struct iattr *);
|
||||||
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||||
struct kstat *stat);
|
struct kstat *stat);
|
||||||
extern void ext4_delete_inode(struct inode *);
|
extern void ext4_evict_inode(struct inode *);
|
||||||
|
extern void ext4_clear_inode(struct inode *);
|
||||||
extern int ext4_sync_inode(handle_t *, struct inode *);
|
extern int ext4_sync_inode(handle_t *, struct inode *);
|
||||||
extern void ext4_dirty_inode(struct inode *);
|
extern void ext4_dirty_inode(struct inode *);
|
||||||
extern int ext4_change_inode_journal_flag(struct inode *, int);
|
extern int ext4_change_inode_journal_flag(struct inode *, int);
|
||||||
|
|
|
@ -222,7 +222,7 @@ void ext4_free_inode(handle_t *handle, struct inode *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 */
|
/* Do this BEFORE marking the inode not in use or returning an error */
|
||||||
clear_inode(inode);
|
ext4_clear_inode(inode);
|
||||||
|
|
||||||
es = EXT4_SB(sb)->s_es;
|
es = EXT4_SB(sb)->s_es;
|
||||||
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
|
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
|
||||||
|
|
|
@ -167,11 +167,16 @@ int ext4_truncate_restart_trans(handle_t *handle, struct inode *inode,
|
||||||
/*
|
/*
|
||||||
* Called at the last iput() if i_nlink is zero.
|
* Called at the last iput() if i_nlink is zero.
|
||||||
*/
|
*/
|
||||||
void ext4_delete_inode(struct inode *inode)
|
void ext4_evict_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (inode->i_nlink) {
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
goto no_delete;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_bad_inode(inode))
|
if (!is_bad_inode(inode))
|
||||||
dquot_initialize(inode);
|
dquot_initialize(inode);
|
||||||
|
|
||||||
|
@ -245,13 +250,13 @@ void ext4_delete_inode(struct inode *inode)
|
||||||
*/
|
*/
|
||||||
if (ext4_mark_inode_dirty(handle, inode))
|
if (ext4_mark_inode_dirty(handle, inode))
|
||||||
/* If that failed, just do the required in-core inode clear. */
|
/* If that failed, just do the required in-core inode clear. */
|
||||||
clear_inode(inode);
|
ext4_clear_inode(inode);
|
||||||
else
|
else
|
||||||
ext4_free_inode(handle, inode);
|
ext4_free_inode(handle, inode);
|
||||||
ext4_journal_stop(handle);
|
ext4_journal_stop(handle);
|
||||||
return;
|
return;
|
||||||
no_delete:
|
no_delete:
|
||||||
clear_inode(inode); /* We must guarantee clearing of inode... */
|
ext4_clear_inode(inode); /* We must guarantee clearing of inode... */
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -813,8 +813,10 @@ static void destroy_inodecache(void)
|
||||||
kmem_cache_destroy(ext4_inode_cachep);
|
kmem_cache_destroy(ext4_inode_cachep);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ext4_clear_inode(struct inode *inode)
|
void ext4_clear_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
invalidate_inode_buffers(inode);
|
||||||
|
end_writeback(inode);
|
||||||
dquot_drop(inode);
|
dquot_drop(inode);
|
||||||
ext4_discard_preallocations(inode);
|
ext4_discard_preallocations(inode);
|
||||||
if (EXT4_JOURNAL(inode))
|
if (EXT4_JOURNAL(inode))
|
||||||
|
@ -1100,14 +1102,13 @@ static const struct super_operations ext4_sops = {
|
||||||
.destroy_inode = ext4_destroy_inode,
|
.destroy_inode = ext4_destroy_inode,
|
||||||
.write_inode = ext4_write_inode,
|
.write_inode = ext4_write_inode,
|
||||||
.dirty_inode = ext4_dirty_inode,
|
.dirty_inode = ext4_dirty_inode,
|
||||||
.delete_inode = ext4_delete_inode,
|
.evict_inode = ext4_evict_inode,
|
||||||
.put_super = ext4_put_super,
|
.put_super = ext4_put_super,
|
||||||
.sync_fs = ext4_sync_fs,
|
.sync_fs = ext4_sync_fs,
|
||||||
.freeze_fs = ext4_freeze,
|
.freeze_fs = ext4_freeze,
|
||||||
.unfreeze_fs = ext4_unfreeze,
|
.unfreeze_fs = ext4_unfreeze,
|
||||||
.statfs = ext4_statfs,
|
.statfs = ext4_statfs,
|
||||||
.remount_fs = ext4_remount,
|
.remount_fs = ext4_remount,
|
||||||
.clear_inode = ext4_clear_inode,
|
|
||||||
.show_options = ext4_show_options,
|
.show_options = ext4_show_options,
|
||||||
#ifdef CONFIG_QUOTA
|
#ifdef CONFIG_QUOTA
|
||||||
.quota_read = ext4_quota_read,
|
.quota_read = ext4_quota_read,
|
||||||
|
@ -1121,12 +1122,11 @@ static const struct super_operations ext4_nojournal_sops = {
|
||||||
.destroy_inode = ext4_destroy_inode,
|
.destroy_inode = ext4_destroy_inode,
|
||||||
.write_inode = ext4_write_inode,
|
.write_inode = ext4_write_inode,
|
||||||
.dirty_inode = ext4_dirty_inode,
|
.dirty_inode = ext4_dirty_inode,
|
||||||
.delete_inode = ext4_delete_inode,
|
.evict_inode = ext4_evict_inode,
|
||||||
.write_super = ext4_write_super,
|
.write_super = ext4_write_super,
|
||||||
.put_super = ext4_put_super,
|
.put_super = ext4_put_super,
|
||||||
.statfs = ext4_statfs,
|
.statfs = ext4_statfs,
|
||||||
.remount_fs = ext4_remount,
|
.remount_fs = ext4_remount,
|
||||||
.clear_inode = ext4_clear_inode,
|
|
||||||
.show_options = ext4_show_options,
|
.show_options = ext4_show_options,
|
||||||
#ifdef CONFIG_QUOTA
|
#ifdef CONFIG_QUOTA
|
||||||
.quota_read = ext4_quota_read,
|
.quota_read = ext4_quota_read,
|
||||||
|
|
Loading…
Add table
Reference in a new issue