函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\initramfs.c Create Date:2022-07-27 15:17:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:unpack_to_rootfs

函数原型:static char *__init unpack_to_rootfs(char *buf, unsigned long len)

返回类型:char

参数:

类型参数名称
char *buf
unsigned longlen
449  static __initdata char msg_buf[64]
451  header_buf等于开辟内存
452  symlink_buf等于开辟内存
453  name_buf等于开辟内存
455  如果非header_buf或非symlink_buf或非name_bufpanic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
458  state = Start
459  this_header等于0
460  message = NULL
461  当非messagelen循环
462  saved_offset等于this_header
463  如果buf恒等于'0'且非this_header按位与3的值则
464  state = Start
465  written等于write_buffer(buf, len)
466  buf加等于written
467  len减等于written
468  继续下一循环
470  如果非buf
471  buf自加
472  len自减
473  this_header自加
474  继续下一循环
476  this_header等于0
477  decompress等于decompress_method(buf, len, & compress_name)
478  pr_debug("Detected %s compressed data\n", compress_name)
479  如果decompress
482  如果reserror("decompressor failed")
484  否则如果compress_name
485  如果非message
491  否则error("invalid magic at start of compressed archive")
493  如果(state != Reset)则error("junk at the end of compressed archive")
495  this_header等于saved_offsetdex of next byte to be processed in inbuf
496  buf加等于dex of next byte to be processed in inbuf
497  len减等于dex of next byte to be processed in inbuf
499  dir_utime()
500  释放内存
501  释放内存
502  释放内存
503  返回:message
调用者
名称描述
populate_rootfs