3 * (c) 2008-2009 Laurent Vivier <Laurent@lvivier.info>
5 * This file has been copied from EMILE, http://emile.sf.net
11 #include "ext2_utils.h"
15 ext2_VOLUME* ext2_mount(int fd)
18 struct ext2_super_block *super;
21 super = (struct ext2_super_block*)malloc(sizeof(struct ext2_super_block));
25 ext2_get_super(fd, super);
26 if (super->s_magic != EXT2_SUPER_MAGIC) {
31 buffer = (char*)malloc(EXT2_BLOCK_SIZE(super));
37 volume = (ext2_VOLUME*)malloc(sizeof(ext2_VOLUME));
44 volume->buffer = buffer;
46 volume->super = super;
49 ext2_read_block(volume, 0);
54 int ext2_umount(ext2_VOLUME* volume)