Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Allocate the XZ decoder state and register the character device.

Proto:static int __init xz_dec_test_init(void)

Type:int

Parameter:Nothing

178  static const struct file_operations fileops = {owner = THIS_MODULE, open = & xz_dec_test_open, release = & xz_dec_test_release, write = & Decode the data given to us from the userspace. CRC32 of the uncompressed* data is calculated and is printed at the end of successful decoding. The* uncompressed data isn't stored anywhere for further use.* The }
185  state = xz_dec_init(XZ_PREALLOC, Maximum supported dictionary size )
186  If (state == NULL) Then Return -ENOMEM
189  Dynamically allocated device major number = register_chrdev(0, Device name to pass to register_chrdev(). , & fileops)
190  If Dynamically allocated device major number < 0 Then
191  xz_dec_end(state)
192  Return Dynamically allocated device major number
195  printk(formational Device name to pass to register_chrdev(). ": module loaded\n")
196  printk(formational Device name to pass to register_chrdev(). ": Create a device node with 'mknod "Device name to pass to register_chrdev(). " c %d 0' and write .xz files to it.\n", Dynamically allocated device major number )
199  Return 0