/*
* Sherlock Library -- Object Buckets
*
- * (c) 2001--2002 Martin Mares <mj@ucw.cz>
+ * (c) 2001--2003 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
{
}
+oid_t
+obuck_predict_last_oid(void)
+{
+ sh_off_t size = sh_seek(obuck_fd, 0, SEEK_END);
+ return size >> OBUCK_SHIFT;
+}
+
struct fastbuf *
obuck_create(void)
{
/*
* Sherlock Library -- Object Buckets
*
- * (c) 2001 Martin Mares <mj@ucw.cz>
+ * (c) 2001--2003 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
void obuck_lock_read(void); /* Explicit locking to make sure other threads don't touch buckets now */
void obuck_lock_write(void);
void obuck_unlock(void);
+oid_t obuck_predict_last_oid(void); /* Get OID corresponding to the next to be created bucket (i.e., bucket file size estimate) */
/* Searching for buckets */
void obuck_find_by_oid(struct obuck_header *hdrp);