SlideShare a Scribd company logo
Gluster Dev
session #18
Intro to FUSE and its trade-offs
Scope
various parts of fuse code in the glusterfs source
tree
the story FUSE version macros tell
the tale of FUSE and fuse (historical context,
terminology)
to libfuse or not to libfuse?
FUSE proto breakdown
mount and INIT
fuse code in the gluster tree
> git ls-files '*fuse*.[ch]' | grep -v ^tests/ | 

sed 's@/[^/]*$@/@' | uniq | cat -n

1 contrib/fuse-include/

2 contrib/fuse-lib/

3 contrib/fuse-util/

4 contrib/macfuse/

5 xlators/mount/fuse/src/
FUSE version macros
xlators/mount/fuse/src/fuse-bridge.c:
static void

fuse_create(xlator_t *this, fuse_in_header_t *finh, void *msg,

struct iobuf *iobuf)

{

#if FUSE_KERNEL_MINOR_VERSION >= 12

struct fuse_create_in *fci = msg;

fuse_private_t *priv = NULL;

int32_t ret = -1;

#else

struct fuse_open_in *fci = msg;

#endif

char *name = (char *)(fci + 1);
...
fuse_state_t *state = NULL;

#if FUSE_KERNEL_MINOR_VERSION >= 12

priv = this->private;
if (priv->proto_minor < 12)

name = (char *)((struct fuse_open_in *)msg + 1);

#endif
fuse history
kernel: micro (GNU Hurd) vs monolithic
userspace filesystesms: "tarfs", "sshfs"; NFS, Arla,
9P
Linux: AFVS, lufis, shfs
fuse: project of Miklós Szeredi; got merged in
2005 to 2.6.14 (gmailfs, sshfs)
first non-Linux port: fuse4bsd, GSoC 2005, Csaba
Henk
NetBSD: puffs/refuse; Mac: OSXFUSE / FUSE for
macOS / macFUSE, 2011-
fuse and FUSE
fuse: project / code
FUSE: protocol
FUSE follows a client-server architecture
kernel: client
userspace: server
libfuse: de facto reference server lib
however, a server lib is more like a framework
(think of Apache, Nginx)
Go, Rust...
glusterfs is also a framework
What have the Romans
libfuse ever done for us?
we do use:
mounting
we do roll our own:
uniform API over versions and platforms
we make up our own minds about it:
threading / synchronization / fuse dev I/O
although automatic thread scaling would
be nice to have
...
we don't need:
support for all FUSE features
command-line driven configuration
we need to roll our own:
support for FUSE features
fuse code in the gluster tree,
continued
> git ls-files '*fuse*.[ch]' | grep -v ^tests/ | 

sed 's@/[^/]*$@/@' | uniq | (i=1; while read d; do

echo "# $i. $d"; git ls-files "$d/*.[ch]" | cat -n

i=$(($i+1))

done)

# 1. contrib/fuse-include/

1 contrib/fuse-include/fuse-misc.h

2 contrib/fuse-include/fuse-mount.h

3 contrib/fuse-include/fuse_kernel.h

4 contrib/fuse-include/fuse_kernel_macfuse.h

5 contrib/fuse-include/mount_util.h

...
# 2. contrib/fuse-lib/

1 contrib/fuse-lib/misc.c

2 contrib/fuse-lib/mount-common.c

3 contrib/fuse-lib/mount-gluster-compat.h

4 contrib/fuse-lib/mount.c

...
# 3. contrib/fuse-util/

1 contrib/fuse-util/fusermount.c

2 contrib/fuse-util/mount_util.c

...
# 4. contrib/macfuse/

1 contrib/macfuse/fuse_ioctl.h

2 contrib/macfuse/fuse_param.h

3 contrib/macfuse/mount_darwin.c

...
# 5. xlators/mount/fuse/src/

1 xlators/mount/fuse/src/fuse-bridge.c

2 xlators/mount/fuse/src/fuse-bridge.h

3 xlators/mount/fuse/src/fuse-helpers.c

4 xlators/mount/fuse/src/fuse-mem-types.h

5 xlators/mount/fuse/src/fuse-resolve.c
FUSE
client (kernel) sends FUSE request
server (userspace) replies with FUSE response
message structure: header + body
exceptions:
FORGET does not get a response
reverse notifications (invalidations): server's
requests
struct fuse_in_header {

uint32_t len;

uint32_t opcode;

uint64_t unique;

uint64_t nodeid;

uint32_t uid;

uint32_t gid;

uint32_t pid;

uint32_t padding;

};

struct fuse_out_header {

uint32_t len;

int32_t error;

uint64_t unique;

};
mount and INIT
mount(2): VFS general and instance specific
options
INIT: version handshake + option negotiation
mount options are per-mount, INIT options are
per-fs
initialization sequence:
open /dev/fuse
mount with -ofd=...
kernel sends INIT
userspace replies INIT
mount returns
concerns:
unprivileged mounting
security frameworks' (eg. SELinux) probing

More Related Content

What's hot

LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
Marian Marinov
 
Unix for developers
Unix for developersUnix for developers
Unix for developers
Mite Mitreski
 
My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)
Naoto MATSUMOTO
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-processskumner
 
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016
Atin Mukherjee
 
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Anne Nicolas
 
Unix Ramblings
Unix RamblingsUnix Ramblings
Unix Ramblings
Bill Miller
 
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
Naoto MATSUMOTO
 
От sysV к systemd
От sysV к systemdОт sysV к systemd
От sysV к systemd
Denis Kovalev
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
 
OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料
ichikaway
 
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memoredis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
Naoto MATSUMOTO
 
BOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containersBOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containers
Benjamin Gandon
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Tio Aldiansyah
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
Joseph Scott
 
Memory Management of C# with Unity Native Collections
Memory Management of C# with Unity Native CollectionsMemory Management of C# with Unity Native Collections
Memory Management of C# with Unity Native Collections
Yoshifumi Kawai
 
Linuxnetworkingcommands
LinuxnetworkingcommandsLinuxnetworkingcommands
Linuxnetworkingcommands
Manikanta Pushadapu
 
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatterHow to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
Yoshifumi Kawai
 
PenTest using Python By Purna Chander
PenTest using Python By Purna ChanderPenTest using Python By Purna Chander
PenTest using Python By Purna Chander
nforceit
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
delimitry
 

What's hot (20)

LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
Unix for developers
Unix for developersUnix for developers
Unix for developers
 
My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
 
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016
 
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
 
Unix Ramblings
Unix RamblingsUnix Ramblings
Unix Ramblings
 
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
 
От sysV к systemd
От sysV к systemdОт sysV к systemd
От sysV к systemd
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料
 
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memoredis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
 
BOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containersBOSH deploys distributed systems, and Diego runs any containers
BOSH deploys distributed systems, and Diego runs any containers
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
 
Memory Management of C# with Unity Native Collections
Memory Management of C# with Unity Native CollectionsMemory Management of C# with Unity Native Collections
Memory Management of C# with Unity Native Collections
 
Linuxnetworkingcommands
LinuxnetworkingcommandsLinuxnetworkingcommands
Linuxnetworkingcommands
 
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatterHow to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
 
PenTest using Python By Purna Chander
PenTest using Python By Purna ChanderPenTest using Python By Purna Chander
PenTest using Python By Purna Chander
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
 

Similar to Glusterfs session #18 intro to fuse and its trade offs

XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
The Linux Foundation
 
Fuse- Filesystem in User space
Fuse- Filesystem in User space Fuse- Filesystem in User space
Fuse- Filesystem in User space
Danny Tseng
 
리눅스 드라이버 #2
리눅스 드라이버 #2리눅스 드라이버 #2
리눅스 드라이버 #2
Sangho Park
 
HPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptxHPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptx
ObjectAutomation2
 
Upgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with SecurebootUpgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with Secureboot
Jonathan MICHEL-VILLAZ
 
HPC_MPI_CICD.pptx
HPC_MPI_CICD.pptxHPC_MPI_CICD.pptx
HPC_MPI_CICD.pptx
ObjectAutomation2
 
Linux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium SandboxLinux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium Sandbox
Patricia Aas
 
The Container Security Checklist
The Container Security Checklist The Container Security Checklist
The Container Security Checklist
LibbySchulze
 
SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005
James Morris
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
Jérôme Esnault
 
Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6
LetsConnect
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
Patricia Aas
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphores
Gowtham Reddy
 
CloudStack and cloud-init
CloudStack and cloud-initCloudStack and cloud-init
CloudStack and cloud-init
MarcusS13
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
Linaro
 
Edup wifi for raspberry zero
Edup wifi  for raspberry zeroEdup wifi  for raspberry zero
Edup wifi for raspberry zero
SoheilSabzevari2
 
Autotools
AutotoolsAutotools
Autotools
Thierry Gayet
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersAlexandre Moneger
 
Sling Applications - A DevOps perspective
Sling Applications - A DevOps perspectiveSling Applications - A DevOps perspective
Sling Applications - A DevOps perspective
Robert Munteanu
 

Similar to Glusterfs session #18 intro to fuse and its trade offs (20)

XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
 
Fuse- Filesystem in User space
Fuse- Filesystem in User space Fuse- Filesystem in User space
Fuse- Filesystem in User space
 
리눅스 드라이버 #2
리눅스 드라이버 #2리눅스 드라이버 #2
리눅스 드라이버 #2
 
HPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptxHPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptx
 
Upgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with SecurebootUpgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with Secureboot
 
HPC_MPI_CICD.pptx
HPC_MPI_CICD.pptxHPC_MPI_CICD.pptx
HPC_MPI_CICD.pptx
 
Linux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium SandboxLinux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium Sandbox
 
The Container Security Checklist
The Container Security Checklist The Container Security Checklist
The Container Security Checklist
 
SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005SELinux Kernel Internals and Architecture - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
 
Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphores
 
CloudStack and cloud-init
CloudStack and cloud-initCloudStack and cloud-init
CloudStack and cloud-init
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
 
Edup wifi for raspberry zero
Edup wifi  for raspberry zeroEdup wifi  for raspberry zero
Edup wifi for raspberry zero
 
Autotools
AutotoolsAutotools
Autotools
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
 
Sling Applications - A DevOps perspective
Sling Applications - A DevOps perspectiveSling Applications - A DevOps perspective
Sling Applications - A DevOps perspective
 

More from Pranith Karampuri

Glusterfs session #12 locks xlator posixlk
Glusterfs session #12   locks xlator posixlkGlusterfs session #12   locks xlator posixlk
Glusterfs session #12 locks xlator posixlk
Pranith Karampuri
 
Glusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healingGlusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healing
Pranith Karampuri
 
Glusterfs session #16 self-heal daemon ( for replication)
Glusterfs session #16   self-heal daemon ( for replication)Glusterfs session #16   self-heal daemon ( for replication)
Glusterfs session #16 self-heal daemon ( for replication)
Pranith Karampuri
 
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
Pranith Karampuri
 
Glusterfs session #11 locks xlator entrylks
Glusterfs session #11   locks xlator entrylksGlusterfs session #11   locks xlator entrylks
Glusterfs session #11 locks xlator entrylks
Pranith Karampuri
 
Glusterfs session #9 index xlator
Glusterfs session #9   index xlatorGlusterfs session #9   index xlator
Glusterfs session #9 index xlator
Pranith Karampuri
 
Glusterfs session #7 client, server interactions
Glusterfs session #7   client, server interactionsGlusterfs session #7   client, server interactions
Glusterfs session #7 client, server interactions
Pranith Karampuri
 
Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
Pranith Karampuri
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming model
Pranith Karampuri
 
Glusterfs session #2 1 layer above disk filesystems
Glusterfs session #2   1 layer above disk filesystemsGlusterfs session #2   1 layer above disk filesystems
Glusterfs session #2 1 layer above disk filesystems
Pranith Karampuri
 
Glusterfs session #1 disk filesystems
Glusterfs session #1   disk filesystemsGlusterfs session #1   disk filesystems
Glusterfs session #1 disk filesystems
Pranith Karampuri
 

More from Pranith Karampuri (11)

Glusterfs session #12 locks xlator posixlk
Glusterfs session #12   locks xlator posixlkGlusterfs session #12   locks xlator posixlk
Glusterfs session #12 locks xlator posixlk
 
Glusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healingGlusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healing
 
Glusterfs session #16 self-heal daemon ( for replication)
Glusterfs session #16   self-heal daemon ( for replication)Glusterfs session #16   self-heal daemon ( for replication)
Glusterfs session #16 self-heal daemon ( for replication)
 
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
 
Glusterfs session #11 locks xlator entrylks
Glusterfs session #11   locks xlator entrylksGlusterfs session #11   locks xlator entrylks
Glusterfs session #11 locks xlator entrylks
 
Glusterfs session #9 index xlator
Glusterfs session #9   index xlatorGlusterfs session #9   index xlator
Glusterfs session #9 index xlator
 
Glusterfs session #7 client, server interactions
Glusterfs session #7   client, server interactionsGlusterfs session #7   client, server interactions
Glusterfs session #7 client, server interactions
 
Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming model
 
Glusterfs session #2 1 layer above disk filesystems
Glusterfs session #2   1 layer above disk filesystemsGlusterfs session #2   1 layer above disk filesystems
Glusterfs session #2 1 layer above disk filesystems
 
Glusterfs session #1 disk filesystems
Glusterfs session #1   disk filesystemsGlusterfs session #1   disk filesystems
Glusterfs session #1 disk filesystems
 

Recently uploaded

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 

Recently uploaded (20)

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 

Glusterfs session #18 intro to fuse and its trade offs

  • 1. Gluster Dev session #18 Intro to FUSE and its trade-offs
  • 2. Scope various parts of fuse code in the glusterfs source tree the story FUSE version macros tell the tale of FUSE and fuse (historical context, terminology) to libfuse or not to libfuse? FUSE proto breakdown mount and INIT
  • 3. fuse code in the gluster tree > git ls-files '*fuse*.[ch]' | grep -v ^tests/ | sed 's@/[^/]*$@/@' | uniq | cat -n 1 contrib/fuse-include/ 2 contrib/fuse-lib/ 3 contrib/fuse-util/ 4 contrib/macfuse/ 5 xlators/mount/fuse/src/
  • 4. FUSE version macros xlators/mount/fuse/src/fuse-bridge.c: static void fuse_create(xlator_t *this, fuse_in_header_t *finh, void *msg, struct iobuf *iobuf) { #if FUSE_KERNEL_MINOR_VERSION >= 12 struct fuse_create_in *fci = msg; fuse_private_t *priv = NULL; int32_t ret = -1; #else struct fuse_open_in *fci = msg; #endif char *name = (char *)(fci + 1); ...
  • 5. fuse_state_t *state = NULL; #if FUSE_KERNEL_MINOR_VERSION >= 12 priv = this->private; if (priv->proto_minor < 12) name = (char *)((struct fuse_open_in *)msg + 1); #endif
  • 6. fuse history kernel: micro (GNU Hurd) vs monolithic userspace filesystesms: "tarfs", "sshfs"; NFS, Arla, 9P Linux: AFVS, lufis, shfs fuse: project of Miklós Szeredi; got merged in 2005 to 2.6.14 (gmailfs, sshfs) first non-Linux port: fuse4bsd, GSoC 2005, Csaba Henk NetBSD: puffs/refuse; Mac: OSXFUSE / FUSE for macOS / macFUSE, 2011-
  • 7. fuse and FUSE fuse: project / code FUSE: protocol FUSE follows a client-server architecture kernel: client userspace: server libfuse: de facto reference server lib however, a server lib is more like a framework (think of Apache, Nginx) Go, Rust... glusterfs is also a framework
  • 8. What have the Romans libfuse ever done for us? we do use: mounting we do roll our own: uniform API over versions and platforms we make up our own minds about it: threading / synchronization / fuse dev I/O although automatic thread scaling would be nice to have ...
  • 9. we don't need: support for all FUSE features command-line driven configuration we need to roll our own: support for FUSE features
  • 10. fuse code in the gluster tree, continued > git ls-files '*fuse*.[ch]' | grep -v ^tests/ | sed 's@/[^/]*$@/@' | uniq | (i=1; while read d; do echo "# $i. $d"; git ls-files "$d/*.[ch]" | cat -n i=$(($i+1)) done) # 1. contrib/fuse-include/ 1 contrib/fuse-include/fuse-misc.h 2 contrib/fuse-include/fuse-mount.h 3 contrib/fuse-include/fuse_kernel.h 4 contrib/fuse-include/fuse_kernel_macfuse.h 5 contrib/fuse-include/mount_util.h ...
  • 11. # 2. contrib/fuse-lib/ 1 contrib/fuse-lib/misc.c 2 contrib/fuse-lib/mount-common.c 3 contrib/fuse-lib/mount-gluster-compat.h 4 contrib/fuse-lib/mount.c ...
  • 12. # 3. contrib/fuse-util/ 1 contrib/fuse-util/fusermount.c 2 contrib/fuse-util/mount_util.c ...
  • 13. # 4. contrib/macfuse/ 1 contrib/macfuse/fuse_ioctl.h 2 contrib/macfuse/fuse_param.h 3 contrib/macfuse/mount_darwin.c ...
  • 14. # 5. xlators/mount/fuse/src/ 1 xlators/mount/fuse/src/fuse-bridge.c 2 xlators/mount/fuse/src/fuse-bridge.h 3 xlators/mount/fuse/src/fuse-helpers.c 4 xlators/mount/fuse/src/fuse-mem-types.h 5 xlators/mount/fuse/src/fuse-resolve.c
  • 15. FUSE client (kernel) sends FUSE request server (userspace) replies with FUSE response message structure: header + body exceptions: FORGET does not get a response reverse notifications (invalidations): server's requests
  • 16. struct fuse_in_header { uint32_t len; uint32_t opcode; uint64_t unique; uint64_t nodeid; uint32_t uid; uint32_t gid; uint32_t pid; uint32_t padding; }; struct fuse_out_header { uint32_t len; int32_t error; uint64_t unique; };
  • 17. mount and INIT mount(2): VFS general and instance specific options INIT: version handshake + option negotiation mount options are per-mount, INIT options are per-fs
  • 18. initialization sequence: open /dev/fuse mount with -ofd=... kernel sends INIT userspace replies INIT mount returns concerns: unprivileged mounting security frameworks' (eg. SELinux) probing