Re: [RFC][PATCHSET] sorting out RCU-delayed stuff in ->destroy_inode()

From: David Sterba
Date: Wed Apr 17 2019 - 11:54:16 EST

On Tue, Apr 16, 2019 at 06:49:00PM +0100, Al Viro wrote:
> We have a lot of boilerplate in ->destroy_inode()
> instances, and several filesystems got the things wrong
> in that area. The patchset below attempts to deal with that.
> New method (void ->free_inode(inode)) is introduced,
> and RCU-delayed parts of ->destroy_inode() are moved there.
> The change is backwards-compatible - unmodified filesystem
> will behave as it used to. Rules:
> ->destroy_inode ->free_inode
> f g f(), rcu-delayed g()
> f NULL f()
> NULL g rcu-delayed g()
> NULL NULL rcu-delayed free_inode_nonrcu()
> IOW, NULL/NULL acts as NULL/free_inode_nonrcu.
> For a lot of filesystems ->destroy_inode() used to consist
> only of call_rcu(foo_i_callback, &inode->i_rcu). Those simply get
> rid of ->destroy_inode() and have the callback (with saner prototype)
> become their ->free_inode().

The simplified API looks good to me. For btrfs and affs bits:

Acked-by: David Sterba <dsterba@xxxxxxxx>