Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Returns allocated NULL-terminated string containing pathname,* with special characters escaped, able to be safely logged. If* there is an error, the leading character will be "<".

Proto:char *kstrdup_quotable_file(struct file *file, gfp_t gfp)

Type:char

Parameter:

TypeParameterName
struct file *file
gfp_tgfp
634  If Not file Then Return kstrdup("<unknown>", gfp)
638  temp = kmalloc(# chars in a path name including nul + 11, GFP_KERNEL)
639  If Not temp Then Return kstrdup("<no_memory>", gfp)
642  pathname = file_path(file, temp, # chars in a path name including nul + 11)
643  If IS_ERR(pathname) Then pathname = kstrdup("<too_long>", gfp)
645  Else pathname = Return an allocated string that has been escaped of special characters* and double quotes, making it safe to log in quotes.
648  kfree(temp)
649  Return pathname