<aside>
💡 Make a file system module
</aside>
Making a file system module
- copying existing EXT4 file system module to my file system module. (PXT4 file system)
- EXT4 file system includes two modules.
- ext4.ko
: Body of file system (metadata, I/O operations)
- jdb2.ko
: Transaction processing
- To avoid conflict
- ext4.ko → pxt4.ko
- jdb2.ko → jdb3.ko
Cody original file system to out file system
$ cp -r linux-5.x.x/fs/ext4 pxt4
$ cp -r linux-5.x.x/fs/jdb2 jdb3
Modify codes
use ‘cscope’
- pxt4, jdb3 directory
**$ cscope**
-
change codes & the name of files
- jdb2 → jdb3, ext4 → pxt4, ext2, pxt2
- JDB2 → JDB3, EXT4 → PXT4, EXT2 → PXT2
ctrl + A : to choose all the codes to change
<aside>
⚠️ Makefile, config file 도 변경해줘야 한다 !
</aside>
-
/pxt4/acl.h
- #ifdef CONFIG_PXT4 → #ifdef CONFIG_EXT4
-
/pxt4/xattr.h
- #ifdef CONFIG_PXT4 → #ifdef CONFIG_EXT4