Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the core data structure of the ext2 file system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

What is the core data structure of the ext2 file system? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

0x01 information class

It is mainly defined in the ext2.h header file.

The name means the layout of the inode on the struct ext2_inode disk, which is used to read and write inode. The standard inode corresponding to VFS can be generated based on this inode. Struct ext2_super_block corresponds to the actual super block of ext2 on disk and can be converted into a standard super block of VFS, which is used to represent the unique information of ext2 as above. There is only one file system and can have multiple backups. Struct struct ext2_sb_info is also used to extend super blocks. Struct ext2_dir_entry/struct ext2_dir_entry_2 catalog entry. The representation of the _ 2 suffix is a new version, and the two are compatible with 8bit that is not used after name_len. Inode extended by struct ext2_inode_info. Some information in ext2_inode cannot be stored in the standard inode in VFS, but it provides a means of extension. Ext2_node_info is used to extend and save this additional information. Information about the reservation window in the struct ext2_reserve_window block allocation implementation. The red-black tree node of the struct ext2_reserve_window_node reservation window. Struct ext2_block_alloc_info block allocation information. 1.1 question

Why are there two types, memory and disk?

The benchmark for mutual indexing between data on disk is block id, or block id. When the program is running, the information in the computer is saved in memory, and the reference to each other is the memory address. When saving and reading information, you need to do a conversion, so there are two types. One corresponds to the information on disk, which is used when reading and writing; the other is information in memory, which is used when processing information.

0x02 method class

A method class defines a set of methods according to the requirements of VFS, which can be understood as hook functions.

The name means the collection of operation methods for directories in struct file_operations ext2_dir_operationsext2. Struct inode_operations ext2_file_inode_operations file inode operation method collection, modify file properties, struct file_operations ext2_file_operations file operation method collection. Struct iomap_ops ext2_iomap_opsiomap handles a collection of methods for memory mapping. Struct address_space_operations ext2_aops address space processing, there is also a version of nobh. Struct inode_operations ext2_dir_inode_operations directory inode operation method collection. A collection of operation methods for the struct inode_operations ext2_special_inode_operations special type inode. A collection of operation methods for the struct inode_operations ext2_symlink_inode_operations link type inode. A collection of operating methods for the struct super_operations ext2_sops super block. Registration structure of the struct file_system_type ext2_fs_type file system type. After reading the above, have you mastered the core data structure of the ext2 file system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report