When called as automount -u, try using umount(8) before unmount(3). When an
NFS mount is being unmounted, umount(8) notifies the mountd server and if
successful, will also remove the associated entry from /var/db/mounttab.
This uses auto_popen() to call umount(8) in the same fashion that
automountd(8) uses auto_popen() to call mount(8) when it mounts the filesystem.
PR:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251395
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251906
Do we need a g_free_event as well? In your case in geom_disk you are going to consume it always, but my other case in g_vfs_done() is optional and I will need to be able to free it in g_vfs_close() when a g_vfs object is freed without having its underlying storage destroyed.
You could also perhaps forward declare 'struct g_event' in geom.h while leaving it opaque so that you could have static type-checking for the new functions (g_alloc_event, g_free_event, g_post_event_storage).