+void mount_fd_event(Manager *m, int events) {
+ Meta *meta;
+ int r;
+
+ assert(m);
+ assert(events == EPOLLERR);
+
+ /* The manager calls this for every fd event happening on the
+ * /proc/self/mountinfo file, which informs us about mounting
+ * table changes */
+
+ if ((r = mount_load_proc_self_mountinfo(m, true)) < 0) {
+ log_error("Failed to reread /proc/self/mountinfo: %s", strerror(-errno));
+ return;
+ }
+
+ manager_dispatch_load_queue(m);
+
+ LIST_FOREACH(units_per_type, meta, m->units_per_type[UNIT_MOUNT]) {
+ Mount *mount = (Mount*) meta;
+
+ if (mount->just_created && mount->state == MOUNT_DEAD)
+ mount_set_state(mount, MOUNT_MOUNTED);
+ else if (!mount->still_exists && mount->state == MOUNT_MOUNTED) {
+ mount_set_state(mount, MOUNT_DEAD);
+ mount->from_proc_self_mountinfo = false;
+ }
+
+ /* Clear the flags for later calls */
+ mount->just_created = false;
+ mount->still_exists = false;
+ }
+}
+