]> mj.ucw.cz Git - libucw.git/commitdiff
Introduced obuck_get_pos(), converted gatherd limits to use it.
authorMartin Mares <mj@ucw.cz>
Mon, 5 Mar 2001 12:35:58 +0000 (12:35 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 5 Mar 2001 12:35:58 +0000 (12:35 +0000)
lib/bucket.c
lib/bucket.h

index 5799d6e5698d6c7a74176265e0ee4b7e8b716518..cac9419f382799f017d944b872e5727853ab4353 100644 (file)
@@ -157,7 +157,7 @@ obuck_get(oid_t oid)
 {
   struct fastbuf *b = obuck_fb;
 
-  bucket_start = ((sh_off_t) oid) << OBUCK_SHIFT;
+  bucket_start = obuck_get_pos(oid);
   bflush(b);
   if (sh_pread(obuck_fd, &obuck_hdr, sizeof(obuck_hdr), bucket_start) != sizeof(obuck_hdr))
     obuck_broken("Short header read");
index f99baae92ffbc6068952363e99d324fb8a5f61c9..bdf35e81d97c2df2c73747107347ac6a840fc937 100644 (file)
@@ -55,3 +55,10 @@ 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;
+}