new inode method: ->free_inode()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 10 Apr 2019 18:43:44 +0000 (14:43 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 May 2019 02:37:39 +0000 (22:37 -0400)
commitfdb0da89f4ba0c74d7d3b9e6f471e96a5766820b
tree3c82eb1fe04568315a76d03ec86617e206b12a41
parentad7999cd701e4e058765d35cf5274ee16801e986
new inode method: ->free_inode()

A lot of ->destroy_inode() instances end with call_rcu() of a callback
that does RCU-delayed part of freeing.  Introduce a new method for
doing just that, with saner signature.

Rules:
->destroy_inode ->free_inode
f g immediate call of f(),
RCU-delayed call of g()
f NULL immediate call of f(),
no RCU-delayed calls
NULL g RCU-delayed call of g()
NULL NULL RCU-delayed default freeing

IOW, NULL ->free_inode gives the same behaviour as now.

Note that NULL, NULL is equivalent to NULL, free_inode_nonrcu; we could
mandate the latter form, but that would have very little benefit beyond
making rules a bit more symmetric.  It would break backwards compatibility,
require extra boilerplate and expected semantics for (NULL, NULL) pair
would have no use whatsoever...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Documentation/filesystems/Locking
Documentation/filesystems/porting
fs/inode.c
include/linux/fs.h