usbloadergx/libcustomext2fs/source/freefs.c
dimok321 0f17471b27 *Removed ntfs/fat source and added them as custom libs (makes them easier to update later)
*Added sources of the custom libs to the branches
*Fixed crash when switching from list layout to grid/carousel layout
*Removed 1:1 copy option because its meaningless and almost the same as installing all partitions
*Fixed install partition selection. This option needs a reset. Go to settings and reselect your option for this.
*Fixed schinese and tchinese language modes (filename bugs. has to be schinese.lang and tchinese.lang like on SVN)
*Fixed bug in sound buffer circle
*Fixed incorrect behaviour of x-flip when selecting system like (thx Cyan for the patch)
*Accept ios revision 65535 for Waninkokos IOSes (thx to PPSainity for pointing it out)
*Merged the new theming style branch into trunk. Just as a reminder: ALL old themes will not work until the themers did port it to the new style!
*Removed old theme style completely

Theme example:
The example file of the theme is the Default.them file. It can be found in the SVN trunk.

Change in loading of themes:
When selecting a theme now a list of all .them files in a folder is displayed. The image folder of that theme has to be in the same folder as the .them file. The image path is defined in the head of the .them file in the line with "Image-Folder: Example\n".
2010-12-26 17:02:14 +00:00

113 lines
2.2 KiB
C

/*
* freefs.c --- free an ext2 filesystem
*
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Library
* General Public License, version 2.
* %End-Header%
*/
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "ext2_fs.h"
#include "ext2fsP.h"
static void ext2fs_free_inode_cache(struct ext2_inode_cache *icache);
void ext2fs_free(ext2_filsys fs)
{
if (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))
return;
if (fs->image_io != fs->io) {
if (fs->image_io)
io_channel_close(fs->image_io);
}
if (fs->io) {
io_channel_close(fs->io);
}
if (fs->device_name)
ext2fs_free_mem(&fs->device_name);
if (fs->super)
ext2fs_free_mem(&fs->super);
if (fs->orig_super)
ext2fs_free_mem(&fs->orig_super);
if (fs->group_desc)
ext2fs_free_mem(&fs->group_desc);
if (fs->block_map)
ext2fs_free_block_bitmap(fs->block_map);
if (fs->inode_map)
ext2fs_free_inode_bitmap(fs->inode_map);
if (fs->badblocks)
ext2fs_badblocks_list_free(fs->badblocks);
fs->badblocks = 0;
if (fs->dblist)
ext2fs_free_dblist(fs->dblist);
if (fs->icache)
ext2fs_free_inode_cache(fs->icache);
fs->magic = 0;
ext2fs_free_mem(&fs);
}
/*
* Free the inode cache structure
*/
static void ext2fs_free_inode_cache(struct ext2_inode_cache *icache)
{
if (--icache->refcount)
return;
if (icache->buffer)
ext2fs_free_mem(&icache->buffer);
if (icache->cache)
ext2fs_free_mem(&icache->cache);
icache->buffer_blk = 0;
ext2fs_free_mem(&icache);
}
/*
* This procedure frees a badblocks list.
*/
void ext2fs_u32_list_free(ext2_u32_list bb)
{
if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
return;
if (bb->list)
ext2fs_free_mem(&bb->list);
bb->list = 0;
ext2fs_free_mem(&bb);
}
void ext2fs_badblocks_list_free(ext2_badblocks_list bb)
{
ext2fs_u32_list_free((ext2_u32_list) bb);
}
/*
* Free a directory block list
*/
void ext2fs_free_dblist(ext2_dblist dblist)
{
if (!dblist || (dblist->magic != EXT2_ET_MAGIC_DBLIST))
return;
if (dblist->list)
ext2fs_free_mem(&dblist->list);
dblist->list = 0;
if (dblist->fs && dblist->fs->dblist == dblist)
dblist->fs->dblist = 0;
dblist->magic = 0;
ext2fs_free_mem(&dblist);
}