Files
cubelinux-kernel/drivers/md/dm-audit.h
T
Greg Kroah-Hartman 598cf27219 Linux 6.19.3
Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Brett A C Sheffield <bacs@librecast.net>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-19 16:33:27 +01:00

67 lines
1.8 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Creating audit records for mapped devices.
*
* Copyright (C) 2021 Fraunhofer AISEC. All rights reserved.
*
* Authors: Michael Weiß <michael.weiss@aisec.fraunhofer.de>
*/
#ifndef DM_AUDIT_H
#define DM_AUDIT_H
#include <linux/device-mapper.h>
#include <linux/audit.h>
#ifdef CONFIG_DM_AUDIT
void dm_audit_log_bio(const char *dm_msg_prefix, const char *op,
struct bio *bio, sector_t sector, int result);
/*
* dm_audit_log_ti() is not intended to be used directly in dm modules,
* the wrapper functions below should be called by dm modules instead.
*/
void dm_audit_log_ti(int audit_type, const char *dm_msg_prefix, const char *op,
struct dm_target *ti, int result);
static inline void dm_audit_log_ctr(const char *dm_msg_prefix,
struct dm_target *ti, int result)
{
dm_audit_log_ti(AUDIT_DM_CTRL, dm_msg_prefix, "ctr", ti, result);
}
static inline void dm_audit_log_dtr(const char *dm_msg_prefix,
struct dm_target *ti, int result)
{
dm_audit_log_ti(AUDIT_DM_CTRL, dm_msg_prefix, "dtr", ti, result);
}
static inline void dm_audit_log_target(const char *dm_msg_prefix, const char *op,
struct dm_target *ti, int result)
{
dm_audit_log_ti(AUDIT_DM_EVENT, dm_msg_prefix, op, ti, result);
}
#else
static inline void dm_audit_log_bio(const char *dm_msg_prefix, const char *op,
struct bio *bio, sector_t sector,
int result)
{
}
static inline void dm_audit_log_target(const char *dm_msg_prefix,
const char *op, struct dm_target *ti,
int result)
{
}
static inline void dm_audit_log_ctr(const char *dm_msg_prefix,
struct dm_target *ti, int result)
{
}
static inline void dm_audit_log_dtr(const char *dm_msg_prefix,
struct dm_target *ti, int result)
{
}
#endif
#endif