unsigned int enabled_textdomain : 1; /* bindtextdomain() called */
unsigned int noautofs : 1; /* ignore autofs mounts */
- unsigned int is_propagation_only : 1;
struct list_head hooksets_datas; /* global hooksets data */
struct list_head hooksets_hooks; /* global hooksets data */
extern int mnt_optlist_remove_opt(struct libmnt_optlist *ls, struct libmnt_opt *opt);
extern int mnt_optlist_remove_named(struct libmnt_optlist *ls, const char *name,
const struct libmnt_optmap *map);
+extern int mnt_optlist_remove_flags(struct libmnt_optlist *ls, unsigned long flags,
+ const struct libmnt_optmap *map);
extern int mnt_optlist_next_opt(struct libmnt_optlist *ls,
struct libmnt_iter *itr, struct libmnt_opt **opt);
extern struct libmnt_opt *mnt_optlist_get_opt(struct libmnt_optlist *ls,
extern int mnt_optlist_get_propagation(struct libmnt_optlist *ls);
extern int mnt_optlist_is_propagation_only(struct libmnt_optlist *ls);
extern int mnt_opt_has_value(struct libmnt_opt *opt);
+extern int mnt_opt_set_external(struct libmnt_opt *opt, int enable);
extern int mnt_optlist_merge_opts(struct libmnt_optlist *ls);
return mnt_optlist_append_flags(ls, flags, map);
}
+int mnt_optlist_remove_flags(struct libmnt_optlist *ls, unsigned long flags,
+ const struct libmnt_optmap *map)
+{
+ struct list_head *p, *next;
+
+ if (!ls || !map)
+ return -EINVAL;
+
+ DBG(OPTLIST, ul_debugobj(ls, "remove 0x%08lx", flags));
+
+ list_for_each_safe(p, next, &ls->opts) {
+ struct libmnt_opt *opt = list_entry(p, struct libmnt_opt, opts);
+
+ if (opt->external || !opt->ent)
+ continue;
+ if (map && opt->map != map)
+ continue;
+ if (opt->ent->id & flags)
+ mnt_optlist_remove_opt(ls, opt);
+ }
+ return 0;
+}
+
int mnt_optlist_insert_flags(struct libmnt_optlist *ls, unsigned long flags,
const struct libmnt_optmap *map,
unsigned long after,
return opt && opt->value;
}
+int mnt_opt_set_external(struct libmnt_opt *opt, int enable)
+{
+ if (!opt)
+ return -EINVAL;
+ opt->external = enable ? 1 : 0;
+ return 0;
+}
+
#ifdef TEST_PROGRAM
static int mk_optlist(struct libmnt_optlist **ol, const char *optstr)