[systemd-commits] 3 commits - src/core
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Feb 25 19:34:24 PST 2014
src/core/mount.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
New commits:
commit aef831369cd2a7a1bd4a58dd96ff8628ed6a85f9
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 26 04:28:37 2014 +0100
mount: don't fire PropertiesChanged signals for mounts that are stopped
diff --git a/src/core/mount.c b/src/core/mount.c
index 98812c9..7a92e1c 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1679,20 +1679,20 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
Mount *mount = MOUNT(u);
if (!mount->is_mounted) {
- /* This has just been unmounted. */
mount->from_proc_self_mountinfo = false;
switch (mount->state) {
case MOUNT_MOUNTED:
+ /* This has just been unmounted by
+ * somebody else, follow the state
+ * change. */
mount_enter_dead(mount, MOUNT_SUCCESS);
break;
default:
- mount_set_state(mount, mount->state);
break;
-
}
} else if (mount->just_mounted || mount->just_changed) {
@@ -1703,6 +1703,9 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
case MOUNT_DEAD:
case MOUNT_FAILED:
+ /* This has just been mounted by
+ * somebody else, follow the state
+ * change. */
mount_enter_mounted(mount, MOUNT_SUCCESS);
break;
commit ff5f34d08c191c326c41a083745522383ac86cae
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 26 04:27:50 2014 +0100
mount: don't send out PropertiesChanged message if actually nothing got changed
diff --git a/src/core/mount.c b/src/core/mount.c
index b35e507..98812c9 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1390,7 +1390,7 @@ static int mount_add_one(
_cleanup_free_ char *e = NULL, *w = NULL, *o = NULL, *f = NULL;
bool load_extras = false;
MountParameters *p;
- bool delete;
+ bool delete, changed = false;
Unit *u;
int r;
@@ -1458,6 +1458,7 @@ static int mount_add_one(
}
unit_add_to_load_queue(u);
+ changed = true;
} else {
delete = false;
@@ -1476,6 +1477,7 @@ static int mount_add_one(
/* Load in the extras later on, after we
* finished initialization of the unit */
load_extras = true;
+ changed = true;
}
}
@@ -1488,10 +1490,16 @@ static int mount_add_one(
}
p = &MOUNT(u)->parameters_proc_self_mountinfo;
+
+ changed = changed ||
+ !streq_ptr(p->options, options) ||
+ !streq_ptr(p->what, what) ||
+ !streq_ptr(p->fstype, fstype);
+
if (set_flags) {
MOUNT(u)->is_mounted = true;
MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo;
- MOUNT(u)->just_changed = !streq_ptr(p->options, o);
+ MOUNT(u)->just_changed = changed;
}
MOUNT(u)->from_proc_self_mountinfo = true;
@@ -1514,7 +1522,8 @@ static int mount_add_one(
goto fail;
}
- unit_add_to_dbus_queue(u);
+ if (changed)
+ unit_add_to_dbus_queue(u);
return 0;
commit dd7a22a990023f083ef488177fb46c9c4667009b
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 26 03:46:04 2014 +0100
mount: minor modernization
diff --git a/src/core/mount.c b/src/core/mount.c
index 814674a..b35e507 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1479,9 +1479,10 @@ static int mount_add_one(
}
}
- if (!(w = strdup(what)) ||
- !(o = strdup(options)) ||
- !(f = strdup(fstype))) {
+ w = strdup(what);
+ o = strdup(options);
+ f = strdup(fstype);
+ if (!w || !o || !f) {
r = -ENOMEM;
goto fail;
}
More information about the systemd-commits
mailing list