From: Robert Spalek Date: Sun, 4 Mar 2001 15:18:08 +0000 (+0000) Subject: added obuck_size() returning the size of bucket file (for gatherd.c stopping X-Git-Tag: holmes-import~1531 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=69ed9fa64a4eac3b0f77b873f10e88644c626713;p=libucw.git added obuck_size() returning the size of bucket file (for gatherd.c stopping after maximal size is reached) --- diff --git a/lib/bucket.c b/lib/bucket.c index 5799d6e5..5f75d1cf 100644 --- a/lib/bucket.c +++ b/lib/bucket.c @@ -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) { diff --git a/lib/bucket.h b/lib/bucket.h index f99baae9..73ceafaf 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -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);