diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-09-28 19:25:16 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-09-28 19:25:16 +0800 |
commit | 315ea376cbb90d67ac6d4bd8086b2d98339154cb (patch) | |
tree | 573f0a5b3f80dc4e6071d71438f3a3d060639c0b /libibex/block.h | |
parent | f9a01cf88d9383b8715d49470124e3eb11e1d984 (diff) | |
download | gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar.gz gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar.bz2 gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar.lz gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar.xz gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.tar.zst gsoc2013-evolution-315ea376cbb90d67ac6d4bd8086b2d98339154cb.zip |
Make sure we map the 'free' block to a block number when unlinking a block
2000-09-28 Not Zed <NotZed@HelixCode.com>
* block.c (ibex_block_free): Make sure we map the 'free' block to
a block number when unlinking a block (fixes a lot of assertion
failures).
(ibex_block_cache_open): Initialise sync flag on root block. If
it is not set on open then the index could be in an invalid state,
and should be rescanned.
(ibex_block_cache_sync): Sync root block last, and set the sync
flag.
(ibex_block_cache_open): Mirror root block flags in block_cache
struct.
(ibex_block_cache_sync): Likewise.
(ibex_block_read): If we write a dirty block, then we clear the
sync flag if its still set; we are no longer synced.
svn path=/trunk/; revision=5613
Diffstat (limited to 'libibex/block.h')
-rw-r--r-- | libibex/block.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libibex/block.h b/libibex/block.h index 40262de6e2..deb6494231 100644 --- a/libibex/block.h +++ b/libibex/block.h @@ -25,8 +25,12 @@ struct _root { blockid_t words; /* root of words index */ blockid_t names; /* root of names index */ + + char flags; /* state flags */ }; +#define IBEX_ROOT_SYNCF (1<<0) /* file is synced */ + /* basic disk structure for (data) blocks */ struct _block { unsigned int next:32-BLOCK_BITS; /* next block */ @@ -70,6 +74,8 @@ struct _memcache { GHashTable *index; /* blockid->memblock mapping */ int fd; /* file fd */ + int flags; /* flags (mirror of root->flags) */ + #ifdef IBEX_STATS GHashTable *stats; #endif |