~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to lib/ext2fs/freefs.c

  • Committer: Daniel Mehrmann
  • Date: 2014-12-16 09:16:59 UTC
  • mfrom: (1.2.25)
  • Revision ID: daniel.mehrmann@gmx.de-20141216091659-ymhbl4ualba43vuc
Tags: 1.43-SN-2014-12-16-0ubuntu1
* Merge in snapshot from the maint branch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "ext2_fs.h"
19
19
#include "ext2fsP.h"
20
20
 
21
 
static void ext2fs_free_inode_cache(struct ext2_inode_cache *icache);
22
 
 
23
21
void ext2fs_free(ext2_filsys fs)
24
22
{
25
23
        if (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))
63
61
 
64
62
        fs->magic = 0;
65
63
 
 
64
        ext2fs_zero_blocks2(NULL, 0, 0, NULL, NULL);
66
65
        ext2fs_free_mem(&fs);
67
66
}
68
67
 
69
68
/*
70
 
 * Free the inode cache structure
71
 
 */
72
 
static void ext2fs_free_inode_cache(struct ext2_inode_cache *icache)
73
 
{
74
 
        if (--icache->refcount)
75
 
                return;
76
 
        if (icache->buffer)
77
 
                ext2fs_free_mem(&icache->buffer);
78
 
        if (icache->cache)
79
 
                ext2fs_free_mem(&icache->cache);
80
 
        icache->buffer_blk = 0;
81
 
        ext2fs_free_mem(&icache);
82
 
}
83
 
 
84
 
/*
85
69
 * This procedure frees a badblocks list.
86
70
 */
87
71
void ext2fs_u32_list_free(ext2_u32_list bb)