// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2025, Christoph Hellwig.
* Copyright (c) 2025, Western Digital Corporation or its affiliates.
*
* Zoned Loop Device driver - exports a zoned block device using one file per
* zone as backing storage.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/blk-mq.h>
#include <linux/blkzoned.h>
#include <linux/pagemap.h>
#include <linux/miscdevice.h>
#include <linux/falloc.h>
#include <linux/mutex.h>
#include <linux/parser.h>
#include <linux/seq_file.h>
/*
* Options for adding (and removing) a device.
*/
enum {
ZLOOP_OPT_ERR = 0,
ZLOOP_OPT_ID = (1 << 0),
ZLOOP_OPT_CAPACITY = (1 << 1),
ZLOOP_OPT_ZONE_SIZE = (1 << 2),
ZLOOP_OPT_ZONE_CAPACITY = (1 << 3),
ZLOOP_OPT_NR_CONV_ZONES = (1 << 4),
ZLOOP_OPT_BASE_DIR = (1 <<