Skip to content

Commit be7ce41

Browse files
author
Al Viro
committed
New method - evict_inode()
Hybrid of ->clear_inode() and ->delete_inode(); if present, does all fs work to be done when in-core inode is about to be gone, for whatever reason. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b4272d4 commit be7ce41

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎fs/inode.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ static void evict(struct inode *inode, int delete)
325325
{
326326
const struct super_operations *op = inode->i_sb->s_op;
327327

328-
if (delete && op->delete_inode) {
328+
if (op->evict_inode) {
329+
op->evict_inode(inode);
330+
} else if (delete && op->delete_inode) {
329331
op->delete_inode(inode);
330332
} else {
331333
if (inode->i_data.nrpages)

‎include/linux/fs.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,7 @@ struct super_operations {
15631563
void (*dirty_inode) (struct inode *);
15641564
int (*write_inode) (struct inode *, struct writeback_control *wbc);
15651565
void (*drop_inode) (struct inode *);
1566+
void (*evict_inode) (struct inode *);
15661567
void (*delete_inode) (struct inode *);
15671568
void (*put_super) (struct super_block *);
15681569
void (*write_super) (struct super_block *);

0 commit comments

Comments
 (0)