VFS plug-in for single file io filtering.
VFS plug-in for single file io filtering.
- Subject: VFS plug-in for single file io filtering.
- From: Inso Reiges <email@hidden>
- Date: Mon, 28 Sep 2009 18:41:16 +0700
Hi,
I am new here (and to the osx development in general), so please bear
with me. Also. if this is not the best mailing list for me, please
direct me to the one that fits better.
I need to create a solution that will solve the following problem:
1) With the help of user-mode program it will take an arbitrary
existing file and a specified block mask.
2) Will present an access to said file as a contiguous space mapped by
specified sector mask through a BSD-style block device.
As an example, suppose i have a file and i want to create a device
/dev/something as an access point for this file that will map
read/write from/to block 0 to real block 4 on the original file.
I need this to port a part of the existing container encryption
software from windows and this setup (block devices) is kind of a
requirement, i.e. i am not allowed not take a different approach on
how i present the access to contiguous space now.
This is how i though i can accomplish this:
To set up such a device i need, obviously, a modified loopback-kind
driver for this device.
I know about existence of hdiutil and an I/OKit DiskImages driver for
that part and i decided that a sane way to take is to use this
existing functionality.
DiskImages driver does not know about any of the mapping stuff i need
to do so i figured i need to implement a layer that will transform my
original file into another file (with the 'dmg' extention). This layer
is also best suited to perform i/o mappings so i can proceed with
hdiutil on that new file to create a required loopback device node.
Since i can't use macfuse (another requirement) i thought of a
lightweight VFS kext that will present mapped .dmg file as a single
root vnode and will use read and write vnode ops to pass the request
to the actual file with corrected offsets. I can pass the block map
and a file descriptor from user space program to mount(2) call, which
will mount my VFS plug-in fs and give me a corresponding .dmg file to
pass on to hdiutil.
The question is, being a kernel newbie, before i start, what pitfalls
do i need to be aware of? Is it at all possible? If it is, what is the
best way to pass a read/write requiest from a VFS plug-in to the
actual file?
I also welcome any suggestions of a different solution architecture.
Best Regards,
Inso Reiges.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden