<commit_before>#include <lib/string.h>
#include <kernel/vfs.h>
#include <kernel/modules.h>
#include <modules/ext2/ext2.h>

static struct ext2_driver *driver;
static struct vfs_filesystem filesystem;

static unsigned int walk(struct vfs_filesystem *self, unsigned int index)
{

    return 0;
/*
    static char mem[1024];
    void *buffer = mem;

    driver->read_node(driver, 2, buffer);

    for (;;)
    {

        struct ext2_directory *directory = buffer;

        if (!directory->length)
            return 0;

        buffer += directory->size;

    }

    return 0;
*/
}

void ext2_filesystem_init(struct modules_module *module)
{

    driver = (struct ext2_driver *)module;

    vfs_filesystem_init(&filesystem, "/hda", 0, 0, 0, 0, 0, walk, 0, 0); 
    vfs_register_filesystem(&filesystem);

}

<commit_msg>some ext2 testing<commit_after>#include <lib/string.h>
#include <kernel/vfs.h>
#include <kernel/modules.h>
#include <modules/ext2/ext2.h>

static struct ext2_driver *driver;
static struct vfs_filesystem filesystem;

static unsigned int read(struct vfs_filesystem *self, unsigned int id, unsigned int count, void *buffer)
{

    driver->read_node(driver, id, buffer);

    return 4;

}

static unsigned int find(struct vfs_filesystem *self, char *name)
{

    if (string_find("ext2file1", name))
        return 14;

    if (string_find("ext2file2", name))
        return 15;

    return 0;

}

static unsigned int walk(struct vfs_filesystem *self, unsigned int id)
{

    if (!id)
        return 14;

    if (id > 15 - 1)
        return 0;

    return id + 1;

/*
    static char mem[1024];
    void *buffer = mem;

    driver->read_node(driver, 2, buffer);

    for (;;)
    {

        struct ext2_directory *directory = buffer;

        if (!directory->length)
            return 0;

        buffer += directory->size;

    }

    return 0;
*/
}

static char *get_name(struct vfs_filesystem *self, unsigned int id)
{

    if (id == 14)
        return "ext2file1";

    if (id == 15)
        return "ext2file2";

    return 0;

}

void ext2_filesystem_init(struct modules_module *module)
{

    driver = (struct ext2_driver *)module;

    vfs_filesystem_init(&filesystem, "/hda", 0, 0, read, 0, find, walk, get_name, 0); 
    vfs_register_filesystem(&filesystem);

}


{'fraction_non_alphanumeric': 0.12133158125273763, 'fraction_numerical': 0.02847130968024529, 'mean_word_length': 2.9721739130434783, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2727999', 'n_tokens_mistral': 839, 'n_tokens_neox': 761, 'n_words': 208}