Skip to content

Commit

Permalink
convert remaining ->clear_inode() to ->evict_inode()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 9, 2010
1 parent 45321ac commit b57922d
Show file tree
Hide file tree
Showing 34 changed files with 94 additions and 59 deletions.
2 changes: 1 addition & 1 deletion fs/9p/v9fs_vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void v9fs_destroy_inode(struct inode *inode);
#endif

struct inode *v9fs_get_inode(struct super_block *sb, int mode);
void v9fs_clear_inode(struct inode *inode);
void v9fs_evict_inode(struct inode *inode);
ino_t v9fs_qid2ino(struct p9_qid *qid);
void v9fs_stat2inode(struct p9_wstat *, struct inode *, struct super_block *);
int v9fs_dir_release(struct inode *inode, struct file *filp);
Expand Down
4 changes: 3 additions & 1 deletion fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry)
* @inode: inode to release
*
*/
void v9fs_clear_inode(struct inode *inode)
void v9fs_evict_inode(struct inode *inode)
{
truncate_inode_pages(inode->i_mapping, 0);
end_writeback(inode);
filemap_fdatawrite(inode->i_mapping);

#ifdef CONFIG_9P_FSCACHE
Expand Down
4 changes: 2 additions & 2 deletions fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static const struct super_operations v9fs_super_ops = {
.destroy_inode = v9fs_destroy_inode,
#endif
.statfs = simple_statfs,
.clear_inode = v9fs_clear_inode,
.evict_inode = v9fs_evict_inode,
.show_options = generic_show_options,
.umount_begin = v9fs_umount_begin,
};
Expand All @@ -268,7 +268,7 @@ static const struct super_operations v9fs_super_ops_dotl = {
.destroy_inode = v9fs_destroy_inode,
#endif
.statfs = v9fs_statfs,
.clear_inode = v9fs_clear_inode,
.evict_inode = v9fs_evict_inode,
.show_options = generic_show_options,
.umount_begin = v9fs_umount_begin,
};
Expand Down
5 changes: 4 additions & 1 deletion fs/afs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ int afs_getattr(struct vfsmount *mnt, struct dentry *dentry,
/*
* clear an AFS inode
*/
void afs_clear_inode(struct inode *inode)
void afs_evict_inode(struct inode *inode)
{
struct afs_permits *permits;
struct afs_vnode *vnode;
Expand All @@ -335,6 +335,9 @@ void afs_clear_inode(struct inode *inode)

ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode);

truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);

afs_give_up_callback(vnode);

if (vnode->server) {
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ extern void afs_zap_data(struct afs_vnode *);
extern int afs_validate(struct afs_vnode *, struct key *);
extern int afs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
extern int afs_setattr(struct dentry *, struct iattr *);
extern void afs_clear_inode(struct inode *);
extern void afs_evict_inode(struct inode *);

/*
* main.c
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static const struct super_operations afs_super_ops = {
.statfs = afs_statfs,
.alloc_inode = afs_alloc_inode,
.destroy_inode = afs_destroy_inode,
.clear_inode = afs_clear_inode,
.evict_inode = afs_evict_inode,
.put_super = afs_put_super,
.show_options = generic_show_options,
};
Expand Down
5 changes: 3 additions & 2 deletions fs/binfmt_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,9 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
return inode;
}

static void bm_clear_inode(struct inode *inode)
static void bm_evict_inode(struct inode *inode)
{
end_writeback(inode);
kfree(inode->i_private);
}

Expand Down Expand Up @@ -685,7 +686,7 @@ static const struct file_operations bm_status_operations = {

static const struct super_operations s_ops = {
.statfs = simple_statfs,
.clear_inode = bm_clear_inode,
.evict_inode = bm_evict_inode,
};

static int bm_fill_super(struct super_block * sb, void * data, int silent)
Expand Down
7 changes: 5 additions & 2 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,13 @@ static inline void __bd_forget(struct inode *inode)
inode->i_mapping = &inode->i_data;
}

static void bdev_clear_inode(struct inode *inode)
static void bdev_evict_inode(struct inode *inode)
{
struct block_device *bdev = &BDEV_I(inode)->bdev;
struct list_head *p;
truncate_inode_pages(&inode->i_data, 0);
invalidate_inode_buffers(inode); /* is it needed here? */
end_writeback(inode);
spin_lock(&bdev_lock);
while ( (p = bdev->bd_inodes.next) != &bdev->bd_inodes ) {
__bd_forget(list_entry(p, struct inode, i_devices));
Expand All @@ -443,7 +446,7 @@ static const struct super_operations bdev_sops = {
.alloc_inode = bdev_alloc_inode,
.destroy_inode = bdev_destroy_inode,
.drop_inode = generic_delete_inode,
.clear_inode = bdev_clear_inode,
.evict_inode = bdev_evict_inode,
};

static int bd_get_sb(struct file_system_type *fs_type,
Expand Down
6 changes: 4 additions & 2 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,10 @@ cifs_destroy_inode(struct inode *inode)
}

static void
cifs_clear_inode(struct inode *inode)
cifs_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
cifs_fscache_release_inode_cookie(inode);
}

Expand Down Expand Up @@ -495,7 +497,7 @@ static const struct super_operations cifs_super_ops = {
.alloc_inode = cifs_alloc_inode,
.destroy_inode = cifs_destroy_inode,
.drop_inode = cifs_drop_inode,
.clear_inode = cifs_clear_inode,
.evict_inode = cifs_evict_inode,
/* .delete_inode = cifs_delete_inode, */ /* Do not need above
function unless later we add lazy close of inodes or unless the
kernel forgets to call us with the same number of releases (closes)
Expand Down
8 changes: 5 additions & 3 deletions fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "coda_int.h"

/* VFS super_block ops */
static void coda_clear_inode(struct inode *);
static void coda_evict_inode(struct inode *);
static void coda_put_super(struct super_block *);
static int coda_statfs(struct dentry *dentry, struct kstatfs *buf);

Expand Down Expand Up @@ -93,7 +93,7 @@ static const struct super_operations coda_super_operations =
{
.alloc_inode = coda_alloc_inode,
.destroy_inode = coda_destroy_inode,
.clear_inode = coda_clear_inode,
.evict_inode = coda_evict_inode,
.put_super = coda_put_super,
.statfs = coda_statfs,
.remount_fs = coda_remount,
Expand Down Expand Up @@ -224,8 +224,10 @@ static void coda_put_super(struct super_block *sb)
printk("Coda: Bye bye.\n");
}

static void coda_clear_inode(struct inode *inode)
static void coda_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
coda_cache_clear_inode(inode);
}

Expand Down
8 changes: 5 additions & 3 deletions fs/ecryptfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static int ecryptfs_statfs(struct dentry *dentry, struct kstatfs *buf)
}

/**
* ecryptfs_clear_inode
* ecryptfs_evict_inode
* @inode - The ecryptfs inode
*
* Called by iput() when the inode reference count reached zero
Expand All @@ -131,8 +131,10 @@ static int ecryptfs_statfs(struct dentry *dentry, struct kstatfs *buf)
* on the inode free list. We use this to drop out reference to the
* lower inode.
*/
static void ecryptfs_clear_inode(struct inode *inode)
static void ecryptfs_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
iput(ecryptfs_inode_to_lower(inode));
}

Expand Down Expand Up @@ -184,6 +186,6 @@ const struct super_operations ecryptfs_sops = {
.drop_inode = generic_delete_inode,
.statfs = ecryptfs_statfs,
.remount_fs = NULL,
.clear_inode = ecryptfs_clear_inode,
.evict_inode = ecryptfs_evict_inode,
.show_options = ecryptfs_show_options
};
2 changes: 1 addition & 1 deletion fs/freevxfs/vxfs_extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern void vxfs_put_fake_inode(struct inode *);
extern struct vxfs_inode_info * vxfs_blkiget(struct super_block *, u_long, ino_t);
extern struct vxfs_inode_info * vxfs_stiget(struct super_block *, ino_t);
extern struct inode * vxfs_iget(struct super_block *, ino_t);
extern void vxfs_clear_inode(struct inode *);
extern void vxfs_evict_inode(struct inode *);

/* vxfs_lookup.c */
extern const struct inode_operations vxfs_dir_inode_ops;
Expand Down
8 changes: 5 additions & 3 deletions fs/freevxfs/vxfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,17 @@ vxfs_iget(struct super_block *sbp, ino_t ino)
}

/**
* vxfs_clear_inode - remove inode from main memory
* vxfs_evict_inode - remove inode from main memory
* @ip: inode to discard.
*
* Description:
* vxfs_clear_inode() is called on the final iput and frees the private
* vxfs_evict_inode() is called on the final iput and frees the private
* inode area.
*/
void
vxfs_clear_inode(struct inode *ip)
vxfs_evict_inode(struct inode *ip)
{
truncate_inode_pages(&ip->i_data, 0);
end_writeback(ip);
kmem_cache_free(vxfs_inode_cachep, ip->i_private);
}
2 changes: 1 addition & 1 deletion fs/freevxfs/vxfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int vxfs_statfs(struct dentry *, struct kstatfs *);
static int vxfs_remount(struct super_block *, int *, char *);

static const struct super_operations vxfs_super_ops = {
.clear_inode = vxfs_clear_inode,
.evict_inode = vxfs_evict_inode,
.put_super = vxfs_put_super,
.statfs = vxfs_statfs,
.remount_fs = vxfs_remount,
Expand Down
6 changes: 4 additions & 2 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
fuse_request_send_noreply(fc, req);
}

static void fuse_clear_inode(struct inode *inode)
static void fuse_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
if (inode->i_sb->s_flags & MS_ACTIVE) {
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
Expand Down Expand Up @@ -736,7 +738,7 @@ static const struct export_operations fuse_export_operations = {
static const struct super_operations fuse_super_operations = {
.alloc_inode = fuse_alloc_inode,
.destroy_inode = fuse_destroy_inode,
.clear_inode = fuse_clear_inode,
.evict_inode = fuse_evict_inode,
.drop_inode = generic_delete_inode,
.remount_fs = fuse_remount_fs,
.put_super = fuse_put_super,
Expand Down
2 changes: 1 addition & 1 deletion fs/hfs/hfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ extern int hfs_inode_setattr(struct dentry *, struct iattr *);
extern void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
__be32 log_size, __be32 phys_size, u32 clump_size);
extern struct inode *hfs_iget(struct super_block *, struct hfs_cat_key *, hfs_cat_rec *);
extern void hfs_clear_inode(struct inode *);
extern void hfs_evict_inode(struct inode *);
extern void hfs_delete_inode(struct inode *);

/* attr.c */
Expand Down
4 changes: 3 additions & 1 deletion fs/hfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,10 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
return NULL;
}

void hfs_clear_inode(struct inode *inode)
void hfs_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
if (HFS_IS_RSRC(inode) && HFS_I(inode)->rsrc_inode) {
HFS_I(HFS_I(inode)->rsrc_inode)->rsrc_inode = NULL;
iput(HFS_I(inode)->rsrc_inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/hfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static const struct super_operations hfs_super_operations = {
.alloc_inode = hfs_alloc_inode,
.destroy_inode = hfs_destroy_inode,
.write_inode = hfs_write_inode,
.clear_inode = hfs_clear_inode,
.evict_inode = hfs_evict_inode,
.put_super = hfs_put_super,
.write_super = hfs_write_super,
.sync_fs = hfs_sync_fs,
Expand Down
8 changes: 5 additions & 3 deletions fs/hfsplus/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ static int hfsplus_write_inode(struct inode *inode,
return ret;
}

static void hfsplus_clear_inode(struct inode *inode)
static void hfsplus_evict_inode(struct inode *inode)
{
dprint(DBG_INODE, "hfsplus_clear_inode: %lu\n", inode->i_ino);
dprint(DBG_INODE, "hfsplus_evict_inode: %lu\n", inode->i_ino);
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
if (HFSPLUS_IS_RSRC(inode)) {
HFSPLUS_I(HFSPLUS_I(inode).rsrc_inode).rsrc_inode = NULL;
iput(HFSPLUS_I(inode).rsrc_inode);
Expand Down Expand Up @@ -293,7 +295,7 @@ static const struct super_operations hfsplus_sops = {
.alloc_inode = hfsplus_alloc_inode,
.destroy_inode = hfsplus_destroy_inode,
.write_inode = hfsplus_write_inode,
.clear_inode = hfsplus_clear_inode,
.evict_inode = hfsplus_evict_inode,
.put_super = hfsplus_put_super,
.write_super = hfsplus_write_super,
.sync_fs = hfsplus_sync_fs,
Expand Down
2 changes: 0 additions & 2 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ static void evict(struct inode *inode)
truncate_inode_pages(&inode->i_data, 0);
invalidate_inode_buffers(inode);
end_writeback(inode);
if (op->clear_inode)
op->clear_inode(inode);
}
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode);
Expand Down
6 changes: 4 additions & 2 deletions fs/jffs2/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,17 @@ int jffs2_statfs(struct dentry *dentry, struct kstatfs *buf)
}


void jffs2_clear_inode (struct inode *inode)
void jffs2_evict_inode (struct inode *inode)
{
/* We can forget about this inode for now - drop all
* the nodelists associated with it, etc.
*/
struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);

D1(printk(KERN_DEBUG "jffs2_clear_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode));
D1(printk(KERN_DEBUG "jffs2_evict_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode));
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
jffs2_do_clear_inode(c, f);
}

Expand Down
2 changes: 1 addition & 1 deletion fs/jffs2/os-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ extern const struct inode_operations jffs2_symlink_inode_operations;
int jffs2_setattr (struct dentry *, struct iattr *);
int jffs2_do_setattr (struct inode *, struct iattr *);
struct inode *jffs2_iget(struct super_block *, unsigned long);
void jffs2_clear_inode (struct inode *);
void jffs2_evict_inode (struct inode *);
void jffs2_dirty_inode(struct inode *inode);
struct inode *jffs2_new_inode (struct inode *dir_i, int mode,
struct jffs2_raw_inode *ri);
Expand Down
2 changes: 1 addition & 1 deletion fs/jffs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static const struct super_operations jffs2_super_operations =
.write_super = jffs2_write_super,
.statfs = jffs2_statfs,
.remount_fs = jffs2_remount_fs,
.clear_inode = jffs2_clear_inode,
.evict_inode = jffs2_evict_inode,
.dirty_inode = jffs2_dirty_inode,
.sync_fs = jffs2_sync_fs,
};
Expand Down
2 changes: 1 addition & 1 deletion fs/jffs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static void delete_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *re

void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
{
/* It's called from jffs2_clear_inode() on inode removing.
/* It's called from jffs2_evict_inode() on inode removing.
When an inode with XATTR is removed, those XATTRs must be removed. */
struct jffs2_xattr_ref *ref, *_ref;

Expand Down
Loading

0 comments on commit b57922d

Please sign in to comment.