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 ../src
Makefile
Makefile
is 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.
bbfs.c
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
discuss this 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 bb_open()
.
log.c
and log.h
log.c
. Their names all start with
log_
, again to help identify the logging code.
log.h
contains prototypes for the functions that
are called from elsewhere (and, of course, the only "elsewhere"
in this project is bbfs.c
).
params.h
pread()
system call, and defines a struct bb_state
that stores filesystem state.
I should also mention that nearly all of the documentation on FUSE
itself is in the #include
file
/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
inserted.
Next: Compiling and Running BBFS