summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1998-02-16 22:00:37 +0000
committerTheodore Ts'o <tytso@mit.edu>1998-02-16 22:00:37 +0000
commit9abd2ce914f9373fb676f0bb620ffba3a0e3c49e (patch)
tree45edf666151c4304dc80500a3b7731c751fee379 /lib/ext2fs
parent63b44fbe303ea00118cbe24cbbcde351a9bc0aac (diff)
downloade2fsprogs-9abd2ce914f9373fb676f0bb620ffba3a0e3c49e.tar.gz
ChangeLog, bmove.c, ext2_io.h, ext2fs.h, rw_bitmaps.c, test_io.c:
ext2_io.h, ext2fs.h: Protect against being included multiple times. bmove.c: #include ext2fsP.h instead of "ext2fs/ext2fs.h" test_io.c (test_flush): Add a debugging printf when the flush method is called. rw_bitmaps.c (ext2fs_read_bitmaps): If the bitmaps are already read in, return right away.
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/ChangeLog12
-rw-r--r--lib/ext2fs/bmove.c2
-rw-r--r--lib/ext2fs/ext2_io.h6
-rw-r--r--lib/ext2fs/ext2fs.h4
-rw-r--r--lib/ext2fs/rw_bitmaps.c3
-rw-r--r--lib/ext2fs/test_io.c9
6 files changed, 33 insertions, 3 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 36a10aed..0478c831 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,15 @@
+Mon Feb 16 16:16:00 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * ext2_io.h, ext2fs.h: Protect against being included multiple times.
+
+ * bmove.c: #include ext2fsP.h instead of "ext2fs/ext2fs.h"
+
+ * test_io.c (test_flush): Add a debugging printf when the flush
+ method is called.
+
+ * rw_bitmaps.c (ext2fs_read_bitmaps): If the bitmaps are already
+ read in, return right away.
+
Sun Feb 1 08:20:24 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
* bitops.h: Don't try to do i386 inline asm functions if the
diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c
index 1d408603..0a06ff0d 100644
--- a/lib/ext2fs/bmove.c
+++ b/lib/ext2fs/bmove.c
@@ -24,7 +24,7 @@
#include <linux/ext2_fs.h>
#endif
-#include "ext2fs/ext2fs.h"
+#include "ext2fsP.h"
struct process_block_struct {
ino_t ino;
diff --git a/lib/ext2fs/ext2_io.h b/lib/ext2fs/ext2_io.h
index d20ebf01..95688669 100644
--- a/lib/ext2fs/ext2_io.h
+++ b/lib/ext2fs/ext2_io.h
@@ -9,6 +9,9 @@
* %End-Header%
*/
+#ifndef _EXT2FS_EXT2_IO_H
+#define _EXT2FS_EXT2_IO_H
+
/*
* ext2_loff_t is defined here since unix_io.c needs it.
*/
@@ -86,3 +89,6 @@ extern void (*test_io_cb_write_blk)
(unsigned long block, int count, errcode_t err);
extern void (*test_io_cb_set_blksize)
(int blksize, errcode_t err);
+
+#endif /* _EXT2FS_EXT2_IO_H */
+
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index 7b081abc..12928044 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -9,6 +9,9 @@
* %End-Header%
*/
+#ifndef _EXT2FS_EXT2FS_H
+#define _EXT2FS_EXT2FS_H
+
/*
* Non-GNU C compilers won't necessarily understand inline
*/
@@ -905,3 +908,4 @@ _INLINE_ int ext2fs_group_of_ino(ext2_filsys fs, ino_t ino)
#undef _INLINE_
#endif
+#endif /* _EXT2FS_EXT2FS_H */
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index 168a9e7f..8ad93de0 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -257,6 +257,9 @@ errcode_t ext2fs_read_bitmaps(ext2_filsys fs)
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+ if (fs->inode_map && fs->block_map)
+ return 0;
+
return read_bitmaps(fs, !fs->inode_map, !fs->block_map);
}
diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c
index d5556844..10cf3a58 100644
--- a/lib/ext2fs/test_io.c
+++ b/lib/ext2fs/test_io.c
@@ -225,13 +225,18 @@ static errcode_t test_write_blk(io_channel channel, unsigned long block,
static errcode_t test_flush(io_channel channel)
{
struct test_private_data *data;
+ errcode_t retval = 0;
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct test_private_data *) channel->private_data;
EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
if (data->real)
- return io_channel_flush(data->real);
- return 0;
+ retval = io_channel_flush(data->real);
+
+ printf("Test_io: flush() returned %s\n",
+ retval ? error_message(retval) : "OK");
+
+ return retval;
}