

* For use by the owner of the address_space. * The most recent error which has occurred. * Shadow or DAX entries, protected by the i_pages lock. * Protects and * Number of page entries, protected by the i_pages lock. * Number of THPs in the pagecache (non-shmem only). * Memory allocation flags to use for allocating pages. * Owner, either the inode or the block_device. ** * struct address_space - Contents of a cacheable, mappable object. the DMAP area is comprised of multiple blocks which contains aīitmap for data blocks it maintains the allocated/free state for.the IMAP area is comprised of multiple blocks which contains aīitmap for inode allocation it maintains the allocated/free state.the superblock contains information about the block size as well as.The next diagram show a very simple filesystem where blocks are The diagram shows that the superblock is typically stored at theīeginning of the fileystem and that various blocks are used withĭifferent purposes: some to store dentries, some to store inodes and The following diagram shows the relationship of the filesystem Multiple dentries can point to the same inode when hard links are Multiple file abstractions can point to the same dentry if we open Use the dup() system call to duplicate a file descriptor. Multiple file descriptors can point to the same file because we can Note that not all of the one to many relationships between the various The following diagram shows the relationship between the various filesystem Storage and in memory (for caching purposes). The dentry associates a name with an inode. The file name is not a property of the file. Unique way and has various properties such as the file size, access It exists both on storageĪnd in memory (for caching purposes). The file abstraction contains information about an opened file suchĪs the current file pointer. Is present both on storage and in memory (for caching purposes). Instance such as the block size, the root inode, filesystem size.

The superblock abstraction contains information about the filesystem Some of these abstractions are present both on disk and in memory While filesystems use different data structures to organizing theįiles, directories, user data and meta (internal) data on storageĭevices there are a few common abstractions that are used in almost We can have multiple instances of the same filesystem type in use. FAT, ext4, btrfs, ntfs) and on one running system
#KEYWORD FILE LINUX KERNEL CODE#
The code is treated as ordinary except, if it contains any reference to init code or data, warning will be suppressed.A fileystem is a way to organize files and directories on storageĭevices such as hard disks, SSDs or flash memory. The _init_refok tag does not remove the code neither relocate. In your example, the functions free_initmem(void) is probably referring to some data or code, that are tagged with _init. Of course, no warning does not mean code is correct, so optimallyĭocument why the _ref is needed and why it's OK The file also documents that, though the warning is suppressed, it is the programmer's responsibility write such code that refers init section data or code. Thus compiler does not generate any warning. It means ref erencing init section is ok for you. _init_refok is a way to tell the compiler that you are aware and consciously referencing the initialization code or data. Location to be cleared after init process has been completed.Ĭompiler generates a warning when we use the data or code from the separate memory as they might will be removed at the time of the execution of the particular code referencing them. Using _init helps to put the initialization code in separate memory To my understanding, include/linux/init.h clearly documents the purpose of _init_refok. Does that mean that these codes will ba place somewhere else? How actually the behaviour differs from the normal behaviour by using _init_refok keyword? In the include/linux/init.h, it is mentioned like _init_refok is to supress the warning from modpost check, due to any reference form normal code to init section code, but still, I am not getting it exactly. If anyone can let me know what is the purpose of using that keyword in the code, it will be very helpful. I searched for the reference, from that I came to know that it is defined as a preprocessor macro in include/linux/init.h, line 71.Īfter browsing that, I got the following codes #define _init_refok _refĪnd #define _ref _section(.ref.text) noinline Void noinline _init_refok rest_init(void) Static void _init_refok vgacon_scrollback_startup(void)Ĭonst struct linux_logo * _init_refok fb_find_logo(int depth) Some of the lines I came accross are like void _init_refok free_initmem(void) While browsing the kernel code, I came accross a keyword that is used in several kernel init functions, _init_refok.
