Author: Ritesh Harjani ritesh.harjani@gmail.com
==========================================
learnfs is a small & simple Ram based filesystem module which mainly uses the existing library API's of fs/libfs.c Main goal of writing learnfs is to understand "How to write a linux filesystem"
Since it is not disk based fs, so there will be no disk I/O involved in this case and the address_space mapping APIs will be straight forward.
Since learnfs it is written from scratch, every commit of this will describe the actual process of writing a filesystem. While writing sdcardfs & ramfs code was considered as reference.
- Implement address_space mapping operation on it's own instead of using libfs.
- Implement symlink/hardlinks.
- Remove all libfs.c code and implement yourself.
export KDIR=<kernel build/kobj path>
export CC=<cross compiler>
make
adb root
adb push learnfs.ko /data
adb push learnfs-test.sh /data
adb shell
sh ./data/learnfs-test.sh
:/data # sh learnfs-test.sh
unmount learnfs
rmmod learnfs
mkdir /data/mnt
mkdir: '/data/mnt': File exists
insmod learnfs
mounting learnfs
Executing write in bs=1m at /data/mnt/fsimage
10+0 records in
10+0 records out
10485760 bytes transferred in 0.036 secs (291271111 bytes/sec)
Done.
Executing read in bs=4k at /data/mnt/fsimage
10+0 records in
10+0 records out
40960 bytes transferred in 0.001 secs (40960000 bytes/sec)
Done.
- In case if anyone would like to contribute to this project - please feel free to submit a pull request.