Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fs_context.c Create Date:2022-07-28 20:13:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Add a parameter to a legacy config. We build up a comma-separated list of* options.

Proto:static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)

Type:int

Parameter:

TypeParameterName
struct fs_context *fc
struct fs_parameter *param
559  ctx = fs_private
560  size = data_size
561  len = 0
563  If strcmp(Parameter name , "source") == 0 Then
564  If The type of value here != fs_value_is_string Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Non-string source")
566  If source Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Multiple sources")
568  source = string
569  string = NULL
570  Return 0
573  If param_type == LEGACY_FS_MONOLITHIC_PARAMS Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Can't mix monolithic and individual options")
577  Case The type of value here == Value is a string
578  len = 1 + size
580  Case The type of value here == Value not given a value
581  len += strlen - Find the length of a string*@s: The string to be sized
582  Break
583  Default
584  Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Parameter type for '%s' not supported", Parameter name )
588  If len > PAGE_SIZE - 2 - size Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Cumulative options too large")
590  If strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for || The type of value here == Value is a string && memchr(string, ',', size) Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "VFS: Legacy: Option '%s' contained comma", Parameter name )
595  If Not Data page for legacy filesystems Then
596  Data page for legacy filesystems = Allocation memory
597  If Not Data page for legacy filesystems Then Return -ENOMEM
601  Data page for legacy filesystems [size++] = ','
602  len = strlen - Find the length of a string*@s: The string to be sized
603  memcpy( Data page for legacy filesystems + size, Parameter name , len)
604  size += len
605  If The type of value here == Value is a string Then
606  Data page for legacy filesystems [size++] = '='
607  memcpy( Data page for legacy filesystems + size, string, size)
608  size += size
610  Data page for legacy filesystems [size] = '\0'
611  data_size = size
612  param_type = LEGACY_FS_INDIVIDUAL_PARAMS
613  Return 0