linux/drivers/md/dm-vdo/logical-zone.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright 2023 Red Hat
 */

#ifndef VDO_LOGICAL_ZONE_H
#define VDO_LOGICAL_ZONE_H

#include <linux/list.h>

#include "admin-state.h"
#include "int-map.h"
#include "types.h"

struct physical_zone;

struct logical_zone {};

struct logical_zones {};

int __must_check vdo_make_logical_zones(struct vdo *vdo,
					struct logical_zones **zones_ptr);

void vdo_free_logical_zones(struct logical_zones *zones);

void vdo_drain_logical_zones(struct logical_zones *zones,
			     const struct admin_state_code *operation,
			     struct vdo_completion *completion);

void vdo_resume_logical_zones(struct logical_zones *zones,
			      struct vdo_completion *parent);

void vdo_increment_logical_zone_flush_generation(struct logical_zone *zone,
						 sequence_number_t expected_generation);

void vdo_acquire_flush_generation_lock(struct data_vio *data_vio);

void vdo_release_flush_generation_lock(struct data_vio *data_vio);

struct physical_zone * __must_check vdo_get_next_allocation_zone(struct logical_zone *zone);

void vdo_dump_logical_zone(const struct logical_zone *zone);

#endif /* VDO_LOGICAL_ZONE_H */