fs/xfs/xfs_message.c
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_message.c
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_message.c- Extension
.c- Size
- 2984 bytes
- Lines
- 161
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xfs_platform.hxfs_fs.hxfs_error.hxfs_shared.hxfs_format.hxfs_trans_resv.hxfs_mount.h
Detected Declarations
function Copyrightfunction xfs_printk_levelfunction _xfs_alert_tagfunction asswarnfunction assfailfunction xfs_hex_dumpfunction xfs_buf_alert_ratelimitedfunction xfs_warn_experimental
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2011 Red Hat, Inc. All Rights Reserved.
*/
#include "xfs_platform.h"
#include "xfs_fs.h"
#include "xfs_error.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
/*
* XFS logging functions
*/
static void
__xfs_printk(
const char *level,
const struct xfs_mount *mp,
struct va_format *vaf)
{
if (mp && mp->m_super) {
printk("%sXFS (%s): %pV\n", level, mp->m_super->s_id, vaf);
return;
}
printk("%sXFS: %pV\n", level, vaf);
}
void
xfs_printk_level(
const char *kern_level,
const struct xfs_mount *mp,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int level;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
__xfs_printk(kern_level, mp, &vaf);
va_end(args);
if (!kstrtoint(kern_level, 0, &level) &&
level <= LOGLEVEL_ERR &&
xfs_error_level >= XFS_ERRLEVEL_HIGH)
xfs_stack_trace();
}
void
_xfs_alert_tag(
const struct xfs_mount *mp,
uint32_t panic_tag,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int do_panic = 0;
if (xfs_panic_mask && (xfs_panic_mask & panic_tag)) {
xfs_alert(mp, "Transforming an alert into a BUG.");
do_panic = 1;
}
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
__xfs_printk(KERN_ALERT, mp, &vaf);
va_end(args);
BUG_ON(do_panic);
}
void
asswarn(
struct xfs_mount *mp,
char *expr,
char *file,
int line)
{
xfs_warn(mp, "Assertion failed: %s, file: %s, line: %d",
expr, file, line);
WARN_ON(1);
}
Annotation
- Immediate include surface: `xfs_platform.h`, `xfs_fs.h`, `xfs_error.h`, `xfs_shared.h`, `xfs_format.h`, `xfs_trans_resv.h`, `xfs_mount.h`.
- Detected declarations: `function Copyright`, `function xfs_printk_level`, `function _xfs_alert_tag`, `function asswarn`, `function assfail`, `function xfs_hex_dump`, `function xfs_buf_alert_ratelimited`, `function xfs_warn_experimental`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.