fs->optlist = NULL;
fs->opts_age = 0;
+ fs->propagation = 0;
memset(fs, 0, sizeof(*fs));
INIT_LIST_HEAD(&fs->ents);
if (!fs || !flags)
return -EINVAL;
- *flags = 0;
-
- if (!fs->opt_fields)
- return 0;
-
- /*
- * The optional fields format is incompatible with mount options
- * ... we have to parse the field here.
- */
- *flags |= strstr(fs->opt_fields, "shared:") ? MS_SHARED : MS_PRIVATE;
+ if (!fs->propagation && fs->opt_fields) {
+ /*
+ * The optional fields format is incompatible with mount options
+ * ... we have to parse the field here.
+ */
+ fs->propagation |= strstr(fs->opt_fields, "shared:") ?
+ MS_SHARED : MS_PRIVATE;
+
+ if (strstr(fs->opt_fields, "master:"))
+ fs->propagation |= MS_SLAVE;
+ if (strstr(fs->opt_fields, "unbindable"))
+ fs->propagation |= MS_UNBINDABLE;
+ }
- if (strstr(fs->opt_fields, "master:"))
- *flags |= MS_SLAVE;
- if (strstr(fs->opt_fields, "unbindable"))
- *flags |= MS_UNBINDABLE;
+ *flags = fs->propagation;
return 0;
}
char *optstr; /* fstab[4], merged options */
char *vfs_optstr; /* mountinfo[6]: fs-independent (VFS) options */
+
char *opt_fields; /* mountinfo[7]: optional fields */
+ uint64_t propagation; /* statmmount() or parsed opt_fields */
+
char *fs_optstr; /* mountinfo[11]: fs-dependent options */
char *user_optstr; /* userspace mount options */
char *attrs; /* mount attributes */