From: Karel Zak Date: Tue, 23 Aug 2022 11:18:54 +0000 (+0200) Subject: libmount: (optlist) add is_silent shortcut X-Git-Tag: v2.39-rc1~291 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=624061f7015a8439c019c4777a137d593d76da8a;p=thirdparty%2Futil-linux.git libmount: (optlist) add is_silent shortcut Signed-off-by: Karel Zak --- diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 5365ef84f5..95a5d10bb5 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -536,6 +536,7 @@ extern int mnt_optlist_is_remount(struct libmnt_optlist *ls); extern int mnt_optlist_is_bind(struct libmnt_optlist *ls); extern int mnt_optlist_is_move(struct libmnt_optlist *ls); extern int mnt_optlist_is_rdonly(struct libmnt_optlist *ls); +extern int mnt_optlist_is_silent(struct libmnt_optlist *ls); extern int mnt_optlist_merge_opts(struct libmnt_optlist *ls); diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index b6e7e5cd8f..b3cc90c334 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -55,7 +55,8 @@ struct libmnt_optlist { is_remount : 1, is_bind : 1, is_rdonly : 1, - is_move : 1; + is_move : 1, + is_silent : 1; }; struct libmnt_optlist *mnt_new_optlist(void) @@ -181,6 +182,8 @@ int mnt_optlist_remove_opt(struct libmnt_optlist *ls, struct libmnt_opt *opt) ls->is_rdonly = 0; else if (opt->ent->id == MS_MOVE) ls->is_move = 0; + else if (opt->ent->id == MS_SILENT) + ls->is_silent = 0; } optlist_cleanup_cache(ls, opt->map); @@ -365,6 +368,7 @@ static struct libmnt_opt *optlist_new_opt(struct libmnt_optlist *ls, else list_add_tail(&opt->opts, &ls->opts); + /* shortcuts */ if (map && ent && map == ls->linux_map) { if (ent->id & MS_PROPAGATION) ls->propagation |= ent->id; @@ -376,6 +380,8 @@ static struct libmnt_opt *optlist_new_opt(struct libmnt_optlist *ls, ls->is_rdonly = 1; else if (opt->ent->id == MS_MOVE) ls->is_move = 1; + else if (opt->ent->id == MS_SILENT) + ls->is_silent = 1; } if (ent && map) { @@ -805,6 +811,11 @@ int mnt_optlist_is_rdonly(struct libmnt_optlist *ls) return ls && ls->is_rdonly; } +int mnt_optlist_is_silent(struct libmnt_optlist *ls) +{ + return ls && ls->is_silent; +} + int mnt_opt_has_value(struct libmnt_opt *opt) {