From patchwork Tue Dec 5 15:55:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 13480354 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nabijaczleweli.xyz header.i=@nabijaczleweli.xyz header.b="ao58zSRF" Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ECA3C0 for ; Tue, 5 Dec 2023 07:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1701791717; bh=oH9HcEz06pE1YDpakXuFl0/U/9LMPB8uZ/ovRfW7Z3o=; h=Date:From:To:Subject:From; b=ao58zSRFijlnDlTUAFAL257MWdZEhP2No83bSA/Xs4fyIhOndsg4qb9wqz1mEITOr gMkLkxd2nYN9vfXx+0/fZdq1j0f+zg28ifB72/bs8r30LHLobaMUp83MQ1cy4Ndolf BmtnD0XMMjk7iMQLD1hb0YStEQherY+TIL8jslmaBctzW/oh6BsW2T/Zn5b4IHT/TE ePq3a6sURGJYLV7IhZxZDh+DdDW6WR1JqORBlsiJjMQCwczLCqG7VHh25D/4pxL+Oq k/4DjQ5etwQ+GFPTlfPYSPekXFNRRLzvLIwi2GtQcu/W8QzIU8aQac55YLpbUz5xEq tGO2cadvU3/Zg== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 6229F129CE for ; Tue, 5 Dec 2023 16:55:17 +0100 (CET) Date: Tue, 5 Dec 2023 16:55:17 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= To: linux-modules@vger.kernel.org Subject: [PATCH kmod 1/3] Add kmod_new_flags() variant of kmod_new(), with abiver 32 Message-ID: Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20231103 kmod_new() is just kmod_new_flags(..., 0) Signed-off-by: Ahelenia ZiemiaƄska --- Series based on the kmod-31 tarball. libkmod/libkmod-config.c | 3 ++- libkmod/libkmod.c | 6 ++++++ libkmod/libkmod.h | 3 +++ libkmod/libkmod.sym | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index e83621b..e24dab1 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -881,7 +881,8 @@ static int conf_files_list(struct kmod_ctx *ctx, struct kmod_list **list, } int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **p_config, - const char * const *config_paths) + const char * const *config_paths, + enum kmod_new_flags options) { struct kmod_config *config; struct kmod_list *list = NULL; diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index 1b8773c..279b35d 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -286,6 +286,12 @@ static enum kmod_file_compression_type get_kernel_compression(struct kmod_ctx *c */ KMOD_EXPORT struct kmod_ctx *kmod_new(const char *dirname, const char * const *config_paths) +{ + return kmod_new_flags(dirname, config_paths, 0); +} +KMOD_EXPORT struct kmod_ctx *kmod_new_flags(const char *dirname, + const char * const *config_paths, + enum kmod_new_flags options) { const char *env; struct kmod_ctx *ctx; diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h index 7251aa7..72cd7a2 100644 --- a/libkmod/libkmod.h +++ b/libkmod/libkmod.h @@ -30,6 +30,8 @@ extern "C" { #endif +enum kmod_new_flags {}; + /* * kmod_ctx * @@ -38,6 +40,7 @@ extern "C" { */ struct kmod_ctx; struct kmod_ctx *kmod_new(const char *dirname, const char * const *config_paths); +struct kmod_ctx *kmod_new_flags(const char *dirname, const char * const *config_paths, enum kmod_new_flags options); struct kmod_ctx *kmod_ref(struct kmod_ctx *ctx); struct kmod_ctx *kmod_unref(struct kmod_ctx *ctx); void kmod_set_log_fn(struct kmod_ctx *ctx, diff --git a/libkmod/libkmod.sym b/libkmod/libkmod.sym index 0c04fda..bd602ca 100644 --- a/libkmod/libkmod.sym +++ b/libkmod/libkmod.sym @@ -92,3 +92,8 @@ LIBKMOD_22 { global: kmod_get_dirname; } LIBKMOD_6; + +LIBKMOD_32 { +global: + kmod_new_flags; +} LIBKMOD_22;