/* Create a new entry with 'fn' file name.  */
static ramfs_entry_t* ramfs_entry_new(const char *fn)
/* Create a new entry with 'fn' file name.  */
static ramfs_entry_t* ramfs_entry_new(const char *fn)
{
    ramfs_entry_t *new_entry = NULL;
    size_t fn_len;
    int ret = -1;
    ret = ramfs_entry_dir_new(fn);
    if (ret != RAMFS_OK) {
        return NULL;
    }
    new_entry = ramfs_ll_ins_head(&g_file_ll);
    if (new_entry == NULL) {
        return NULL;
    }
    fn_len = strlen(fn);
    new_entry->fn = ramfs_mm_alloc(fn_len + 1);
    strncpy(new_entry->fn, fn, fn_len);
    new_entry->fn[fn_len] = '\0';
    new_entry->data       = NULL;
    new_entry->size       = 0;
    new_entry->refs       = 0;
    new_entry->const_data = 0;
    new_entry->is_dir     = 0;
    new_entry->link       = NULL;
    new_entry->link_count = 0;
    return new_entry;
}