#include #include int gladfs_alloc_fragdata(struct gladfs_fragment_data_s **parent, int nb_block) { extern struct gladfs_superblock_s gladfs_superblock; // Check error if (parent == NULL) return (-1); // Try to alloc block *parent = pm_alloc(gladfs_superblock.block_size * nb_block); if (*parent == NULL) return (-1); // Fill default value. (*parent)->next = 0x00000000; (*parent)->data_size = gladfs_superblock.block_size * nb_block; (*parent)->data_used = 0x00000000; return (0); }