summaryrefslogtreecommitdiff
path: root/src/core/mount-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-03 21:12:06 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-03 21:12:06 +0100
commitd58669f08abefcc4300e1f476b6482e5f7e87098 (patch)
tree531ee4511bd8c847f91c6ea5f328e5ced3c4bd13 /src/core/mount-setup.c
parent37723f806ea80a5d1b257507f1a14db888ea93c0 (diff)
parent400fac060987d4d1c30a3bee19676edd5adf986c (diff)
Merge pull request #2512 from 0xAX/mount-setup
mount-setup: introduce mount_points_setup
Diffstat (limited to 'src/core/mount-setup.c')
-rw-r--r--src/core/mount-setup.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index d73b319c5d..7a06c24016 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -199,18 +199,14 @@ static int mount_one(const MountPoint *p, bool relabel) {
return 1;
}
-int mount_setup_early(void) {
+static int mount_points_setup(unsigned n, bool loaded_policy) {
unsigned i;
int r = 0;
- assert_cc(N_EARLY_MOUNT <= ELEMENTSOF(mount_table));
-
- /* Do a minimal mount of /proc and friends to enable the most
- * basic stuff, such as SELinux */
- for (i = 0; i < N_EARLY_MOUNT; i ++) {
+ for (i = 0; i < n; i ++) {
int j;
- j = mount_one(mount_table + i, false);
+ j = mount_one(mount_table + i, loaded_policy);
if (j != 0 && r >= 0)
r = j;
}
@@ -218,6 +214,14 @@ int mount_setup_early(void) {
return r;
}
+int mount_setup_early(void) {
+ assert_cc(N_EARLY_MOUNT <= ELEMENTSOF(mount_table));
+
+ /* Do a minimal mount of /proc and friends to enable the most
+ * basic stuff, such as SELinux */
+ return mount_points_setup(N_EARLY_MOUNT, false);
+}
+
int mount_cgroup_controllers(char ***join_controllers) {
_cleanup_set_free_free_ Set *controllers = NULL;
int r;
@@ -352,16 +356,9 @@ static int nftw_cb(
#endif
int mount_setup(bool loaded_policy) {
- unsigned i;
int r = 0;
- for (i = 0; i < ELEMENTSOF(mount_table); i ++) {
- int j;
-
- j = mount_one(mount_table + i, loaded_policy);
- if (j != 0 && r >= 0)
- r = j;
- }
+ r = mount_points_setup(ELEMENTSOF(mount_table), loaded_policy);
if (r < 0)
return r;