X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbucket.h;h=1af677cad8907556efe32502b40efa88ccf461eb;hb=271d2a02e7b798fd9781018c060d49e47f277cba;hp=b493305d20a30c800268dcc04ee1883f0e4bcadd;hpb=ed7c7b20afed72df0d4195548ec5346f1daac1d1;p=libucw.git diff --git a/lib/bucket.h b/lib/bucket.h index b493305d..1af677ca 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Object Buckets * - * (c) 2001--2003 Martin Mares + * (c) 2001--2004 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -46,7 +46,8 @@ enum bucket_type { BUCKET_TYPE_COMPAT = 0x7fffffff, /* and less -- buckets created by older versions of Sherlock */ BUCKET_TYPE_PLAIN = 0x80000000, /* plain textual buckets */ BUCKET_TYPE_V30 = 0x80000001, /* v3.0 uncompressed buckets */ - BUCKET_TYPE_V30C = 0x80000002 /* v3.0 compressed buckets */ + BUCKET_TYPE_V33 = 0x80000002, /* v3.3 uncompressed buckets */ + BUCKET_TYPE_V33_LIZARD = 0x80000003 /* v3.3 buckets compressed by lizard */ }; struct fastbuf; @@ -84,6 +85,13 @@ static inline sh_off_t obuck_get_pos(oid_t oid) return ((sh_off_t) oid) << OBUCK_SHIFT; } +/* Calculate size of bucket which contains given amount of data */ + +static inline uns obuck_bucket_size(uns len) +{ + return ALIGN(sizeof(struct obuck_header) + len + 4, OBUCK_ALIGN); +} + /* Shaking down bucket file */ void obuck_shakedown(int (*kibitz)(struct obuck_header *old, oid_t new, byte *buck));