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.

Dependency Surface

Detected Declarations

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

Implementation Notes