]> mj.ucw.cz Git - libucw.git/commitdiff
added obuck_size() returning the size of bucket file (for gatherd.c stopping
authorRobert Spalek <robert@ucw.cz>
Sun, 4 Mar 2001 15:18:08 +0000 (15:18 +0000)
committerRobert Spalek <robert@ucw.cz>
Sun, 4 Mar 2001 15:18:08 +0000 (15:18 +0000)
after maximal size is reached)

lib/bucket.c
lib/bucket.h

index 5799d6e5698d6c7a74176265e0ee4b7e8b716518..5f75d1cf1349fd90866e51a223233efb25e829c1 100644 (file)
@@ -152,6 +152,12 @@ obuck_sync(void)
   fsync(obuck_fd);
 }
 
+sh_off_t
+obuck_size(void)
+{
+  return sh_seek(obuck_fd, 0, SEEK_END);
+}
+
 static void
 obuck_get(oid_t oid)
 {
index f99baae92ffbc6068952363e99d324fb8a5f61c9..73ceafaf09677080e764972ff3ef9388852835d4 100644 (file)
@@ -39,6 +39,7 @@ 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);