X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbucket.h;h=24e7ae00d13c1a5d810a2eae38559de8960aa7ab;hb=9f87c6fe6552ce8b2236a07307d2f825b0e4c439;hp=bdf35e81d97c2df2c73747107347ac6a840fc937;hpb=995458e48d482bd5fa349882fba5cb4d6350076d;p=libucw.git diff --git a/lib/bucket.h b/lib/bucket.h index bdf35e81..24e7ae00 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -2,6 +2,9 @@ * Sherlock Library -- Object Buckets * * (c) 2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ /* @@ -39,6 +42,9 @@ struct fastbuf; void obuck_init(int writeable); /* Initialize the bucket module */ void obuck_cleanup(void); /* Clean up the bucket module */ void obuck_sync(void); /* Flush all buffers to disk */ +void obuck_lock_read(void); /* Explicit locking to make sure other threads don't touch buckets now */ +void obuck_lock_write(void); +void obuck_unlock(void); /* Searching for buckets */ void obuck_find_by_oid(struct obuck_header *hdrp); @@ -62,3 +68,6 @@ static inline sh_off_t obuck_get_pos(oid_t oid) { return ((sh_off_t) oid) << OBUCK_SHIFT; } + +/* Shaking down bucket file */ +void obuck_shakedown(int (*kibitz)(struct obuck_header *old, oid_t new, byte *buck));