summaryrefslogtreecommitdiff
path: root/include/linux/kernfs.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2022-08-28 08:04:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-01 19:08:44 +0300
commit2d7f9f8c1815707e9ddb454648a523efc67a04d3 (patch)
treed630d65175bf01dcfc4fa2119b86e53378fc8733 /include/linux/kernfs.h
parentbdb2fd7fc56e197a63c0b0e7e07d25d5e20e7c72 (diff)
downloadlinux-2d7f9f8c1815707e9ddb454648a523efc67a04d3.tar.xz
kernfs: Improve kernfs_drain() and always call on removal
__kernfs_remove() was skipping draining based on KERNFS_ACTIVATED - whether the node has ever been activated since creation. Instead, update it to always call kernfs_drain() which now drains or skips based on the precise drain conditions. This ensures that the nodes will be deactivated and drained regardless of their states. This doesn't make meaningful difference now but will enable deactivating and draining nodes dynamically by making removals safe when racing those operations. While at it, drop / update comments. v2: Fix the inverted test on kernfs_should_drain_open_files() noted by Chengming. This was fixed by the next unrelated patch in the previous posting. Cc: Chengming Zhou <zhouchengming@bytedance.com> Tested-by: Chengming Zhou <zhouchengming@bytedance.com> Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com> Signed-off-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20220828050440.734579-6-tj@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/kernfs.h')
0 files changed, 0 insertions, 0 deletions