littlefs-project / littlefs

A little fail-safe filesystem designed for microcontrollers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mounting a loop device from c.

shalevv123 opened this issue · comments

Does littleFS c interface support mounting a loop device to a directory?
Somewhat like how you would mount a device in Linux using the mount function.
I know that littleFS-fuse does something similar but is there a support for this behavior without having to copy selected functions from the littleFS-fuse repo?

I'm not really sure why this hasn't crossed my mind before. It would be easy enough to move lfs_fuse_bd into this repo (lfs_blkbd?).

The only concern is dealing with too many OS idiosyncrasies, but I guess with lfs_filebd already containing untestable Windows stuff the cat's already out of the bag.

If people want additional block devices specific to embedded OSes, for example, things can explode quickly. Though if there's interest in that we could make a separate repo to collect various bd impls.


Just to be clear, lfs_filebd and lfs_fuse_bd are basically the same, just with lfs_fuse_bd infering the block size/count via ioctl + BLKSSZGET + BLKGETSIZE64.