fs/smb/client/cifs_debug.c
Source file repositories/reference/linux-study-clean/fs/smb/client/cifs_debug.c
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/client/cifs_debug.c- Extension
.c- Size
- 36840 bytes
- Lines
- 1298
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs.hlinux/string.hlinux/ctype.hlinux/kstrtox.hlinux/module.hlinux/proc_fs.hlinux/uaccess.huapi/linux/ethtool.hcifsglob.hcifsproto.hcifs_debug.hcifsfs.hfs_context.hdfs_cache.hsmbdirect.hcifs_swn.hcached_dir.h
Detected Declarations
function Copyrightfunction cifs_dump_midsfunction cifs_debug_tconfunction cifs_dump_channelfunction cifs_dump_ifacefunction cifs_debug_files_proc_showfunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction cifs_debug_dirs_proc_showfunction list_for_eachfunction list_for_eachfunction list_for_each_entryfunction cifs_debug_dirs_proc_openfunction cifs_debug_dirs_proc_writefunction list_for_each_entryfunction cifs_debug_data_proc_showfunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction cifs_stats_proc_writefunction list_for_each_entryfunction list_for_each_entryfunction list_for_each_entryfunction cifs_stats_proc_showfunction list_for_each_entryfunction list_for_each_entryfunction cifs_stats_proc_openfunction cifs_proc_initfunction cifs_proc_cleanfunction cifsFYI_proc_showfunction cifsFYI_proc_openfunction cifsFYI_proc_writefunction cifs_linux_ext_proc_showfunction cifs_linux_ext_proc_openfunction cifs_linux_ext_proc_writefunction cifs_lookup_cache_proc_showfunction cifs_lookup_cache_proc_openfunction cifs_lookup_cache_proc_writefunction traceSMB_proc_showfunction traceSMB_proc_openfunction traceSMB_proc_writefunction cifs_security_flags_proc_showfunction cifs_security_flags_proc_openfunction cifs_security_flags_handle_must_flagsfunction cifs_security_flags_proc_writefunction cifs_mount_params_proc_show
Annotated Snippet
if (mid_entry->resp_buf) {
server->ops->dump_detail(mid_entry->resp_buf,
mid_entry->response_pdu_len, server);
cifs_dump_mem("existing buf: ", mid_entry->resp_buf, 62);
}
}
spin_unlock(&server->mid_queue_lock);
#endif /* CONFIG_CIFS_DEBUG2 */
}
#ifdef CONFIG_PROC_FS
static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
{
__u32 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
seq_printf(m, "%s Mounts: %d ", tcon->tree_name, tcon->tc_count);
if (tcon->nativeFileSystem)
seq_printf(m, "Type: %s ", tcon->nativeFileSystem);
seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x\n\tPathComponentMax: %d Status: %d",
le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
le32_to_cpu(tcon->fsAttrInfo.Attributes),
le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
tcon->status);
if (dev_type == FILE_DEVICE_DISK)
seq_puts(m, " type: DISK ");
else if (dev_type == FILE_DEVICE_CD_ROM)
seq_puts(m, " type: CDROM ");
else
seq_printf(m, " type: %d ", dev_type);
seq_printf(m, "Serial Number: 0x%x", tcon->vol_serial_number);
if ((tcon->seal) ||
(tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) ||
(tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA))
seq_puts(m, " encrypted");
if (tcon->nocase)
seq_printf(m, " nocase");
if (tcon->unix_ext)
seq_printf(m, " POSIX Extensions");
if (tcon->ses->server->ops->dump_share_caps)
tcon->ses->server->ops->dump_share_caps(m, tcon);
if (tcon->use_witness)
seq_puts(m, " Witness");
if (tcon->broken_sparse_sup)
seq_puts(m, " nosparse");
if (tcon->need_reconnect)
seq_puts(m, "\tDISCONNECTED ");
spin_lock(&tcon->tc_lock);
if (tcon->origin_fullpath) {
seq_printf(m, "\n\tDFS origin fullpath: %s",
tcon->origin_fullpath);
}
spin_unlock(&tcon->tc_lock);
seq_putc(m, '\n');
}
static void
cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
{
struct TCP_Server_Info *server = chan->server;
if (!server) {
seq_printf(m, "\n\n\t\tChannel: %d DISABLED", i+1);
return;
}
seq_printf(m, "\n\n\t\tChannel: %d ConnectionId: 0x%llx"
"\n\t\tNumber of credits: %d,%d,%d Dialect 0x%x"
"\n\t\tTCP status: %d Instance: %d"
"\n\t\tLocal Users To Server: %d SecMode: 0x%x Req On Wire: %d"
"\n\t\tIn Send: %d In MaxReq Wait: %d",
i+1, server->conn_id,
server->credits,
server->echo_credits,
server->oplock_credits,
server->dialect,
server->tcpStatus,
server->reconnect_instance,
server->srv_count,
server->sec_mode,
in_flight(server),
atomic_read(&server->in_send),
atomic_read(&server->num_waiters));
#ifdef CONFIG_NET_NS
if (server->net)
seq_printf(m, " Net namespace: %u ", server->net->ns.inum);
#endif /* NET_NS */
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/string.h`, `linux/ctype.h`, `linux/kstrtox.h`, `linux/module.h`, `linux/proc_fs.h`, `linux/uaccess.h`, `uapi/linux/ethtool.h`.
- Detected declarations: `function Copyright`, `function cifs_dump_mids`, `function cifs_debug_tcon`, `function cifs_dump_channel`, `function cifs_dump_iface`, `function cifs_debug_files_proc_show`, `function list_for_each_entry`, `function list_for_each_entry`, `function list_for_each_entry`, `function cifs_debug_dirs_proc_show`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.