/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2017 Western Digital Corporation or its affiliates. * * This file is released under the GPL.
*/
/* * Zone descriptor.
*/ struct dm_zone { /* For listing the zone depending on its state */ struct list_head link;
/* Device containing this zone */ struct dmz_dev *dev;
/* Zone type and state */ unsignedlong flags;
/* Zone activation reference count */
atomic_t refcount;
/* Zone id */ unsignedint id;
/* Zone write pointer block (relative to the zone start block) */ unsignedint wp_block;
/* Zone weight (number of valid blocks in the zone) */ unsignedint weight;
/* The chunk that the zone maps */ unsignedint chunk;
/* * For a sequential data zone, pointer to the random zone * used as a buffer for processing unaligned writes. * For a buffer zone, this points back to the data zone.
*/ struct dm_zone *bzone;
};
/* * Zone flags.
*/ enum { /* Zone write type */
DMZ_CACHE,
DMZ_RND,
DMZ_SEQ,
/* Zone critical condition */
DMZ_OFFLINE,
DMZ_READ_ONLY,
/* How the zone is being used */
DMZ_META,
DMZ_DATA,
DMZ_BUF,
DMZ_RESERVED,
/* Zone internal state */
DMZ_RECLAIM,
DMZ_SEQ_WRITE_ERR,
DMZ_RECLAIM_TERMINATE,
};
/* * Functions defined in dm-zoned-reclaim.c
*/ int dmz_ctr_reclaim(struct dmz_metadata *zmd, struct dmz_reclaim **zrc, int idx); void dmz_dtr_reclaim(struct dmz_reclaim *zrc); void dmz_suspend_reclaim(struct dmz_reclaim *zrc); void dmz_resume_reclaim(struct dmz_reclaim *zrc); void dmz_reclaim_bio_acc(struct dmz_reclaim *zrc); void dmz_schedule_reclaim(struct dmz_reclaim *zrc);
/* * Functions defined in dm-zoned-target.c
*/ bool dmz_bdev_is_dying(struct dmz_dev *dmz_dev); bool dmz_check_bdev(struct dmz_dev *dmz_dev);
/* * Deactivate a zone. This decrement the zone reference counter * indicating that all BIOs to the zone have completed when the count is 0.
*/ staticinlinevoid dmz_deactivate_zone(struct dm_zone *zone)
{
dmz_reclaim_bio_acc(zone->dev->reclaim);
atomic_dec(&zone->refcount);
}
/* * Test if a zone is active, that is, has a refcount > 0.
*/ staticinlinebool dmz_is_active(struct dm_zone *zone)
{ return atomic_read(&zone->refcount);
}
#endif/* DM_ZONED_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.