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:logfc - Log a message to a filesystem context*@fc: The filesystem context to log to.*@fmt: The format of the buffer.

Proto:void logfc(struct fs_context *fc, const char *fmt, ...)

Type:void

Parameter:

TypeParameterName
struct fs_context *fc
const char *fmt
390  store_failure[] = "OOM: Can't store error string"
391  struct fc_log * log = fc ? log : NULL
397  va_start(va, fmt)
398  If Not 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 Then
399  p = fmt
400  Go to unformatted_string
402  If strcmp(fmt, "%s") == 0 Then
403  p = va_arg(va, constchar * )
404  Go to unformatted_string
407  q = Simplified asprintf.
408  copied_string :
409  If Not q Then Go to store_failure
411  freeable = 1
412  Go to store_string
414  unformatted_string :
415  If p >= __start_rodata && p < __end_rodata Then Go to const_string
418  If log && within_module_core((unsignedlong)p, Owner module for strings that don't then need freeing ) Then Go to const_string
420  q = kstrdup - allocate space for and copy an existing string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Return: newly allocated copy of @s or %NULL in case of error
421  Go to copied_string
423  store_failure :
424  p = store_failure
425  const_string :
426  q = p
427  freeable = 0
428  store_string :
429  If Not log Then
431  Case fmt[0] == 'w'
433  Break
434  Case fmt[0] == 'e'
436  Break
437  Default
439  Break
441  If freeable Then kfree(q)
443  Else
444  logsize = ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(buffer)
447  index = Insertion index in buffer[] & logsize - 1
448  BUILD_BUG_ON - break compile if a condition is true( size of Insertion index in buffer[] != sizeof(u8) || size of Removal index in buffer[] != sizeof(u8))
457  buffer[index] = q
458  Mask of kfree'able items in buffer[] &= ~(1 << index)
459  Mask of kfree'able items in buffer[] |= freeable << index
460  Insertion index in buffer[] ++
462  va_end(va)