]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: (mount) use independent hooks
authorKarel Zak <kzak@redhat.com>
Wed, 21 Sep 2022 15:28:36 +0000 (17:28 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
commit6e9423048932e2f879c04576b0c8300487fff22e
treeeee8af4c7b2d65d2c6afd616fb42e3609272ec59
parent277e78d7151a5c480a2bb4b4a66288e5d26a79b3
libmount: (mount) use independent hooks

It seems better to reuse functions (hooks) to implement various
ways the mount is done. For example, attach to the tree is used
for move, bind, and new mount; set VFS flags is usable for all
operations, etc.

Complete mount(8) is a set (chain) of hooks that is possible to mix to
get the wanted result.

The new API allow for example things like

mount --move /A /B -oro,noexec

because it's

- open_tree()
- mount_setattr()
- move_tree()

Note that the hooks allow extend it to new functionality  without core
code modification (for example, X-mount.idmap= append a new hook to
call another mount_setattr()).

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/hook_mount.c