minimum number of *.c files needed for light waight ZFS

Developer discussions.

minimum number of *.c files needed for light waight ZFS

Postby bhagaban » Tue Dec 08, 2015 10:53 pm

HI,

I want to build a light waight ZFS file system. The operation supported by this file system should be as follow

1. mount
2. unmount
3.read
4 write
5. Adding virtual devices into the file system.

I saw so many *.c files are ther in Kernel module ~/zfs-master/module/zfs/

What are the files (*.c files) I need to consider for above 5 operations. I want to build on OSX platform.

Regards,

Bhagaban
bhagaban
 
Posts: 22
Joined: Mon Nov 30, 2015 6:31 am

Re: minimum number of *.c files needed for light waight ZFS

Postby lundman » Wed Dec 09, 2015 4:30 pm

To do mount, you need to define all the vnops for your filesystem. To register a new filesystem you call vfs_fsadd(), which includes the high level https://github.com/openzfsonosx/zfs/blob/master/module/zfs/zfs_vnops_osx.c#L98 VFS calls. From that, you need to define the https://github.com/openzfsonosx/zfs/blob/master/module/zfs/zfs_vnops_osx.c#L3920 vnops (vnode-operations). We define one set for directory-vnodes, file-vnodes, symlink-vnodes, extended-attribute vnodes and finally error-vnodes. Each list of vnops called depending on the type of the vnode object.

As you can see, the vnops include everything, like listing directories (readdir) to basic file IO (read/write) and all that. You will have to implement nearly all of them for a basic functional filesystem.

If you are just starting out, you should like at FUSE, which does all this for you and lets you define a filesystem in userland. Far fewer panics that way.

As for adding virtual device (a new /dev/diskX) entry, I used the example:

https://github.com/elsteveogrande/osx-n ... Device.cpp
User avatar
lundman
 
Posts: 428
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: minimum number of *.c files needed for light waight ZFS

Postby bhagaban » Mon Dec 21, 2015 2:45 am

How to create a storage pool, means raw storage pool and no file system on it. But when I am giving the below zpool create command it creates a pool as well as mounts the zfs file syetm. I want to avoid the file system, and need only the raw storage pool which is the collection of many virtual devices.

Rgds,

Bhagaban
bhagaban
 
Posts: 22
Joined: Mon Nov 30, 2015 6:31 am

Re: minimum number of *.c files needed for light waight ZFS

Postby bhagaban » Mon Dec 21, 2015 2:53 am

https://github.com/elsteveogrande/osx-n ... Device.cpp

How i will use this driver. Any test program will help me a lot.
bhagaban
 
Posts: 22
Joined: Mon Nov 30, 2015 6:31 am

Re: minimum number of *.c files needed for light waight ZFS

Postby bhagaban » Wed Feb 03, 2016 10:58 pm

Hi ,
What are the source file need to touch to create a ZVOL block device only. and file system.

Regards,
Bhagaban
bhagaban
 
Posts: 22
Joined: Mon Nov 30, 2015 6:31 am


Return to OpenZFS on OS X Development

Who is online

Users browsing this forum: No registered users and 1 guest