By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,385 Members | 1,739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,385 IT Pros & Developers. It's quick & easy.

Creating a file system with FUSE.

P: 78
Hi all. I'm not sure if this is the right place to ask, but here it goes.
I'm trying to create a file system using the File System in User Space (FUSE) kernel module. From what i have understood, i need to implement certain functions, like the read, write, and delete that should be referenced by the fuse_main function. Now whenever my program uses the standard C functions, it references the functions i created to manipulate the file in my file system (passed to the program as an arguement).

My question is about the implementation of the functions. There are multiple layers that need to be implemented, each responsible for certain functionalitlies. I am having a hard time figuring out how to implement the functions. I downloaded the fuse from sourceforge, and i installed it. It seems to have a library of functions. These functions do contain read, write functions. The layer i'm supposed to implement is an interface for the fuse kernel module.

Now am i supposed to use the functions in the fuse kernel to implement my functions or should i use the standard C lib functions? I'm confused cause the example in the downloaded fuse archive was using the C lib functions to implement the fuse functions.

I'm sorry it's a little vague, i don't know how to explain it better.
I guess i want to know how to implement the functions.

Thanks alot.
May 23 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 9,197
My guess is you are to use the C lib functions that are provided by FUSE.

Your code should be independent of the file system.

As I say, this is a guess ut I have used files with several operating systems and all provide a set of C lib functions for the particular operatint system.
May 24 '07 #2

P: 78
Well, after some thorough analysis, I've understood that I have to implement these functions using Linux system calls just like in here.
But i have trouble understanding how FUSE works. I've read some stuff on it, but I can't seem to wrap my brain around it. When does my function get called really? Let's say i have a program that reads from a file. When the program calls fopen, does the FUSE take over? What does it do then? It's said:
In user space, FUSE implements a library which manages communications with the kernel module. It accepts filesystem requests from the FUSE device and translates them into a set of function calls which look similar (but not identical) to the kernel's VFS interface. These functions have names like open(), read(), write(), rename(), symlink(), etc.
FUSE "dereferences" the function call to the one i've implemented, but what's that got to do with my partition and my file system? What will be so special about making a system call through the implemented function and not the program itself?

Thanks a lot.
May 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.