/* Returns: sync count on success, 0 on failure  */
static region_t userspace_get_sync_count(struct dm_dirty_log *log)
/* Returns: sync count on success, 0 on failure  */
static region_t userspace_get_sync_count(struct dm_dirty_log *log)
{
	int r;
	size_t rdata_size;
	uint64_t sync_count;
	struct log_c *lc = log->context;
	rdata_size = sizeof(sync_count);
	r = userspace_do_request(lc, lc->uuid, DM_ULOG_GET_SYNC_COUNT,
				 NULL, 0,
				 (char *)&sync_count, &rdata_size);
	if (r)
		return 0;
	if (sync_count >= lc->region_count)
		lc->in_sync_hint = lc->region_count;
	return (region_t)sync_count;
}