At Thu, 27 Dec 2012 22:00:41 +0800, levin li wrote: > > From: levin li <xingke.lwp at taobao.com> > > This module provides function for users to take sheepdog VDIs as block > devices in linux, users can register a VDI to its kernel space, it just > like that a new hard disk is added to the computer, users can create > partitions for the disk, format the disk or mount the disk, it provides > users a efficient way to use sheepdog as distributed storage system. > > The usage is easy, after install the module sheepdev.ko, it creates a proc > entry '/proc/entry', you can write into the proc entry file to control > the driver. > > Add a new block device from an existing sheepdog VDI: > > # echo "add 127.0.0.1:7070 a5d05d" > /proc/sheep > > It would create a block device /dev/sheepa, you can format/mount this device: > > # mkfs.ext4 /dev/sheepa > # mount -t ext4 /sheep/sheepa test > > Remove a block device from the kernel: > > # echo "del sheepa" > /proc/sheep > > Signed-off-by: levin li <xingke.lwp at taobao.com> > --- > sheepdev/connect.c | 178 ++++++++++++ > sheepdev/module.c | 726 ++++++++++++++++++++++++++++++++++++++++++++++ > sheepdev/sheep.c | 136 +++++++++ > sheepdev/sheep.h | 88 ++++++ > sheepdev/sheepdog_proto.h | 290 ++++++++++++++++++ > 5 files changed, 1418 insertions(+) > create mode 100644 sheepdev/connect.c > create mode 100644 sheepdev/module.c > create mode 100644 sheepdev/sheep.c > create mode 100644 sheepdev/sheep.h > create mode 100644 sheepdev/sheepdog_proto.h > It is interesting. I've not looked the internal of sheepdev, but I tried to build it and found this compile error: /home/mitake/github/sheepdog.git/sheepdev/connect.c: In function ‘connect_to’: /home/mitake/github/sheepdog.git/sheepdev/connect.c:31: error: implicit declaration of function ‘in_aton’ It seems that including <linux/inet.h> in sheep.h is required. The version of my environment for building the kernel module is 3.7.0-rc7. Thanks, Hitoshi |