]> git.ipfire.org Git - thirdparty/systemd.git/commit
recursedir: introduce new RECURSE_DIR_UNLINK callback return value
authorLennart Poettering <lennart@poettering.net>
Fri, 28 Nov 2025 15:12:22 +0000 (16:12 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 21 Dec 2025 06:04:42 +0000 (07:04 +0100)
commitb6aa78f707a7957237d9a479fca615cad0545cbd
tree6a419b9d3d311659bbfd4ff7ea85501d6d796575
parent65d173a02d4eeca9ad28c8d7d0c4f6a47d465503
recursedir: introduce new RECURSE_DIR_UNLINK callback return value

This introduces RECURSE_DIR_UNLINK + RECURSE_DIR_UNLINK_GRACEFUL as new
return values for recurse_dir() callbacks. If either is returned the
inode currently processed will be removed and iteration continues with
the next item.

This is useful to have in the recurse_dir() mechanism itself (rather
than implement in the callback itself), due to ordering: we want to pin
the inodes via an fd while calling the callbacks, but we have to close
it before removal of the inodes. By moving this into the recurse_dir()
infra, we can implement this easily.
src/basic/recurse-dir.c
src/basic/recurse-dir.h