You are not logged in.

#1 2009-01-28 14:56:56

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Virtual File System, Mounting etc in C++

Hi,

I have a file which acts as a container, it contains (encrypted) files & directories and I have an API for adding stuff to this container, extracting stuff and deleting stuff.

How 'complex' would it be to wrap a virtual file system around this so I could mount the container as a device under linux? I assume I would need to write a kernel driver (ouch), but ideally i would like to be able to mount it with the mount command, then have my driver intercept I/O operations and map them to my somewhat simplistic API.

Is this possible, or is it very hard to pull of?

Thanks

Offline

#2 2009-01-28 16:03:28

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: Virtual File System, Mounting etc in C++

with fuse you can do that i think.
but I take it your thing is not posix compliant? aren't there enough fs'es already you could use instead? or do you mostly want to learn? smile in that case it's cool tongue


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#3 2009-01-28 16:45:26

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Virtual File System, Mounting etc in C++

You could create an ext2 file however that is done and mount that... unless if you want learn.


Website - Blog - arch-home
Arch User since March 2005

Offline

#4 2009-01-28 17:29:59

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Virtual File System, Mounting etc in C++

If you want to do the kernel module thing, start with the ramfs module, as its relatively simple and doesn't have much filesystem specific stuff in it, so its easy to see where you need to 'hook' your commands into it. I had to work with something like this for some research into versioned filesystems. Its actually not that hard if you know C.

Dusty

Offline

Board footer

Powered by FluxBB