fs/smb/server/smb_common.c

Source file repositories/reference/linux-study-clean/fs/smb/server/smb_common.c

File Facts

System
Linux kernel
Corpus path
fs/smb/server/smb_common.c
Extension
.c
Size
19529 bytes
Lines
842
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

struct smb_protocol {
	int		index;
	char		*name;
	char		*prot;
	__u16		prot_id;
};

static struct smb_protocol smb1_protos[] = {
	{
		SMB21_PROT,
		"\2SMB 2.1",
		"SMB2_10",
		SMB21_PROT_ID
	},
	{
		SMB2X_PROT,
		"\2SMB 2.???",
		"SMB2_22",
		SMB2X_PROT_ID
	},
};

static struct smb_protocol smb2_protos[] = {
	{
		SMB21_PROT,
		"\2SMB 2.1",
		"SMB2_10",
		SMB21_PROT_ID
	},
	{
		SMB30_PROT,
		"\2SMB 3.0",
		"SMB3_00",
		SMB30_PROT_ID
	},
	{
		SMB302_PROT,
		"\2SMB 3.02",
		"SMB3_02",
		SMB302_PROT_ID
	},
	{
		SMB311_PROT,
		"\2SMB 3.1.1",
		"SMB3_11",
		SMB311_PROT_ID
	},
};

unsigned int ksmbd_server_side_copy_max_chunk_count(void)
{
	return 256;
}

unsigned int ksmbd_server_side_copy_max_chunk_size(void)
{
	return (2U << 30) - 1;
}

unsigned int ksmbd_server_side_copy_max_total_size(void)
{
	return (2U << 30) - 1;
}

inline int ksmbd_min_protocol(void)
{
	return SMB21_PROT;
}

inline int ksmbd_max_protocol(void)
{
	return SMB311_PROT;
}

static const struct {
	int version;
	const char *string;
} version_strings[] = {
	{SMB2_PROT, SMB20_VERSION_STRING},
	{SMB21_PROT, SMB21_VERSION_STRING},
	{SMB30_PROT, SMB30_VERSION_STRING},
	{SMB302_PROT, SMB302_VERSION_STRING},
	{SMB311_PROT, SMB311_VERSION_STRING},
};

const char *ksmbd_get_protocol_string(int version)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(version_strings); i++) {

Annotation

Implementation Notes