Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk.c Create Date:2022-07-28 10:05:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:devkmsg_write

Proto:static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)

Type:ssize_t

Parameter:

TypeParameterName
struct kiocb *iocb
struct iov_iter *from
808  level = default_message_loglevel
809  facility = 1
810  file = ki_filp
811  user = needed for tty driver, and maybe others
812  len = iov_iter_count(from)
813  ret = len
815  If Not user || len > LOG_LINE_MAX Then Return -EINVAL
819  If devkmsg_log & DEVKMSG_LOG_MASK_OFF Then Return len
823  If Not (devkmsg_log & DEVKMSG_LOG_MASK_ON) Then
824  If Not __ratelimit - rate limiting*@rs: ratelimit_state data*@func: name of calling function* This enforces a rate limit: not more than @rs->burst callbacks* in every @rs->interval* RETURNS:* 0 means callbacks will be suppressed.* 1 means go ahead and do it. Then Return ret
828  buf = Allocation memory
829  If (buf == NULL) Then Return -ENOMEM
832  buf[len] = '\0'
833  If Not copy_from_iter_full(buf, len, from) Then
834  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
835  Return -EFAULT
847  line = buf
848  If line[0] == '<' Then
849  char * endp = NULL
852  u = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
853  If endp && endp[0] == '>' Then
854  level = LOG_LEVEL(u)
855  If LOG_FACILITY(u) != 0 Then facility = LOG_FACILITY(u)
857  endp++
858  len -= endp - line
859  line = endp
863  devkmsg_emit(facility, level, "%s", line)
864  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
865  Return ret