fs/befs/debug.c
Source file repositories/reference/linux-study-clean/fs/befs/debug.c
File Facts
- System
- Linux kernel
- Corpus path
fs/befs/debug.c- Extension
.c- Size
- 7288 bytes
- Lines
- 263
- 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
linux/stdarg.hlinux/string.hlinux/spinlock.hlinux/kernel.hlinux/fs.hlinux/slab.hbefs.h
Detected Declarations
function Copyrightfunction befs_warningfunction befs_debugfunction befs_dump_inodefunction befs_dump_super_blockfunction befs_dump_small_datafunction befs_dump_index_entryfunction befs_dump_index_node
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/befs/debug.c
*
* Copyright (C) 2001 Will Dyson (will_dyson at pobox.com)
*
* With help from the ntfs-tng driver by Anton Altparmakov
*
* Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
*
* debug functions
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#ifdef __KERNEL__
#include <linux/stdarg.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/slab.h>
#endif /* __KERNEL__ */
#include "befs.h"
void
befs_error(const struct super_block *sb, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
pr_err("(%s): %pV\n", sb->s_id, &vaf);
va_end(args);
}
void
befs_warning(const struct super_block *sb, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
pr_warn("(%s): %pV\n", sb->s_id, &vaf);
va_end(args);
}
void
befs_debug(const struct super_block *sb, const char *fmt, ...)
{
#ifdef CONFIG_BEFS_DEBUG
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
pr_debug("(%s): %pV\n", sb->s_id, &vaf);
va_end(args);
#endif //CONFIG_BEFS_DEBUG
}
void
befs_dump_inode(const struct super_block *sb, befs_inode *inode)
{
#ifdef CONFIG_BEFS_DEBUG
befs_block_run tmp_run;
befs_debug(sb, "befs_inode information");
befs_debug(sb, " magic1 %08x", fs32_to_cpu(sb, inode->magic1));
tmp_run = fsrun_to_cpu(sb, inode->inode_num);
befs_debug(sb, " inode_num %u, %hu, %hu",
tmp_run.allocation_group, tmp_run.start, tmp_run.len);
befs_debug(sb, " uid %u", fs32_to_cpu(sb, inode->uid));
befs_debug(sb, " gid %u", fs32_to_cpu(sb, inode->gid));
befs_debug(sb, " mode %08x", fs32_to_cpu(sb, inode->mode));
befs_debug(sb, " flags %08x", fs32_to_cpu(sb, inode->flags));
befs_debug(sb, " create_time %llu",
Annotation
- Immediate include surface: `linux/stdarg.h`, `linux/string.h`, `linux/spinlock.h`, `linux/kernel.h`, `linux/fs.h`, `linux/slab.h`, `befs.h`.
- Detected declarations: `function Copyright`, `function befs_warning`, `function befs_debug`, `function befs_dump_inode`, `function befs_dump_super_block`, `function befs_dump_small_data`, `function befs_dump_index_entry`, `function befs_dump_index_node`.
- 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.