File system as module?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Okay... I've been playing around with implementing my own file system (as
an exercise). I'd like to implement it as a standalone module. However, I
notice that certain data structure that are defined in kernel header files
have file system specific fields in them. For example, I'm looking at the
definition of struct inode in include/linux/fs.h. The member "u" is a
union of file system specific structures where each file system stores
information related to it (or so I assume).

It seems to me that I need to store information specific to my file system
too. However, I'm reluctant to define my own structure and then edit
include/linux/fs.h to include it. In theory wouldn't that make it
impossible to support my file system as a "pure" binary module? The main
kernel would have to be recompiled to account for the possibly different
size of struct inode. I couldn't just insmod my filesystem module into a
kernel what was not thusly prepared.

How do people implement file systems as modules? Can it be done?

Peter

Wait... wait... I think I might be answering my own question. I see that
the "u" member of struct inode has a void * named generic_ip. So could I
allocate my own file system specific structure (elsewhere) and put its
address into that member? Of course I'd have to manage those file system
specific structures (what a pain) but I suppose that could be done. Is
this the right track?


-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux