/* A stale reference to a journal file which doesn't exist any longer
* because it was reclaimed. Return NULL. */
} else if (map == NULL) {
- g_print("Adding cache file %s\n", logname);
+ if (bluesky_verbose)
+ g_print("Adding cache file %s\n", logname);
map = g_new0(BlueSkyCacheFile, 1);
map->fs = fs;
async->key = g_strdup(cachefile->filename);
async->start = offset;
async->len = length;
+ async->profile = bluesky_profile_get();
bluesky_store_async_add_notifier(async,
(GFunc)cloudlog_partial_fetch_complete,
cachefile);
item = bluesky_rangeset_lookup_next(items, item_offset);
if (item == NULL)
break;
- g_print(" item offset from range request: %d\n",
- (int)(item->start + async->start));
+ if (bluesky_verbose) {
+ g_print(" item offset from range request: %d\n",
+ (int)(item->start + async->start));
+ }
if (bluesky_rangeset_insert(cachefile->items,
async->start + item->start,
item->length, item->data))
BlueSkyStoreAsync *async = bluesky_store_async_new(cachefile->fs->store);
async->op = STORE_OP_GET;
async->key = g_strdup(cachefile->filename);
+ async->profile = bluesky_profile_get();
bluesky_store_async_add_notifier(async,
(GFunc)cloudlog_partial_fetch_complete,
cachefile);
goto exit2;
}
if (rangeitem == NULL) {
- g_print("Item at offset 0x%zx not available, need to fetch.\n",
- file_offset);
+ if (bluesky_verbose) {
+ g_print("Item at offset 0x%zx not available, need to fetch.\n",
+ file_offset);
+ }
if (range_request) {
uint64_t start = 0, length = 0, end;
if (map->prefetches != NULL)
g_cond_wait(map->cond, map->lock);
} else if (rangeitem->start == file_offset
&& rangeitem->length == file_size) {
- g_print("Item now available.\n");
+ if (bluesky_verbose)
+ g_print("Item now available.\n");
break;
}
}
if (g_atomic_int_dec_and_test(&mmap->mapcount)) {
g_mutex_lock(mmap->lock);
if (g_atomic_int_get(&mmap->mapcount) == 0) {
- g_print("Unmapped log segment %d...\n", mmap->log_seq);
+ if (bluesky_verbose)
+ g_print("Unmapped log segment %d...\n", mmap->log_seq);
munmap((void *)mmap->addr, mmap->len);
mmap->addr = NULL;
g_atomic_int_add(&mmap->refcount, -1);