X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fbucket.h;h=759ef0e4761e4b035d8242a7bc57339bdb4f1280;hb=89556b90f1afb9b7ebe247c05721e0a04a7232c0;hp=f99baae92ffbc6068952363e99d324fb8a5f61c9;hpb=dd4dbaf87958b0b6d49dd8e58c0d3b9f0a421fd2;p=libucw.git diff --git a/lib/bucket.h b/lib/bucket.h index f99baae9..759ef0e4 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -55,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));