SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
FUSE
Developing filesystems in userspace
                  Mads D. Kristensen
                   mads@oejlug.dk


       OEJLUG - Oestjyllands Linux-brugergruppe




                                           FUSE - Developing filesystems in userspace – p. 1/2
Contents of this
   presentation
What is a filesystem?
How does FUSE work?
Installing FUSE.
The FUSE library.
A simple example filesystem.
FUSE options, concurrency and other stuff.
Questions?



                              FUSE - Developing filesystems in userspace – p. 2/2
What is a filesystem?
“... a method for storing and organizing computer
files and the data they contain to make it easy to
find and access them.” [wikipedia].

From this description we can deduce two
important things about a filesystem:
1. It must provide a method for storing the data;
   be it on disk, CD or something other, and
2. it must provide an interface for the user to
   make it possible to navigate through the
   stored data.
                                    FUSE - Developing filesystems in userspace – p. 3/2
Storing file data.
Well known regular filesystems are ext2, ext3,
reiserfs, xfs etc. These filesystems specify the
layout of data on disk.

Filesystems does not have to be this low-level.
For example a typical network filesystem does
not specify such things but just depends on the
local filesystem on the server for storing the data.
Examples are NFS, Samba and AFS.



                                    FUSE - Developing filesystems in userspace – p. 4/2
Filesystem meta
      data.
Apart from defining how file data is stored some
meta data must be stored as well. This meta
data represents things like:
   Filename in human-readable form.
   Directory structure.
   Access rights.
   Ownership.
   Timestamps.


                                 FUSE - Developing filesystems in userspace – p. 5/2
The Virtual File
      Switch (VFS).
In Linux the meta data of the filesystem must be
fed to VFS so that it may present the user with a
common interface for all filesystems. This means
that, if your meta data matches with VFS’s
demands, you can use standard commands like
chmod, chown and cp.

Furthermore, when using VFS, you can use all
the standard commands to read/manipulate the
file data as well (eg. cat, sed, grep).


                                   FUSE - Developing filesystems in userspace – p. 6/2
VFS continued.
All this works because VFS defines the basic
system calls for opening and closing files (open,
close), reading from/writing to files (read,
write), getting/setting rights and ownership
(stat, chown, chmod, umask), creating and
deleting directories (mkdir, rmdir), reading
directory contents and more (utime, truncate,
...).

This means that all applications will work with
your filesystem, for example:
emacs /mnt/myfs/foo.txt.
                                    FUSE - Developing filesystems in userspace – p. 7/2
How does FUSE
         work?
                              example/hello /tmp/fuse


            ls −l /tmp/fuse            libfuse


                 glibc                  glibc

userspace

kernel
                                        FUSE


                                      ...
                 VFS
                                      NFS


                                      Ext3




                                                        FUSE - Developing filesystems in userspace – p. 8/2
How does FUSE
         work? (continued)
As the figure showed FUSE is separated into two
parts:
1. A kernel module that hooks up to the VFS
   inside the kernel.
2. A userspace library that communicates with
   the kernel module.
A related system call is then first passed to the kernel by the calling
application, VFS passes the request on to the FUSE kernel module
which in turn passes the request on to the FUSE library in userspace.
The FUSE library then calls the associated function for that specific
system call.

                                                  FUSE - Developing filesystems in userspace – p. 9/2
Installing FUSE.
Gentoo sys-fs/fuse
Ubuntu fuse-source
       fuse-utils
       libfuse2
       libfuse2-dev
Source ./configure
       make
       make install


                      FUSE - Developing filesystems in userspace – p. 10/2
Getting started.
This is all well and good, but how do we get
started implementing a filesystem?

As mentioned FUSE works by passing system
calls from the kernel and back into userspace so
we need to implement some functions to take
care of the different system calls.




                                   FUSE - Developing filesystems in userspace – p. 11/2
System calls in
        FUSE.
getattr    Get file attributes - similar to stat().
readlink   Read the target of a symbolic link.
mknod      Create a file node.
mkdir      Create a directory.
unlink     Remove a file.
rmdir      Remove a directory.
symlink    Create a symbolic link.
rename     Rename a file.
link       Create a hard link to a file.
chmod      Change the permission bits of a file.


                                                 FUSE - Developing filesystems in userspace – p. 12/2
System calls in
        FUSE. (continued)
chown        Change the owner and group of a file.
truncate     Change the size of a file.
open         Open a file.
release      Close an open file.
read         Read data from an open file.
write        Write data to an open file.
fsync        Synchronize file contents (ie. flush dirty buffers).
opendir      Open directory.
readdir      Read directory - get directory listing.
releasedir   Close directory.


                                               FUSE - Developing filesystems in userspace – p. 13/2
System calls in
        FUSE. (continued)
utime     Change the access and/or modification times of a file.
statfs    Get file system statistics.
init      Initialize filesystem (FUSE specific).
destroy   Clean up filesystem (FUSE specific).




                                                 FUSE - Developing filesystems in userspace – p. 14/2
A first example.
This first example defines a flat (ie. no
directories) in-memory filesystem.

The implementation can be found in
example1.c and it can be compiled by typing
make ex1.

The helper class dlist just defines a doubly
linked list and it should be obvious what the
different functions does.


                                  FUSE - Developing filesystems in userspace – p. 15/2
What is missing?
This simple example are missing a lot of features
that a regular filesystem needs, but it might be
enough for your specific filesystem needs.

We will continue with the example by adding
functionality to properly initialize the access bits,
timestamps and ownership of files and by adding
functions to change these settings.

These additions can be found in example2.c.


                                     FUSE - Developing filesystems in userspace – p. 16/2
How about delete and
       rename?
It would be nice if it was also possible to rename
and delete files stored in or filesystem; so that
functionality is added in the third iteration of our
example.

These additions can be seen in example3.c.




                                     FUSE - Developing filesystems in userspace – p. 17/2
Adding hierarchy
       (directories).
Now is the time to remove the flatness from our
example filesystem by adding some hierarchy.

Directories are represented in a lot of different
ways in different filesystems. In most regular
filesystems a directory is just an ordinary file that
contains information about the files and
directories that reside in it; this is why a directory
has a size in a Linux system, because a directory
with at lot of files in it needs more than one page
(4096 bytes) for its list.

                                      FUSE - Developing filesystems in userspace – p. 18/2
Directory size
        example.
Example:
mdk@tux ˜/docs/foredrag/fuse $ ls /usr/ -la
total 144
drwxr-xr-x   14 root    root     4096 Jul 25 21:37 .
drwxr-xr-x   19 root    root     4096 Aug 2 10:19 ..
-rw-r--r--    1 root    root        0 Jul 25 21:37 .keep
lrwxrwxrwx    1 root    root        6 Jul 9 15:44 X11R6 -> ../usr
drwxr-xr-x    2 root    root    40960 Aug 4 10:05 bin
lrwxrwxrwx    1 root    root        9 Jul 9 00:41 doc -> share/doc
drwxr-x---    3 root    games    4096 Jul 10 19:16 games
drwxr-xr-x    7 root    root     4096 Jul 14 20:16 i686-pc-linux-gnu
drwxr-xr-x 182 root     root    12288 Aug 2 14:58 include
lrwxrwxrwx    1 root    root       10 Jul 9 00:41 info -> share/inf
drwxr-xr-x   89 root    root    49152 Aug 3 17:18 lib
...



                                              FUSE - Developing filesystems in userspace – p. 19/2
Directories
      (continued).
So, we could represent directories in our
example filesystem by creating regular files that
contains the inode numbers of the files that
reside in them.

But, directories does no have to be represented
as regular files, in fact there are a lot of other
possibilities all depending on the specific
filesystem that you are designing.

How we choose to represent directories can be
seen in the fourth iteration of our filesystem,
example4.c.                        FUSE - Developing filesystems in userspace – p. 20/2
Now we’ve got
      everything, right?
The short answer: “No.”.

There are still some important filesystem
functions missing from our filesystem; things
such as hard links and symbolic links.

Actually we are still missing all these calls:
readlink, releasedir, symlink, link,
statfs, release and fsync.

These calls will not be presented in this talk -
wait for the tutorial ;-)
                                     FUSE - Developing filesystems in userspace – p. 21/2
FUSE options.
usage: ./example4 mountpoint [FUSE options]

FUSE options:
    -d                     enable debug output (implies -f)
    -f                     foreground operation
    -s                     disable multithreaded operation
    -r                     mount read only (equivalent to ’-o ro’)
    -o opt,[opt...]        mount options
    -h                     print help

Mount options:
    default_permissions    enable permission checking
    allow_other            allow access to other users
    allow_root             allow access to root
    kernel_cache           cache files in kernel
    large_read             issue large read requests (2.4 only)



                                              FUSE - Developing filesystems in userspace – p. 22/2
FUSE options
    (continued).
direct_io     use direct I/O
max_read=N    set maximum size of read requests
hard_remove   immediate removal (don’t hide files)
debug         enable debug output
fsname=NAME   set filesystem name in mtab
use_ino       let filesystem set inode numbers
readdir_ino   try to fill in d_ino in readdir




                                 FUSE - Developing filesystems in userspace – p. 23/2
Concurrency.
Concurrent filesystem requests may come in any
ordering so you have to make sure that your
filesystem is ready for this.

The example filesystem we have seen thus far
does not support multithreading because the
datastructures are not protected at all. This
would be fairly easy to do by adding mutexes.




                                 FUSE - Developing filesystems in userspace – p. 24/2
Other FUSE based
   filesystems.
SSHFS
EncFS
GmailFS
Wayback Filesystem
... and others.




                     FUSE - Developing filesystems in userspace – p. 25/2
Questions?




             FUSE - Developing filesystems in userspace – p. 26/2

Contenu connexe

Tendances

Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Ahmed El-Arabawy
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Gentoo - Sistema Operacional
Gentoo - Sistema OperacionalGentoo - Sistema Operacional
Gentoo - Sistema OperacionalAnderson Favaro
 
Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm
 
Mint64 os개발이야기 한승훈
Mint64 os개발이야기 한승훈Mint64 os개발이야기 한승훈
Mint64 os개발이야기 한승훈Seunghun han
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...Mathieu Saby
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded trainingH Ming
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsAnant Narayanan
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux KernelStryker King
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Tushar B Kute
 

Tendances (20)

Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Gentoo - Sistema Operacional
Gentoo - Sistema OperacionalGentoo - Sistema Operacional
Gentoo - Sistema Operacional
 
Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124
 
Mint64 os개발이야기 한승훈
Mint64 os개발이야기 한승훈Mint64 os개발이야기 한승훈
Mint64 os개발이야기 한승훈
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
Linux one vs x86
Linux one vs x86 Linux one vs x86
Linux one vs x86
 
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...
Découvrez OpenRefine: un outil gratuit pour nettoyer, préparer et enrichir vo...
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
TỰ HỌC LPI 2
TỰ HỌC LPI 2TỰ HỌC LPI 2
TỰ HỌC LPI 2
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded training
 
Unix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell LabsUnix++: Plan 9 from Bell Labs
Unix++: Plan 9 from Bell Labs
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux Kernel
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)
 

En vedette

FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel DreyfusFUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfuseurobsdcon
 
Implementing File Systems-R.D.Sivakumar
Implementing File Systems-R.D.SivakumarImplementing File Systems-R.D.Sivakumar
Implementing File Systems-R.D.SivakumarSivakumar R D .
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesBart Spaans
 
Copper electrical fuse contacts parts
Copper electrical fuse contacts partsCopper electrical fuse contacts parts
Copper electrical fuse contacts partsconexcoppe
 
Fuses and its type in power system
Fuses and its type in power systemFuses and its type in power system
Fuses and its type in power system18061994
 
Fuse- Power system Protection
Fuse- Power system Protection  Fuse- Power system Protection
Fuse- Power system Protection Md. Nahid Sarker
 
Resistor and conductor
Resistor and conductor Resistor and conductor
Resistor and conductor Hamza Sajjad
 
Scale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_glusterScale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_glusterGluster.org
 
Resistors: Types and Uses
Resistors: Types and UsesResistors: Types and Uses
Resistors: Types and UsesJessa Arnado
 
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...Thorne & Derrick International
 
ppt on fuse by madhav chhabra
ppt on fuse by madhav chhabrappt on fuse by madhav chhabra
ppt on fuse by madhav chhabraMadhav Chhabra
 
Resistors
ResistorsResistors
Resistorsmuruwet
 
Resistor and its types
Resistor and its typesResistor and its types
Resistor and its typesSumeet Patel
 
Basic hand tools (Electronics Technology)
Basic hand tools (Electronics Technology)Basic hand tools (Electronics Technology)
Basic hand tools (Electronics Technology)Roderick Lamban
 

En vedette (19)

FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel DreyfusFUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
 
Implementing File Systems-R.D.Sivakumar
Implementing File Systems-R.D.SivakumarImplementing File Systems-R.D.Sivakumar
Implementing File Systems-R.D.Sivakumar
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for Kubernetes
 
Fuse technology-2015
Fuse technology-2015Fuse technology-2015
Fuse technology-2015
 
Copper electrical fuse contacts parts
Copper electrical fuse contacts partsCopper electrical fuse contacts parts
Copper electrical fuse contacts parts
 
ResistorS
ResistorSResistorS
ResistorS
 
Fuses and its type in power system
Fuses and its type in power systemFuses and its type in power system
Fuses and its type in power system
 
Fuse- Power system Protection
Fuse- Power system Protection  Fuse- Power system Protection
Fuse- Power system Protection
 
Resistor and conductor
Resistor and conductor Resistor and conductor
Resistor and conductor
 
Fuses
FusesFuses
Fuses
 
Scale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_glusterScale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_gluster
 
resistor
resistorresistor
resistor
 
Resistors: Types and Uses
Resistors: Types and UsesResistors: Types and Uses
Resistors: Types and Uses
 
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...
ABB Medium-High Voltage Products - ABB HV Fuses With Temperature Control, CEF...
 
ppt on fuse by madhav chhabra
ppt on fuse by madhav chhabrappt on fuse by madhav chhabra
ppt on fuse by madhav chhabra
 
Fuses and mcb
Fuses and mcbFuses and mcb
Fuses and mcb
 
Resistors
ResistorsResistors
Resistors
 
Resistor and its types
Resistor and its typesResistor and its types
Resistor and its types
 
Basic hand tools (Electronics Technology)
Basic hand tools (Electronics Technology)Basic hand tools (Electronics Technology)
Basic hand tools (Electronics Technology)
 

Similaire à FUSE Developing Fillesystems in userspace

FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems paper by Emmanuel DreyfusFUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfuseurobsdcon
 
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEKVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEIJNSA Journal
 
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEKVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEIJNSA Journal
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs FilesystemJeff Yana
 
Xfs file system for linux
Xfs file system for linuxXfs file system for linux
Xfs file system for linuxAjay Sood
 
linux file sysytem& input and output
linux file sysytem& input and outputlinux file sysytem& input and output
linux file sysytem& input and outputMythiliA5
 
File system hiearchy
File system hiearchyFile system hiearchy
File system hiearchysritolia
 
Linux fs structure (1)
Linux fs structure (1)Linux fs structure (1)
Linux fs structure (1)E. Rahul Naidu
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPythondelimitry
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copyShay Cohen
 
Linux File System.docx
Linux File System.docxLinux File System.docx
Linux File System.docxBhuvanaR13
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-oshomeworkping3
 
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkMohammed Farrag
 
Xen server storage Overview
Xen server storage OverviewXen server storage Overview
Xen server storage OverviewNuno Alves
 

Similaire à FUSE Developing Fillesystems in userspace (20)

FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems paper by Emmanuel DreyfusFUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
 
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEKVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
 
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSEKVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
Operating system
Operating systemOperating system
Operating system
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs Filesystem
 
Xfs file system for linux
Xfs file system for linuxXfs file system for linux
Xfs file system for linux
 
File system discovery
File system discovery File system discovery
File system discovery
 
linux file sysytem& input and output
linux file sysytem& input and outputlinux file sysytem& input and output
linux file sysytem& input and output
 
File system hiearchy
File system hiearchyFile system hiearchy
File system hiearchy
 
Linux fs structure (1)
Linux fs structure (1)Linux fs structure (1)
Linux fs structure (1)
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
 
File Context
File ContextFile Context
File Context
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
Linux File System.docx
Linux File System.docxLinux File System.docx
Linux File System.docx
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
 
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
 
Xen server storage Overview
Xen server storage OverviewXen server storage Overview
Xen server storage Overview
 

Plus de elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

Plus de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Dernier

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Dernier (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

FUSE Developing Fillesystems in userspace

  • 1. FUSE Developing filesystems in userspace Mads D. Kristensen mads@oejlug.dk OEJLUG - Oestjyllands Linux-brugergruppe FUSE - Developing filesystems in userspace – p. 1/2
  • 2. Contents of this presentation What is a filesystem? How does FUSE work? Installing FUSE. The FUSE library. A simple example filesystem. FUSE options, concurrency and other stuff. Questions? FUSE - Developing filesystems in userspace – p. 2/2
  • 3. What is a filesystem? “... a method for storing and organizing computer files and the data they contain to make it easy to find and access them.” [wikipedia]. From this description we can deduce two important things about a filesystem: 1. It must provide a method for storing the data; be it on disk, CD or something other, and 2. it must provide an interface for the user to make it possible to navigate through the stored data. FUSE - Developing filesystems in userspace – p. 3/2
  • 4. Storing file data. Well known regular filesystems are ext2, ext3, reiserfs, xfs etc. These filesystems specify the layout of data on disk. Filesystems does not have to be this low-level. For example a typical network filesystem does not specify such things but just depends on the local filesystem on the server for storing the data. Examples are NFS, Samba and AFS. FUSE - Developing filesystems in userspace – p. 4/2
  • 5. Filesystem meta data. Apart from defining how file data is stored some meta data must be stored as well. This meta data represents things like: Filename in human-readable form. Directory structure. Access rights. Ownership. Timestamps. FUSE - Developing filesystems in userspace – p. 5/2
  • 6. The Virtual File Switch (VFS). In Linux the meta data of the filesystem must be fed to VFS so that it may present the user with a common interface for all filesystems. This means that, if your meta data matches with VFS’s demands, you can use standard commands like chmod, chown and cp. Furthermore, when using VFS, you can use all the standard commands to read/manipulate the file data as well (eg. cat, sed, grep). FUSE - Developing filesystems in userspace – p. 6/2
  • 7. VFS continued. All this works because VFS defines the basic system calls for opening and closing files (open, close), reading from/writing to files (read, write), getting/setting rights and ownership (stat, chown, chmod, umask), creating and deleting directories (mkdir, rmdir), reading directory contents and more (utime, truncate, ...). This means that all applications will work with your filesystem, for example: emacs /mnt/myfs/foo.txt. FUSE - Developing filesystems in userspace – p. 7/2
  • 8. How does FUSE work? example/hello /tmp/fuse ls −l /tmp/fuse libfuse glibc glibc userspace kernel FUSE ... VFS NFS Ext3 FUSE - Developing filesystems in userspace – p. 8/2
  • 9. How does FUSE work? (continued) As the figure showed FUSE is separated into two parts: 1. A kernel module that hooks up to the VFS inside the kernel. 2. A userspace library that communicates with the kernel module. A related system call is then first passed to the kernel by the calling application, VFS passes the request on to the FUSE kernel module which in turn passes the request on to the FUSE library in userspace. The FUSE library then calls the associated function for that specific system call. FUSE - Developing filesystems in userspace – p. 9/2
  • 10. Installing FUSE. Gentoo sys-fs/fuse Ubuntu fuse-source fuse-utils libfuse2 libfuse2-dev Source ./configure make make install FUSE - Developing filesystems in userspace – p. 10/2
  • 11. Getting started. This is all well and good, but how do we get started implementing a filesystem? As mentioned FUSE works by passing system calls from the kernel and back into userspace so we need to implement some functions to take care of the different system calls. FUSE - Developing filesystems in userspace – p. 11/2
  • 12. System calls in FUSE. getattr Get file attributes - similar to stat(). readlink Read the target of a symbolic link. mknod Create a file node. mkdir Create a directory. unlink Remove a file. rmdir Remove a directory. symlink Create a symbolic link. rename Rename a file. link Create a hard link to a file. chmod Change the permission bits of a file. FUSE - Developing filesystems in userspace – p. 12/2
  • 13. System calls in FUSE. (continued) chown Change the owner and group of a file. truncate Change the size of a file. open Open a file. release Close an open file. read Read data from an open file. write Write data to an open file. fsync Synchronize file contents (ie. flush dirty buffers). opendir Open directory. readdir Read directory - get directory listing. releasedir Close directory. FUSE - Developing filesystems in userspace – p. 13/2
  • 14. System calls in FUSE. (continued) utime Change the access and/or modification times of a file. statfs Get file system statistics. init Initialize filesystem (FUSE specific). destroy Clean up filesystem (FUSE specific). FUSE - Developing filesystems in userspace – p. 14/2
  • 15. A first example. This first example defines a flat (ie. no directories) in-memory filesystem. The implementation can be found in example1.c and it can be compiled by typing make ex1. The helper class dlist just defines a doubly linked list and it should be obvious what the different functions does. FUSE - Developing filesystems in userspace – p. 15/2
  • 16. What is missing? This simple example are missing a lot of features that a regular filesystem needs, but it might be enough for your specific filesystem needs. We will continue with the example by adding functionality to properly initialize the access bits, timestamps and ownership of files and by adding functions to change these settings. These additions can be found in example2.c. FUSE - Developing filesystems in userspace – p. 16/2
  • 17. How about delete and rename? It would be nice if it was also possible to rename and delete files stored in or filesystem; so that functionality is added in the third iteration of our example. These additions can be seen in example3.c. FUSE - Developing filesystems in userspace – p. 17/2
  • 18. Adding hierarchy (directories). Now is the time to remove the flatness from our example filesystem by adding some hierarchy. Directories are represented in a lot of different ways in different filesystems. In most regular filesystems a directory is just an ordinary file that contains information about the files and directories that reside in it; this is why a directory has a size in a Linux system, because a directory with at lot of files in it needs more than one page (4096 bytes) for its list. FUSE - Developing filesystems in userspace – p. 18/2
  • 19. Directory size example. Example: mdk@tux ˜/docs/foredrag/fuse $ ls /usr/ -la total 144 drwxr-xr-x 14 root root 4096 Jul 25 21:37 . drwxr-xr-x 19 root root 4096 Aug 2 10:19 .. -rw-r--r-- 1 root root 0 Jul 25 21:37 .keep lrwxrwxrwx 1 root root 6 Jul 9 15:44 X11R6 -> ../usr drwxr-xr-x 2 root root 40960 Aug 4 10:05 bin lrwxrwxrwx 1 root root 9 Jul 9 00:41 doc -> share/doc drwxr-x--- 3 root games 4096 Jul 10 19:16 games drwxr-xr-x 7 root root 4096 Jul 14 20:16 i686-pc-linux-gnu drwxr-xr-x 182 root root 12288 Aug 2 14:58 include lrwxrwxrwx 1 root root 10 Jul 9 00:41 info -> share/inf drwxr-xr-x 89 root root 49152 Aug 3 17:18 lib ... FUSE - Developing filesystems in userspace – p. 19/2
  • 20. Directories (continued). So, we could represent directories in our example filesystem by creating regular files that contains the inode numbers of the files that reside in them. But, directories does no have to be represented as regular files, in fact there are a lot of other possibilities all depending on the specific filesystem that you are designing. How we choose to represent directories can be seen in the fourth iteration of our filesystem, example4.c. FUSE - Developing filesystems in userspace – p. 20/2
  • 21. Now we’ve got everything, right? The short answer: “No.”. There are still some important filesystem functions missing from our filesystem; things such as hard links and symbolic links. Actually we are still missing all these calls: readlink, releasedir, symlink, link, statfs, release and fsync. These calls will not be presented in this talk - wait for the tutorial ;-) FUSE - Developing filesystems in userspace – p. 21/2
  • 22. FUSE options. usage: ./example4 mountpoint [FUSE options] FUSE options: -d enable debug output (implies -f) -f foreground operation -s disable multithreaded operation -r mount read only (equivalent to ’-o ro’) -o opt,[opt...] mount options -h print help Mount options: default_permissions enable permission checking allow_other allow access to other users allow_root allow access to root kernel_cache cache files in kernel large_read issue large read requests (2.4 only) FUSE - Developing filesystems in userspace – p. 22/2
  • 23. FUSE options (continued). direct_io use direct I/O max_read=N set maximum size of read requests hard_remove immediate removal (don’t hide files) debug enable debug output fsname=NAME set filesystem name in mtab use_ino let filesystem set inode numbers readdir_ino try to fill in d_ino in readdir FUSE - Developing filesystems in userspace – p. 23/2
  • 24. Concurrency. Concurrent filesystem requests may come in any ordering so you have to make sure that your filesystem is ready for this. The example filesystem we have seen thus far does not support multithreading because the datastructures are not protected at all. This would be fairly easy to do by adding mutexes. FUSE - Developing filesystems in userspace – p. 24/2
  • 25. Other FUSE based filesystems. SSHFS EncFS GmailFS Wayback Filesystem ... and others. FUSE - Developing filesystems in userspace – p. 25/2
  • 26. Questions? FUSE - Developing filesystems in userspace – p. 26/2