Whamcloud - gitweb
Remove trailing whitespace for the entire source tree
[tools/e2fsprogs.git] / lib / ext2fs / freefs.c
index 9dda403..2a1c915 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * freefs.c --- free an ext2 filesystem
- * 
+ *
  * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
  *
  * %Begin-Header%
@@ -24,7 +24,8 @@ void ext2fs_free(ext2_filsys fs)
        if (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))
                return;
        if (fs->image_io != fs->io) {
-               io_channel_close(fs->image_io);
+               if (fs->image_io)
+                       io_channel_close(fs->image_io);
        }
        if (fs->io) {
                io_channel_close(fs->io);
@@ -51,47 +52,12 @@ void ext2fs_free(ext2_filsys fs)
 
        if (fs->icache)
                ext2fs_free_inode_cache(fs->icache);
-       
+
        fs->magic = 0;
 
        ext2fs_free_mem(&fs);
 }
 
-void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap)
-{
-       if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_GENERIC_BITMAP))
-               return;
-
-       bitmap->magic = 0;
-       if (bitmap->description) {
-               ext2fs_free_mem(&bitmap->description);
-               bitmap->description = 0;
-       }
-       if (bitmap->bitmap) {
-               ext2fs_free_mem(&bitmap->bitmap);
-               bitmap->bitmap = 0;
-       }
-       ext2fs_free_mem(&bitmap);
-}
-
-void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap)
-{
-       if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP))
-               return;
-
-       bitmap->magic = EXT2_ET_MAGIC_GENERIC_BITMAP;
-       ext2fs_free_generic_bitmap(bitmap);
-}
-
-void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap)
-{
-       if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP))
-               return;
-
-       bitmap->magic = EXT2_ET_MAGIC_GENERIC_BITMAP;
-       ext2fs_free_generic_bitmap(bitmap);
-}
-
 /*
  * Free the inode cache structure
  */