Before we get into the details of using FUSE, and of the Big Brother File System, let's see how the files are organized.
The code for the BBFS running example is in subdirectory
Makefileis used to direct the compilation of the code. The code is so simple that I just hard-coded a Makefile rather than using automake; it requires
pkg-config(and of course FUSE!), but everything else ought to be available in any Linux system used for development.
bb_, so it's easy to tell my code from system code.
The file also contains a
struct fuse_operations named
bb_oper, containing pointers to the functions (we'll
struct in the next section)
The functions that are pointed to by fields in the
struct fuse data structure all have names
derived from their field names by prepending the standard
bb_ prefix. So, for instance, the
open() function is
log.c. Their names all start with
log_, again to help identify the logging code.
log.hcontains prototypes for the functions that are called from elsewhere (and, of course, the only "elsewhere" in this project is
pread()system call, and defines a
struct bb_statethat stores filesystem state.
I should also mention that nearly all of the documentation on FUSE
itself is in the
/usr/include/fuse/fuse.h. This is where prototypes are
given for all functions, and comments describe their use. My
bbfs.c file started as a copy of that file, with my code
Next: Compiling and Running BBFS