X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbucket.h;h=759ef0e4761e4b035d8242a7bc57339bdb4f1280;hb=ae9721feabb6690778d9bc6751f6a6f434cdbeaf;hp=73ceafaf09677080e764972ff3ef9388852835d4;hpb=69ed9fa64a4eac3b0f77b873f10e88644c626713;p=libucw.git diff --git a/lib/bucket.h b/lib/bucket.h index 73ceafaf..759ef0e4 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -39,7 +39,6 @@ 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 */ -sh_off_t obuck_size(void); /* Returns current size of bucket file */ /* Searching for buckets */ void obuck_find_by_oid(struct obuck_header *hdrp); @@ -56,3 +55,13 @@ void obuck_create_end(struct fastbuf *b, struct obuck_header *hdrp); /* Deleting buckets */ void obuck_delete(oid_t oid); + +/* Convert bucket ID to file position (for size limitations etc.) */ + +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));