Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793216012; b=IlRBlVtmWVOzevTC2Gdsf4ebNQ8o20B10AdX4X3DsB2Rt4Yb8GitslUU8q0qLGGyc/lD YXynu6ZX0blAmyNEbARijiVFK2t/JtlGpfmGA2vKs6U1Rbf39Kve5BnPe83SVqYVWSykQ DFP32fsqkwQcupyKMykxQtxIScYk7eF03gpc/2CBbHqb81riQhMxDLchtEDTZdJcUu2Z4 /KD/eSfSINdjrN5goii0hiQkOUl+OZ7hWW5G16rwZGqH07hS6tzYiiKNfqk/y1vHX0DHa xx6BBRs5gfapem6So5W64lFh/UdsL3LLsOF5gwpRxweWgFvhcKlJtqsCdNtCrh9W6PQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793216012; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=WMqb5uoHA+Hhe9uSJ0tzr4UxdHFHhwevz85wL2QPigc=; b=d9GaU7JaWN8RHYdsbf0SU6TymTd5RQf66EKA+cANpEXv/1DeEgPVauPTT/02OqpnAUWR 3J5p94ch5dH/wTMLEaV1Hd1KaaH+PX4rctKtp12kTuwK7UzLnObG7BPR1lhLWUWy50cWo 3Ptx2dE3EcPvewfPVPNBd9gvreHIOtBJUaS3stVSomEPZ1UqKReN2xHgrJyObB68Y9r52 u28E1YvrC1vZGtxBue4F5H2EPH+p9zqBBY1NZVf4Z8/quyAMVMAe0wwcUhFQ6Gl6Pgm22 O2RhqdeXRufoWAoyyrFPthjRBVizgGUrFtbgQeU2ComZM+L6wkCy2PpleUVCzy9i9MQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fRVb3JuJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F0C2606A31A; Wed, 28 Oct 2026 19:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fRVb3JuJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 774C51F01825; Wed, 28 Oct 2026 19:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793216011; bh=WMqb5uoHA+Hhe9uSJ0tzr4UxdHFHhwevz85wL2QPigc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fRVb3JuJ85AW0dfqo1JSvHKJAHCUG329SSAiIIIpXoU7dcQFUsTHt5dwhASdCLWn+ zwiPxu///rxKDnI5vBYWDIBetJhWUTYd3VPW2NYlbVppAb1KLxaewGNoreAWvskdsR vJXYOwHcUIPkbBnSSqHsL1qwKGGHjbhhtu8cY3rc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Heinz Mauelshagen , Mike Snitzer , Sasha Levin Subject: [PATCH 6.1 1408/1887] dm: correct block comments format. Date: Wed, 28 Oct 2026 17:58:24 +0100 Message-ID: <20261028170531.498162584@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028170459.200466217@linuxfoundation.org> References: <20261028170459.200466217@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heinz Mauelshagen [ Upstream commit a4a82ce3d24d4409143a7b7b980072ada6e20b2a ] Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer Stable-dep-of: 296578772308 ("dm array: validate array block headers on read") Signed-off-by: Sasha Levin --- drivers/md/dm-bufio.c | 30 ++++++---- drivers/md/dm-cache-metadata.c | 7 ++- drivers/md/dm-cache-target.c | 58 ++++++++++++------- drivers/md/dm-crypt.c | 7 ++- drivers/md/dm-era-target.c | 58 ++++++++++++------- drivers/md/dm-io.c | 24 +++++--- drivers/md/dm-ioctl.c | 33 +++++++---- drivers/md/dm-kcopyd.c | 18 ++++-- drivers/md/dm-log.c | 24 +++++--- drivers/md/dm-mpath.c | 33 ++++++----- drivers/md/dm-ps-round-robin.c | 13 +++-- drivers/md/dm-raid.c | 12 ++-- drivers/md/dm-raid1.c | 44 +++++++++----- drivers/md/dm-region-hash.c | 6 +- drivers/md/dm-snap-persistent.c | 6 +- drivers/md/dm-snap-transient.c | 6 +- drivers/md/dm-snap.c | 7 ++- drivers/md/dm-thin-metadata.c | 20 ++++--- drivers/md/dm-thin.c | 24 +++++--- drivers/md/dm.c | 12 ++-- drivers/md/dm.h | 12 ++-- drivers/md/persistent-data/dm-block-manager.c | 6 +- drivers/md/persistent-data/dm-btree.c | 6 +- include/linux/device-mapper.h | 18 ++++-- include/linux/dm-dirty-log.h | 2 +- include/linux/dm-region-hash.h | 6 +- 26 files changed, 315 insertions(+), 177 deletions(-) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index f1d34e427ef16..bbcc33828c638 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -258,9 +258,11 @@ static void buffer_record_stack(struct dm_buffer *b) } #endif -/*---------------------------------------------------------------- +/* + *---------------------------------------------------------------- * A red/black tree acts as an index for all the buffers. - *--------------------------------------------------------------*/ + *---------------------------------------------------------------- + */ static struct dm_buffer *__find(struct dm_bufio_client *c, sector_t block) { struct rb_node *n = c->buffer_tree.rb_node; @@ -561,7 +563,8 @@ static void __relink_lru(struct dm_buffer *b, int dirty) b->last_accessed = jiffies; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------------------- * Submit I/O on the buffer. * * Bio interface is faster but it has some problems: @@ -577,7 +580,8 @@ static void __relink_lru(struct dm_buffer *b, int dirty) * rejects the bio because it is too large, use dm-io layer to do the I/O. * The dm-io layer splits the I/O into multiple requests, avoiding the above * shortcomings. - *--------------------------------------------------------------*/ + *-------------------------------------------------------------------------- + */ /* * dm-io completion routine. It just calls b->bio.bi_end_io, pretending @@ -720,9 +724,11 @@ static void submit_io(struct dm_buffer *b, enum req_op op, use_dmio(b, op, sector, n_sectors, offset); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Writing dirty buffers - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ /* * The endio routine for write. @@ -1003,9 +1009,11 @@ static void __check_watermark(struct dm_bufio_client *c, __write_dirty_buffers_async(c, 1, write_list); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Getting a buffer - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static struct dm_buffer *__bufio_new(struct dm_bufio_client *c, sector_t block, enum new_flag nf, int *need_submit, @@ -2080,9 +2088,11 @@ static void work_fn(struct work_struct *w) DM_BUFIO_WORK_TIMER_SECS * HZ); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Module setup - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ /* * This is called only once for the whole dm_bufio module. diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 4ffe3f0bf1cdc..351dff329f3ce 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -162,10 +162,11 @@ struct dm_cache_metadata { struct dm_bitset_cursor dirty_cursor; }; -/*------------------------------------------------------------------- +/* + *----------------------------------------------------------------- * superblock validator - *-----------------------------------------------------------------*/ - + *----------------------------------------------------------------- + */ #define SUPERBLOCK_CSUM_XOR 9031977 static void sb_prepare_for_write(struct dm_block_validator *v, diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index c8a34af513cc4..e8c2b6e6eab23 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -530,9 +530,11 @@ static unsigned int lock_level(struct bio *bio) READ_WRITE_LOCK_LEVEL; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Per bio data - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static struct per_bio_data *get_per_bio_data(struct bio *bio) { @@ -714,9 +716,11 @@ static bool is_discarded_oblock(struct cache *cache, dm_oblock_t b) return r; } -/*---------------------------------------------------------------- +/* + * ------------------------------------------------------------- * Remapping - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void remap_to_origin(struct cache *cache, struct bio *bio) { bio_set_dev(bio, cache->origin_dev->bdev); @@ -843,9 +847,11 @@ static void remap_to_origin_and_cache(struct cache *cache, struct bio *bio, remap_to_cache(cache, bio, cblock); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Failure modes - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static enum cache_metadata_mode get_cache_mode(struct cache *cache) { return cache->features.mode; @@ -982,13 +988,14 @@ static void update_stats(struct cache_stats *stats, enum policy_operation op) } } -/*---------------------------------------------------------------- +/* + *--------------------------------------------------------------------- * Migration processing * * Migration covers moving data from the origin device to the cache, or * vice versa. - *--------------------------------------------------------------*/ - + *--------------------------------------------------------------------- + */ static void inc_io_migrations(struct cache *cache) { atomic_inc(&cache->nr_io_migrations); @@ -1443,9 +1450,11 @@ static int mg_start(struct cache *cache, struct policy_work *op, struct bio *bio return mg_lock_writes(mg); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * invalidation processing - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void invalidate_complete(struct dm_cache_migration *mg, bool success) { @@ -1602,9 +1611,11 @@ static int invalidate_start(struct cache *cache, dm_cblock_t cblock, return invalidate_lock(mg); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * bio processing - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ enum busy { IDLE, @@ -1813,9 +1824,11 @@ static bool process_discard_bio(struct cache *cache, struct bio *bio) { dm_dblock_t b, e; - // FIXME: do we need to lock the region? Or can we just assume the - // user wont be so foolish as to issue discard concurrently with - // other IO? + /* + * FIXME: do we need to lock the region? Or can we just assume the + * user wont be so foolish as to issue discard concurrently with + * other IO? + */ calc_discard_block_range(cache, bio, &b, &e); while (b != e) { set_discard(cache, b); @@ -1862,10 +1875,11 @@ static void process_deferred_bios(struct work_struct *ws) schedule_commit(&cache->committer); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Main worker loop - *--------------------------------------------------------------*/ - + *-------------------------------------------------------------- + */ static void requeue_deferred_bios(struct cache *cache) { struct bio *bio; @@ -1924,9 +1938,11 @@ static void check_migrations(struct work_struct *ws) } } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Target methods - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ /* * This function gets called on the error paths of the constructor, so we diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index b72d306a25ce4..7529a9a2fef32 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -368,9 +368,10 @@ static int crypt_iv_benbi_ctr(struct crypt_config *cc, struct dm_target *ti, bs = crypto_skcipher_blocksize(any_tfm(cc)); log = ilog2(bs); - /* we need to calculate how far we must shift the sector count - * to get the cipher block count, we use this shift in _gen */ - + /* + * We need to calculate how far we must shift the sector count + * to get the cipher block count, we use this shift in _gen. + */ if (1 << log != bs) { ti->error = "cypher blocksize is not a power of 2"; return -EINVAL; diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c index a1ccee10bb24f..f3b229e550205 100644 --- a/drivers/md/dm-era-target.c +++ b/drivers/md/dm-era-target.c @@ -22,9 +22,11 @@ #define INVALID_WRITESET_ROOT SUPERBLOCK_LOCATION #define MIN_BLOCK_SIZE 8 -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Writeset - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ struct writeset_metadata { uint32_t nr_bits; dm_block_t root; @@ -149,9 +151,11 @@ static int writeset_test_and_set(struct dm_disk_bitset *info, return 1; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * On disk metadata layout - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ #define SPACE_MAP_ROOT_SIZE 128 #define UUID_LEN 16 @@ -187,9 +191,11 @@ struct superblock_disk { __le64 metadata_snap; } __packed; -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Superblock validation - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void sb_prepare_for_write(struct dm_block_validator *v, struct dm_block *b, size_t sb_block_size) @@ -254,9 +260,11 @@ static struct dm_block_validator sb_validator = { .check = sb_check }; -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Low level metadata handling - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ #define DM_ERA_METADATA_BLOCK_SIZE 4096 #define ERA_MAX_CONCURRENT_LOCKS 5 @@ -661,13 +669,15 @@ static void swap_writeset(struct era_metadata *md, struct writeset *new_writeset synchronize_rcu(); } -/*---------------------------------------------------------------- +/* + *------------------------------------------------------------------------ * Writesets get 'digested' into the main era array. * * We're using a coroutine here so the worker thread can do the digestion, * thus avoiding synchronisation of the metadata. Digesting a whole * writeset in one go would cause too much latency. - *--------------------------------------------------------------*/ + *------------------------------------------------------------------------ + */ struct digest { uint32_t era; unsigned int nr_bits, current_bit; @@ -787,10 +797,12 @@ static int metadata_digest_start(struct era_metadata *md, struct digest *d) return 0; } -/*---------------------------------------------------------------- - * High level metadata interface. Target methods should use these, and not - * the lower level ones. - *--------------------------------------------------------------*/ +/* + *----------------------------------------------------------------- + * High level metadata interface. Target methods should use these, + * and not the lower level ones. + *----------------------------------------------------------------- + */ static struct era_metadata *metadata_open(struct block_device *bdev, sector_t block_size, bool may_format) @@ -1199,9 +1211,11 @@ struct rpc { struct completion complete; }; -/*---------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Remapping. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static bool block_size_is_power_of_two(struct era *era) { return era->sectors_per_block_shift >= 0; @@ -1225,9 +1239,11 @@ static void remap_to_origin(struct era *era, struct bio *bio) bio->bi_iter.bi_sector = dm_target_offset(era->ti, bio->bi_iter.bi_sector); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Worker thread - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void wake_worker(struct era *era) { if (!atomic_read(&era->suspended)) @@ -1416,9 +1432,11 @@ static void stop_worker(struct era *era) drain_workqueue(era->wq); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Target methods - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void era_destroy(struct era *era) { if (era->md) diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 87adb94dfcb24..2735a6ba51987 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -80,13 +80,15 @@ void dm_io_client_destroy(struct dm_io_client *client) } EXPORT_SYMBOL(dm_io_client_destroy); -/*----------------------------------------------------------------- +/* + *------------------------------------------------------------------- * We need to keep track of which region a bio is doing io for. * To avoid a memory allocation to store just 5 or 6 bits, we * ensure the 'struct io' pointer is aligned so enough low bits are * always zero and then combine it with the region number directly in * bi_private. - *---------------------------------------------------------------*/ + *------------------------------------------------------------------- + */ static void store_io_and_region_in_bio(struct bio *bio, struct io *io, unsigned int region) { @@ -107,10 +109,12 @@ static void retrieve_io_and_region_from_bio(struct bio *bio, struct io **io, *region = val & (DM_IO_MAX_REGIONS - 1); } -/*----------------------------------------------------------------- +/* + *-------------------------------------------------------------- * We need an io object to keep track of the number of bios that * have been dispatched for a particular io. - *---------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void complete_io(struct io *io) { unsigned long error_bits = io->error_bits; @@ -154,10 +158,12 @@ static void endio(struct bio *bio) dec_count(io, region, error); } -/*----------------------------------------------------------------- +/* + *-------------------------------------------------------------- * These little objects provide an abstraction for getting a new * destination page for io. - *---------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ struct dpages { void (*get_page)(struct dpages *dp, struct page **p, unsigned long *len, unsigned int *offset); @@ -291,9 +297,11 @@ static void km_dp_init(struct dpages *dp, void *data) dp->context_ptr = data; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * IO routines that accept a list of pages. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static void do_region(const blk_opf_t opf, unsigned int region, struct dm_io_region *where, struct dpages *dp, struct io *io, unsigned short ioprio) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 49b83af62aa57..2153f93a26d06 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -34,10 +34,12 @@ struct dm_file { volatile unsigned int global_event_nr; }; -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * The ioctl interface needs to be able to look up devices by * name or uuid. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct hash_cell { struct rb_node name_node; struct rb_node uuid_node; @@ -78,9 +80,11 @@ static void dm_hash_exit(void) dm_hash_remove_all(false, false, false); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Code for looking up a device by name - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static struct hash_cell *__get_name_cell(const char *str) { struct rb_node *n = name_rb_tree.rb_node; @@ -203,9 +207,11 @@ static struct hash_cell *__get_dev_cell(uint64_t dev) return hc; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Inserting, removing and renaming a device. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static struct hash_cell *alloc_cell(const char *name, const char *uuid, struct mapped_device *md) { @@ -507,9 +513,11 @@ void dm_deferred_remove(void) dm_hash_remove_all(true, false, true); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Implementation of the ioctl commands - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ /* * All the ioctl commands get dispatched to functions with this * prototype. @@ -1810,10 +1818,11 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para #define IOCTL_FLAGS_NO_PARAMS 1 #define IOCTL_FLAGS_ISSUE_GLOBAL_EVENT 2 -/*----------------------------------------------------------------- - * Implementation of open/close/ioctl on the special char - * device. - *---------------------------------------------------------------*/ +/* + *--------------------------------------------------------------- + * Implementation of open/close/ioctl on the special char device. + *--------------------------------------------------------------- + */ static ioctl_fn lookup_ioctl(unsigned int cmd, int *ioctl_flags) { static const struct { diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index c23ff946965b8..a2219bb89a480 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -50,10 +50,12 @@ static unsigned int dm_get_kcopyd_subjob_size(void) return sub_job_size_kb << 1; } -/*----------------------------------------------------------------- +/* + *---------------------------------------------------------------- * Each kcopyd client has its own little pool of preallocated * pages for kcopyd io. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct dm_kcopyd_client { struct page_list *pages; unsigned int nr_reserved_pages; @@ -334,11 +336,13 @@ static void client_free_pages(struct dm_kcopyd_client *kc) kc->nr_free_pages = kc->nr_reserved_pages = 0; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * kcopyd_jobs need to be allocated by the *clients* of kcopyd, * for this reason we use a mempool to prevent the client from * ever having to do io (which could cause a deadlock). - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct kcopyd_job { struct dm_kcopyd_client *kc; struct list_head list; @@ -902,9 +906,11 @@ int kcopyd_cancel(struct kcopyd_job *job, int block) } #endif /* 0 */ -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Client setup - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throttle) { int r; diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 6d44e91a526f8..77da6cd56e0ef 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -182,10 +182,12 @@ void dm_dirty_log_destroy(struct dm_dirty_log *log) } EXPORT_SYMBOL(dm_dirty_log_destroy); -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Persistent and core logs share a lot of their implementation. * FIXME: need a reload method to be called from a resume - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ /* * Magic for persistent mirrors: "MiRr" */ @@ -274,9 +276,11 @@ static inline void log_clear_bit(struct log_c *l, l->touched_dirtied = 1; } -/*---------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Header IO - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void header_to_disk(struct log_header_core *core, struct log_header_disk *disk) { disk->magic = cpu_to_le32(core->magic); @@ -352,11 +356,13 @@ static int _check_region_size(struct dm_target *ti, uint32_t region_size) return 1; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * core log constructor/destructor * * argv contains region_size followed optionally by [no]sync - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ #define BYTE_SHIFT 3 static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, unsigned int argc, char **argv, @@ -537,11 +543,13 @@ static void core_dtr(struct dm_dirty_log *log) destroy_log_context(lc); } -/*---------------------------------------------------------------- +/* + *--------------------------------------------------------------------- * disk log constructor/destructor * * argv contains log_device region_size followed optionally by [no]sync - *--------------------------------------------------------------*/ + *--------------------------------------------------------------------- + */ static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti, unsigned int argc, char **argv) { diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 8b97695fac491..dc8cbc3548312 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -117,10 +117,11 @@ static void activate_path_work(struct work_struct *work); static void process_queued_bios(struct work_struct *work); static void queue_if_no_path_timeout_work(struct timer_list *t); -/*----------------------------------------------- +/* + *----------------------------------------------- * Multipath state flags. - *-----------------------------------------------*/ - + *----------------------------------------------- + */ #define MPATHF_QUEUE_IO 0 /* Must we queue all I/O? */ #define MPATHF_QUEUE_IF_NO_PATH 1 /* Queue I/O if last path fails? */ #define MPATHF_SAVED_QUEUE_IF_NO_PATH 2 /* Saved state during suspension */ @@ -144,10 +145,11 @@ static bool mpath_double_check_test_bit(int MPATHF_bit, struct multipath *m) return r; } -/*----------------------------------------------- +/* + *----------------------------------------------- * Allocation routines - *-----------------------------------------------*/ - + *----------------------------------------------- + */ static struct pgpath *alloc_pgpath(void) { struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); @@ -303,10 +305,11 @@ static void multipath_init_per_bio_data(struct bio *bio, struct dm_mpath_io **mp dm_bio_record(bio_details, bio); } -/*----------------------------------------------- +/* + *----------------------------------------------- * Path selection - *-----------------------------------------------*/ - + *----------------------------------------------- + */ static int __pg_init_all_paths(struct multipath *m) { struct pgpath *pgpath; @@ -827,7 +830,8 @@ static void trigger_event(struct work_struct *work) dm_table_event(m->ti->table); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Constructor/argument parsing: * <#multipath feature args> []* * <#hw_handler args> [hw_handler []*] @@ -836,7 +840,8 @@ static void trigger_event(struct work_struct *work) * [ <#selector args> []* * <#paths> <#per-path selector args> * [ []* ]+ ]+ - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, struct dm_target *ti) { @@ -2171,9 +2176,11 @@ static int multipath_busy(struct dm_target *ti) return busy; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Module setup - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static struct target_type multipath_target = { .name = "multipath", .version = {1, 14, 0}, diff --git a/drivers/md/dm-ps-round-robin.c b/drivers/md/dm-ps-round-robin.c index 22c68ca81a248..733737477f327 100644 --- a/drivers/md/dm-ps-round-robin.c +++ b/drivers/md/dm-ps-round-robin.c @@ -20,9 +20,11 @@ #define RR_MIN_IO 1 #define RR_VERSION "1.2.0" -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Path-handling code, paths are held in lists - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct path_info { struct list_head list; struct dm_path *path; @@ -39,10 +41,11 @@ static void free_paths(struct list_head *paths) } } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Round-robin selector - *---------------------------------------------------------------*/ - + *--------------------------------------------------------------- + */ struct selector { struct list_head valid_paths; struct list_head invalid_paths; diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 3d9be184d4606..ae3a6713da518 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3185,12 +3185,12 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) /* Out-of-place space has to be available to allow for a reshape unless raid1! */ if (reshape_sectors || rs_is_raid1(rs)) { /* - * We can only prepare for a reshape here, because the - * raid set needs to run to provide the repective reshape - * check functions via its MD personality instance. - * - * So do the reshape check after md_run() succeeded. - */ + * We can only prepare for a reshape here, because the + * raid set needs to run to provide the repective reshape + * check functions via its MD personality instance. + * + * So do the reshape check after md_run() succeeded. + */ r = rs_prepare_reshape(rs); if (r) goto bad; diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 55476522abf91..aff6db13f5924 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -32,9 +32,11 @@ static DECLARE_WAIT_QUEUE_HEAD(_kmirrord_recovery_stopped); -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Mirror set structures. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ enum dm_raid1_error { DM_RAID1_WRITE_ERROR, DM_RAID1_FLUSH_ERROR, @@ -284,13 +286,15 @@ static int mirror_flush(struct dm_target *ti) return 0; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Recovery. * * When a mirror is first activated we may find that some regions * are in the no-sync state. We have to recover these by * recopying from the default mirror to all the others. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static void recovery_complete(int read_err, unsigned long write_err, void *context) { @@ -407,9 +411,11 @@ static void do_recovery(struct mirror_set *ms) } } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Reads - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static struct mirror *choose_mirror(struct mirror_set *ms, sector_t sector) { struct mirror *m = get_default_mirror(ms); @@ -497,9 +503,11 @@ static void hold_bio(struct mirror_set *ms, struct bio *bio) spin_unlock_irq(&ms->lock); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Reads - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static void read_callback(unsigned long error, void *context) { struct bio *bio = context; @@ -577,7 +585,8 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads) } } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------------- * Writes. * * We do different things with the write io depending on the @@ -586,9 +595,8 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads) * SYNC: increment pending, use kcopyd to write to *all* mirrors * RECOVERING: delay the io until recovery completes * NOSYNC: increment pending, just write to the default mirror - *---------------------------------------------------------------*/ - - + *--------------------------------------------------------------------- + */ static void write_callback(unsigned long error, void *context) { unsigned int i; @@ -840,9 +848,11 @@ static void trigger_event(struct work_struct *work) dm_table_event(ms->ti->table); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * kmirrord - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static void do_mirror(struct work_struct *work) { struct mirror_set *ms = container_of(work, struct mirror_set, @@ -866,9 +876,11 @@ static void do_mirror(struct work_struct *work) do_failures(ms, &failures); } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Target functions - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static struct mirror_set *alloc_context(unsigned int nr_mirrors, uint32_t region_size, struct dm_target *ti, diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index adbdb4b671372..3a67743015cf1 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c @@ -18,7 +18,8 @@ #define DM_MSG_PREFIX "region hash" -/*----------------------------------------------------------------- +/* + *------------------------------------------------------------------ * Region hash * * The mirror splits itself up into discrete regions. Each @@ -53,7 +54,8 @@ * lists in the region_hash, with the 'state', 'list' and * 'delayed_bios' fields of the regions. This is used from irq * context, so all other uses will have to suspend local irqs. - *---------------------------------------------------------------*/ + *------------------------------------------------------------------ + */ struct dm_region_hash { uint32_t region_size; unsigned int region_shift; diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 15bb79c02054a..1b61a7a54c117 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -21,10 +21,12 @@ #define DM_PREFETCH_CHUNKS 12 -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Persistent snapshots, by persistent we mean that the snapshot * will survive a reboot. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ /* * We need to store a record of which parts of the origin have diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c index 0a4e7820be0a4..bbe2fa60ac00e 100644 --- a/drivers/md/dm-snap-transient.c +++ b/drivers/md/dm-snap-transient.c @@ -16,9 +16,11 @@ #define DM_MSG_PREFIX "transient snapshot" -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Implementation of the store for non-persistent snapshots. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ struct transient_c { sector_t next_free; }; diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 8f259d18bff7f..bf73e17cd3073 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -2433,10 +2433,11 @@ static void snapshot_io_hints(struct dm_target *ti, struct queue_limits *limits) } } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Origin methods - *---------------------------------------------------------------*/ - + *--------------------------------------------------------------- + */ /* * If no exceptions need creating, DM_MAPIO_REMAPPED is returned and any * supplied bio was ignored. The caller may submit it immediately. diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index c143daeee5b3f..52b0b263e3637 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -14,7 +14,8 @@ #include #include -/*-------------------------------------------------------------------------- +/* + *-------------------------------------------------------------------------- * As far as the metadata goes, there is: * * - A superblock in block zero, taking up fewer than 512 bytes for @@ -70,7 +71,8 @@ * * All metadata io is in THIN_METADATA_BLOCK_SIZE sized/aligned chunks * from the block manager. - *--------------------------------------------------------------------------*/ + *-------------------------------------------------------------------------- + */ #define DM_MSG_PREFIX "thin metadata" @@ -240,10 +242,11 @@ struct dm_thin_device { uint32_t snapshotted_time; }; -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * superblock validator - *--------------------------------------------------------------*/ - + *-------------------------------------------------------------- + */ #define SUPERBLOCK_CSUM_XOR 160774 static void sb_prepare_for_write(struct dm_block_validator *v, @@ -297,10 +300,11 @@ static struct dm_block_validator sb_validator = { .check = sb_check }; -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Methods for the btree value types - *--------------------------------------------------------------*/ - + *-------------------------------------------------------------- + */ static uint64_t pack_block_time(dm_block_t b, uint32_t t) { return (b << 24) | t; diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index b78cadaa17dd7..677a299dce1d6 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2804,9 +2804,11 @@ static void requeue_bios(struct pool *pool) rcu_read_unlock(); } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Binding of control targets to a pool object - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static bool is_factor(sector_t block_size, uint32_t n) { return !sector_div(block_size, n); @@ -2870,9 +2872,11 @@ static void unbind_control_target(struct pool *pool, struct dm_target *ti) pool->ti = NULL; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Pool creation - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ /* Initialize pool features. */ static void pool_features_init(struct pool_features *pf) { @@ -3096,9 +3100,11 @@ static struct pool *__pool_find(struct mapped_device *pool_md, return pool; } -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Pool target methods - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void pool_dtr(struct dm_target *ti) { struct pool_c *pt = ti->private; @@ -4102,9 +4108,11 @@ static struct target_type pool_target = { .io_hints = pool_io_hints, }; -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Thin target methods - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void thin_get(struct thin_c *tc) { refcount_inc(&tc->refcount); diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 92165417fe33f..53acb28f86338 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1880,9 +1880,11 @@ static int dm_poll_bio(struct bio *bio, struct io_comp_batch *iob, return 1; } -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * An IDR is used to keep track of allocated minor numbers. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ static void free_minor(int minor) { spin_lock(&_minor_lock); @@ -2997,9 +2999,11 @@ void dm_internal_resume_fast(struct mapped_device *md) } EXPORT_SYMBOL_GPL(dm_internal_resume_fast); -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Event notification. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, unsigned int cookie, bool need_resize_uevent) { diff --git a/drivers/md/dm.h b/drivers/md/dm.h index a7917df09cafb..22eaed1889079 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -48,9 +48,11 @@ struct dm_md_mempools; struct dm_target_io; struct dm_io; -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Internal table functions. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ void dm_table_event_callback(struct dm_table *t, void (*fn)(void *), void *context); struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector); @@ -119,9 +121,11 @@ static inline int dm_zone_map_bio(struct dm_target_io *tio) } #endif -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * A registry of target types. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ int dm_target_init(void); void dm_target_exit(void); struct target_type *dm_get_target_type(const char *name); diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index 6a1fb5ea990f4..f41ed928f9127 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -370,9 +370,11 @@ static void dm_block_manager_write_callback(struct dm_buffer *buf) } } -/*---------------------------------------------------------------- +/* + * ------------------------------------------------------------- * Public interface - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ struct dm_block_manager { struct dm_bufio_client *bufio; bool read_only:1; diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index 50df2693d615b..3393e12878a33 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -13,9 +13,11 @@ #define DM_MSG_PREFIX "btree" -/*---------------------------------------------------------------- +/* + *-------------------------------------------------------------- * Array manipulation - *--------------------------------------------------------------*/ + *-------------------------------------------------------------- + */ static void memcpy_disk(void *dest, const void *src, size_t len) __dm_written_to_disk(src) { diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 201dd1ab7f1c6..9505674dc883d 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -433,10 +433,12 @@ const char *dm_shift_arg(struct dm_arg_set *as); */ void dm_consume_args(struct dm_arg_set *as, unsigned int num_args); -/*----------------------------------------------------------------- +/* + *---------------------------------------------------------------- * Functions for creating and manipulating mapped devices. * Drop the reference with dm_put when you finish with the object. - *---------------------------------------------------------------*/ + *---------------------------------------------------------------- + */ /* * DM_ANY_MINOR chooses the next available minor number. @@ -517,9 +519,11 @@ struct queue_limits *dm_get_queue_limits(struct mapped_device *md); int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo); int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Functions for manipulating device-mapper tables. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ /* * First create an empty table. @@ -593,9 +597,11 @@ struct dm_table *dm_swap_table(struct mapped_device *md, */ void dm_destroy_crypto_profile(struct blk_crypto_profile *profile); -/*----------------------------------------------------------------- +/* + *--------------------------------------------------------------- * Macros. - *---------------------------------------------------------------*/ + *--------------------------------------------------------------- + */ #define DM_NAME "device-mapper" #define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n" diff --git a/include/linux/dm-dirty-log.h b/include/linux/dm-dirty-log.h index 843c857f07b0d..36e72cb19813a 100644 --- a/include/linux/dm-dirty-log.h +++ b/include/linux/dm-dirty-log.h @@ -96,7 +96,7 @@ struct dm_dirty_log_type { * Do not confuse this function with 'in_sync()', one * tells you if an area is synchronised, the other * assigns recovery work. - */ + */ int (*get_resync_work)(struct dm_dirty_log *log, region_t *region); /* diff --git a/include/linux/dm-region-hash.h b/include/linux/dm-region-hash.h index e8691539e1d77..3ab31308bdce5 100644 --- a/include/linux/dm-region-hash.h +++ b/include/linux/dm-region-hash.h @@ -12,9 +12,11 @@ #include -/*----------------------------------------------------------------- +/* + *---------------------------------------------------------------- * Region hash - *----------------------------------------------------------------*/ + *---------------------------------------------------------------- + */ struct dm_region_hash; struct dm_region; -- 2.53.0