Mobile Development 12 min read

An Overview of sdcardfs: Architecture, Comparison with FUSE, and Performance Advantages

sdcardfs is a kernel-space stackable virtual file system built on wrapfs, replacing FUSE on Android O, offering better I/O performance by reducing user‑kernel transitions and avoiding double caching, while not managing actual SD cards; it forwards operations directly, achieving near‑native speeds.

OPPO Kernel Craftsman
OPPO Kernel Craftsman
OPPO Kernel Craftsman
An Overview of sdcardfs: Architecture, Comparison with FUSE, and Performance Advantages

sdcardfs is a virtual file system developed by Samsung based on the wrapfs framework. Leveraging its excellent I/O performance, it replaced FUSE (Filesystem in Userspace) on Android O and has been adopted by many manufacturers.

Birth of sdcardfs

sdcardfs is built on wrapfs, a stackable file system that provides the necessary functions for sdcardfs. It operates as a middle layer between the VFS and the underlying file system, forwarding operations without directly managing storage.

Most file systems fall into three categories: low‑level kernel file systems (high performance but hard to develop), user‑space file systems (easier to develop but suffer from performance penalties due to user‑kernel transitions), and stackable file systems, which aim to combine the advantages of both. wrapfs is a stackable framework that supplies sdcardfs with the required hooks.

Clearing Misconceptions

sdcardfs is not the file system of an SD card, nor does it manage the /sdcard partition directly. The /sdcard directory on many Android devices actually maps to internal storage, while external storage may appear under /storage/sdcardfs1 . sdcardfs was created to address the shortcomings of both low‑level and user‑space file systems, not to manage SD cards themselves.

FUSE was introduced to add permission management to file systems, but its architecture incurs I/O latency and double caching because every operation traverses six user‑kernel transitions.

Framework Analysis – Mounting

Mounting sdcardfs involves calling init_sdcardfs_fs() , which allocates slab caches for inodes, dentries, and package lists, then registers the file system. An exit_sdcardfs_fs() function deregisters it.

Framework Analysis – Comparison

FUSE consists of a kernel driver ( /dev/fuse ) and a user‑space daemon that communicates via the device node. The operation flow includes six context switches between user and kernel space, which explains its performance overhead.

In contrast, sdcardfs resides entirely in kernel space, sitting between the VFS and the underlying file system. Operations follow a simple open → read/write → close path, eliminating the extra user‑space round‑trips.

When sdcardfs forwards a request, it creates corresponding inode, dentry, and file structures that link to those of the lower‑level file system, allowing fast lookup without additional copying.

sdcardfs vs FUSE

sdcardfs eliminates the I/O latency of FUSE by reducing the number of user‑kernel transitions from six to two (command issuance and result return). In a benchmark copying 10,000 files of 50 KB each, FUSE added roughly 40 seconds compared to the native EXT4 baseline, while sdcardfs performed close to the native speed.

FUSE also suffers from double caching because data is copied from kernel memory to user‑space buffers and then back, effectively duplicating the page cache. sdcardfs, acting only as a pass‑through, avoids this redundancy.

Conclusion

The article provides a shallow analysis of sdcardfs by comparing it with FUSE, highlighting its architectural advantages that reduce I/O latency and eliminate double caching. Although sdcardfs is not a new concept, it still offers room for further enhancements such as permission management, case folding, and storage tracking.

performanceAndroidkernelFile SystemFUSEsdcardfs
OPPO Kernel Craftsman
Written by

OPPO Kernel Craftsman

Sharing Linux kernel-related cutting-edge technology, technical articles, technical news, and curated tutorials

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.