Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-6.13/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper updates from Mikulas Patocka:

- remove unused functions and variables

- rate-limit error messages in syslog

- fix typo

- remove u64 alignment requirement for murmurhash

- reset bi_ioprio to the default for dm-vdo

- add support for get_unique_id

- Add missing destroy_work_on_stack() to dm-thin

- use kmalloc to allocate power-of-two sized buffers in bufio

* tag 'for-6.13/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm-verity: remove the unused "data_start" variable
dm-bufio: use kmalloc to allocate power-of-two sized buffers
dm thin: Add missing destroy_work_on_stack()
dm: add support for get_unique_id
dm vdo: fix function doc comment formatting
dm vdo int-map: remove unused parameters
dm-vdo: reset bi_ioprio to the default value when the bio is reset
dm-vdo murmurhash: remove u64 alignment requirement
dm: Fix typo in error message
dm ioctl: rate limit a couple of ioctl based error messages
dm vdo: Remove unused uds_compute_index_size
dm vdo: Remove unused functions
dm: zoned: Remove unused functions
dm: Remove unused dm_table_bio_based
dm: Remove unused dm_set_md_type
dm cache: Remove unused functions in bio-prison-v1
dm cache: Remove unused dm_cache_size
dm cache: Remove unused dm_cache_dump
dm cache: Remove unused btracker_nr_writebacks_queued

+115 -288
-35
drivers/md/dm-bio-prison-v1.c
··· 198 198 } 199 199 EXPORT_SYMBOL_GPL(dm_bio_detain); 200 200 201 - int dm_get_cell(struct dm_bio_prison *prison, 202 - struct dm_cell_key *key, 203 - struct dm_bio_prison_cell *cell_prealloc, 204 - struct dm_bio_prison_cell **cell_result) 205 - { 206 - return bio_detain(prison, key, NULL, cell_prealloc, cell_result); 207 - } 208 - EXPORT_SYMBOL_GPL(dm_get_cell); 209 - 210 201 /* 211 202 * @inmates must have been initialised prior to this call 212 203 */ ··· 278 287 spin_unlock_irq(&prison->regions[l].lock); 279 288 } 280 289 EXPORT_SYMBOL_GPL(dm_cell_visit_release); 281 - 282 - static int __promote_or_release(struct rb_root *root, 283 - struct dm_bio_prison_cell *cell) 284 - { 285 - if (bio_list_empty(&cell->bios)) { 286 - rb_erase(&cell->node, root); 287 - return 1; 288 - } 289 - 290 - cell->holder = bio_list_pop(&cell->bios); 291 - return 0; 292 - } 293 - 294 - int dm_cell_promote_or_release(struct dm_bio_prison *prison, 295 - struct dm_bio_prison_cell *cell) 296 - { 297 - int r; 298 - unsigned l = lock_nr(&cell->key, prison->num_locks); 299 - 300 - spin_lock_irq(&prison->regions[l].lock); 301 - r = __promote_or_release(&prison->regions[l].cell, cell); 302 - spin_unlock_irq(&prison->regions[l].lock); 303 - 304 - return r; 305 - } 306 - EXPORT_SYMBOL_GPL(dm_cell_promote_or_release); 307 290 308 291 /*----------------------------------------------------------------*/ 309 292
-24
drivers/md/dm-bio-prison-v1.h
··· 73 73 struct dm_bio_prison_cell *cell); 74 74 75 75 /* 76 - * Creates, or retrieves a cell that overlaps the given key. 77 - * 78 - * Returns 1 if pre-existing cell returned, zero if new cell created using 79 - * @cell_prealloc. 80 - */ 81 - int dm_get_cell(struct dm_bio_prison *prison, 82 - struct dm_cell_key *key, 83 - struct dm_bio_prison_cell *cell_prealloc, 84 - struct dm_bio_prison_cell **cell_result); 85 - 86 - /* 87 76 * Returns false if key is beyond BIO_PRISON_MAX_RANGE or spans a boundary. 88 77 */ 89 78 bool dm_cell_key_has_valid_range(struct dm_cell_key *key); ··· 105 116 void dm_cell_visit_release(struct dm_bio_prison *prison, 106 117 void (*visit_fn)(void *, struct dm_bio_prison_cell *), 107 118 void *context, struct dm_bio_prison_cell *cell); 108 - 109 - /* 110 - * Rather than always releasing the prisoners in a cell, the client may 111 - * want to promote one of them to be the new holder. There is a race here 112 - * though between releasing an empty cell, and other threads adding new 113 - * inmates. So this function makes the decision with its lock held. 114 - * 115 - * This function can have two outcomes: 116 - * i) An inmate is promoted to be the holder of the cell (return value of 0). 117 - * ii) The cell has no inmate for promotion and is released (return value of 1). 118 - */ 119 - int dm_cell_promote_or_release(struct dm_bio_prison *prison, 120 - struct dm_bio_prison_cell *cell); 121 119 122 120 /*----------------------------------------------------------------*/ 123 121
+20 -5
drivers/md/dm-bufio.c
··· 318 318 */ 319 319 enum data_mode { 320 320 DATA_MODE_SLAB = 0, 321 - DATA_MODE_GET_FREE_PAGES = 1, 322 - DATA_MODE_VMALLOC = 2, 323 - DATA_MODE_LIMIT = 3 321 + DATA_MODE_KMALLOC = 1, 322 + DATA_MODE_GET_FREE_PAGES = 2, 323 + DATA_MODE_VMALLOC = 3, 324 + DATA_MODE_LIMIT = 4 324 325 }; 325 326 326 327 struct dm_buffer { ··· 1063 1062 1064 1063 static unsigned long dm_bufio_peak_allocated; 1065 1064 static unsigned long dm_bufio_allocated_kmem_cache; 1065 + static unsigned long dm_bufio_allocated_kmalloc; 1066 1066 static unsigned long dm_bufio_allocated_get_free_pages; 1067 1067 static unsigned long dm_bufio_allocated_vmalloc; 1068 1068 static unsigned long dm_bufio_current_allocated; ··· 1106 1104 1107 1105 static unsigned long * const class_ptr[DATA_MODE_LIMIT] = { 1108 1106 &dm_bufio_allocated_kmem_cache, 1107 + &dm_bufio_allocated_kmalloc, 1109 1108 &dm_bufio_allocated_get_free_pages, 1110 1109 &dm_bufio_allocated_vmalloc, 1111 1110 }; ··· 1184 1181 return kmem_cache_alloc(c->slab_cache, gfp_mask); 1185 1182 } 1186 1183 1184 + if (unlikely(c->block_size < PAGE_SIZE)) { 1185 + *data_mode = DATA_MODE_KMALLOC; 1186 + return kmalloc(c->block_size, gfp_mask | __GFP_RECLAIMABLE); 1187 + } 1188 + 1187 1189 if (c->block_size <= KMALLOC_MAX_SIZE && 1188 1190 gfp_mask & __GFP_NORETRY) { 1189 1191 *data_mode = DATA_MODE_GET_FREE_PAGES; ··· 1210 1202 switch (data_mode) { 1211 1203 case DATA_MODE_SLAB: 1212 1204 kmem_cache_free(c->slab_cache, data); 1205 + break; 1206 + 1207 + case DATA_MODE_KMALLOC: 1208 + kfree(data); 1213 1209 break; 1214 1210 1215 1211 case DATA_MODE_GET_FREE_PAGES: ··· 2531 2519 goto bad_dm_io; 2532 2520 } 2533 2521 2534 - if (block_size <= KMALLOC_MAX_SIZE && 2535 - (block_size < PAGE_SIZE || !is_power_of_2(block_size))) { 2522 + if (block_size <= KMALLOC_MAX_SIZE && !is_power_of_2(block_size)) { 2536 2523 unsigned int align = min(1U << __ffs(block_size), (unsigned int)PAGE_SIZE); 2537 2524 2538 2525 snprintf(slab_name, sizeof(slab_name), "dm_bufio_cache-%u-%u", ··· 2913 2902 __u64 mem; 2914 2903 2915 2904 dm_bufio_allocated_kmem_cache = 0; 2905 + dm_bufio_allocated_kmalloc = 0; 2916 2906 dm_bufio_allocated_get_free_pages = 0; 2917 2907 dm_bufio_allocated_vmalloc = 0; 2918 2908 dm_bufio_current_allocated = 0; ··· 3001 2989 3002 2990 module_param_named(allocated_kmem_cache_bytes, dm_bufio_allocated_kmem_cache, ulong, 0444); 3003 2991 MODULE_PARM_DESC(allocated_kmem_cache_bytes, "Memory allocated with kmem_cache_alloc"); 2992 + 2993 + module_param_named(allocated_kmalloc_bytes, dm_bufio_allocated_kmalloc, ulong, 0444); 2994 + MODULE_PARM_DESC(allocated_kmalloc_bytes, "Memory allocated with kmalloc_alloc"); 3004 2995 3005 2996 module_param_named(allocated_get_free_pages_bytes, dm_bufio_allocated_get_free_pages, ulong, 0444); 3006 2997 MODULE_PARM_DESC(allocated_get_free_pages_bytes, "Memory allocated with get_free_pages");
-6
drivers/md/dm-cache-background-tracker.c
··· 143 143 } 144 144 } 145 145 146 - unsigned int btracker_nr_writebacks_queued(struct background_tracker *b) 147 - { 148 - return atomic_read(&b->pending_writebacks); 149 - } 150 - EXPORT_SYMBOL_GPL(btracker_nr_writebacks_queued); 151 - 152 146 unsigned int btracker_nr_demotions_queued(struct background_tracker *b) 153 147 { 154 148 return atomic_read(&b->pending_demotes);
-1
drivers/md/dm-cache-background-tracker.h
··· 50 50 */ 51 51 void btracker_destroy(struct background_tracker *b); 52 52 53 - unsigned int btracker_nr_writebacks_queued(struct background_tracker *b); 54 53 unsigned int btracker_nr_demotions_queued(struct background_tracker *b); 55 54 56 55 /*
-33
drivers/md/dm-cache-metadata.c
··· 1218 1218 return r; 1219 1219 } 1220 1220 1221 - int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result) 1222 - { 1223 - READ_LOCK(cmd); 1224 - *result = cmd->cache_blocks; 1225 - READ_UNLOCK(cmd); 1226 - 1227 - return 0; 1228 - } 1229 - 1230 1221 static int __remove(struct dm_cache_metadata *cmd, dm_cblock_t cblock) 1231 1222 { 1232 1223 int r; ··· 1496 1505 READ_UNLOCK(cmd); 1497 1506 1498 1507 return r; 1499 - } 1500 - 1501 - static int __dump_mapping(void *context, uint64_t cblock, void *leaf) 1502 - { 1503 - __le64 value; 1504 - dm_oblock_t oblock; 1505 - unsigned int flags; 1506 - 1507 - memcpy(&value, leaf, sizeof(value)); 1508 - unpack_value(value, &oblock, &flags); 1509 - 1510 - return 0; 1511 - } 1512 - 1513 - static int __dump_mappings(struct dm_cache_metadata *cmd) 1514 - { 1515 - return dm_array_walk(&cmd->info, cmd->root, __dump_mapping, NULL); 1516 - } 1517 - 1518 - void dm_cache_dump(struct dm_cache_metadata *cmd) 1519 - { 1520 - READ_LOCK_VOID(cmd); 1521 - __dump_mappings(cmd); 1522 - READ_UNLOCK(cmd); 1523 1508 } 1524 1509 1525 1510 int dm_cache_changed_this_transaction(struct dm_cache_metadata *cmd)
-3
drivers/md/dm-cache-metadata.h
··· 71 71 * origin blocks to map to. 72 72 */ 73 73 int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size); 74 - int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result); 75 74 76 75 int dm_cache_discard_bitset_resize(struct dm_cache_metadata *cmd, 77 76 sector_t discard_block_size, ··· 121 122 122 123 int dm_cache_get_metadata_dev_size(struct dm_cache_metadata *cmd, 123 124 dm_block_t *result); 124 - 125 - void dm_cache_dump(struct dm_cache_metadata *cmd); 126 125 127 126 /* 128 127 * The policy is invited to save a 32bit hint value for every cblock (eg,
+2 -2
drivers/md/dm-ioctl.c
··· 1912 1912 1913 1913 if ((kernel_params->version[0] != DM_VERSION_MAJOR) || 1914 1914 (kernel_params->version[1] > DM_VERSION_MINOR)) { 1915 - DMERR("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)", 1915 + DMERR_LIMIT("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)", 1916 1916 DM_VERSION_MAJOR, DM_VERSION_MINOR, 1917 1917 DM_VERSION_PATCHLEVEL, 1918 1918 kernel_params->version[0], ··· 1961 1961 1962 1962 if (unlikely(param_kernel->data_size < minimum_data_size) || 1963 1963 unlikely(param_kernel->data_size > DM_MAX_TARGETS * DM_MAX_TARGET_PARAMS)) { 1964 - DMERR("Invalid data size in the ioctl structure: %u", 1964 + DMERR_LIMIT("Invalid data size in the ioctl structure: %u", 1965 1965 param_kernel->data_size); 1966 1966 return -EINVAL; 1967 1967 }
-5
drivers/md/dm-table.c
··· 1033 1033 return NULL; 1034 1034 } 1035 1035 1036 - bool dm_table_bio_based(struct dm_table *t) 1037 - { 1038 - return __table_type_bio_based(dm_table_get_type(t)); 1039 - } 1040 - 1041 1036 bool dm_table_request_based(struct dm_table *t) 1042 1037 { 1043 1038 return __table_type_request_based(dm_table_get_type(t));
+1
drivers/md/dm-thin.c
··· 2484 2484 init_completion(&pw->complete); 2485 2485 queue_work(pool->wq, &pw->worker); 2486 2486 wait_for_completion(&pw->complete); 2487 + destroy_work_on_stack(&pw->worker); 2487 2488 } 2488 2489 2489 2490 /*----------------------------------------------------------------*/
-2
drivers/md/dm-vdo/block-map.c
··· 209 209 /** 210 210 * allocate_cache_components() - Allocate components of the cache which require their own 211 211 * allocation. 212 - * @maximum_age: The number of journal blocks before a dirtied page is considered old and must be 213 - * written out. 214 212 * 215 213 * The caller is responsible for all clean up on errors. 216 214 *
+4 -32
drivers/md/dm-vdo/data-vio.c
··· 327 327 328 328 /** 329 329 * set_data_vio_compression_status() - Set the compression status of a data_vio. 330 - * @state: The expected current status of the data_vio. 331 - * @new_state: The status to set. 330 + * @data_vio: The data_vio to change. 331 + * @status: The expected current status of the data_vio. 332 + * @new_status: The status to set. 332 333 * 333 334 * Return: true if the new status was set, false if the data_vio's compression status did not 334 335 * match the expected state, and so was left unchanged. ··· 837 836 * @vdo: The vdo to which the pool will belong. 838 837 * @pool_size: The number of data_vios in the pool. 839 838 * @discard_limit: The maximum number of data_vios which may be used for discards. 840 - * @pool: A pointer to hold the newly allocated pool. 839 + * @pool_ptr: A pointer to hold the newly allocated pool. 841 840 */ 842 841 int make_data_vio_pool(struct vdo *vdo, data_vio_count_t pool_size, 843 842 data_vio_count_t discard_limit, struct data_vio_pool **pool_ptr) ··· 1073 1072 } 1074 1073 1075 1074 spin_unlock(&pool->lock); 1076 - } 1077 - 1078 - data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool) 1079 - { 1080 - return READ_ONCE(pool->discard_limiter.busy); 1081 - } 1082 - 1083 - data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool) 1084 - { 1085 - return READ_ONCE(pool->discard_limiter.limit); 1086 - } 1087 - 1088 - data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool) 1089 - { 1090 - return READ_ONCE(pool->discard_limiter.max_busy); 1091 - } 1092 - 1093 - int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit) 1094 - { 1095 - if (get_data_vio_pool_request_limit(pool) < limit) { 1096 - // The discard limit may not be higher than the data_vio limit. 1097 - return -EINVAL; 1098 - } 1099 - 1100 - spin_lock(&pool->lock); 1101 - pool->discard_limiter.limit = limit; 1102 - spin_unlock(&pool->lock); 1103 - 1104 - return VDO_SUCCESS; 1105 1075 } 1106 1076 1107 1077 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool)
-5
drivers/md/dm-vdo/data-vio.h
··· 336 336 void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion); 337 337 338 338 void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios); 339 - data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool); 340 - data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool); 341 - data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool); 342 - int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool, 343 - data_vio_count_t limit); 344 339 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool); 345 340 data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool); 346 341 data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool);
+5 -4
drivers/md/dm-vdo/dedupe.c
··· 565 565 * @waiter: The data_vio's waiter link. 566 566 * @context: Not used. 567 567 */ 568 - static void abort_waiter(struct vdo_waiter *waiter, void *context __always_unused) 568 + static void abort_waiter(struct vdo_waiter *waiter, void __always_unused *context) 569 569 { 570 570 write_data_vio(vdo_waiter_as_data_vio(waiter)); 571 571 } ··· 1727 1727 /** 1728 1728 * vdo_continue_hash_lock() - Continue the processing state after writing, compressing, or 1729 1729 * deduplicating. 1730 - * @data_vio: The data_vio to continue processing in its hash lock. 1730 + * @completion: The data_vio completion to continue processing in its hash lock. 1731 1731 * 1732 1732 * Asynchronously continue processing a data_vio in its hash lock after it has finished writing, 1733 1733 * compressing, or deduplicating, so it can share the result with any data_vios waiting in the hash ··· 1825 1825 1826 1826 /** 1827 1827 * vdo_acquire_hash_lock() - Acquire or share a lock on a record name. 1828 - * @data_vio: The data_vio acquiring a lock on its record name. 1828 + * @completion: The data_vio completion acquiring a lock on its record name. 1829 1829 * 1830 1830 * Acquire or share a lock on the hash (record name) of the data in a data_vio, updating the 1831 1831 * data_vio to reference the lock. This must only be called in the correct thread for the zone. In ··· 2679 2679 2680 2680 /** 2681 2681 * vdo_get_dedupe_statistics() - Tally the statistics from all the hash zones and the UDS index. 2682 - * @hash_zones: The hash zones to query 2682 + * @zones: The hash zones to query 2683 + * @stats: A structure to store the statistics 2683 2684 * 2684 2685 * Return: The sum of the hash lock statistics from all hash zones plus the statistics from the UDS 2685 2686 * index
+1 -1
drivers/md/dm-vdo/encodings.c
··· 858 858 /** 859 859 * vdo_initialize_layout() - Lay out the partitions of a vdo. 860 860 * @size: The entire size of the vdo. 861 - * @origin: The start of the layout on the underlying storage in blocks. 861 + * @offset: The start of the layout on the underlying storage in blocks. 862 862 * @block_map_blocks: The size of the block map partition. 863 863 * @journal_blocks: The size of the journal partition. 864 864 * @summary_blocks: The size of the slab summary partition.
-26
drivers/md/dm-vdo/indexer/index-layout.c
··· 248 248 return UDS_SUCCESS; 249 249 } 250 250 251 - int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size) 252 - { 253 - int result; 254 - struct uds_configuration *index_config; 255 - struct save_layout_sizes sizes; 256 - 257 - if (index_size == NULL) { 258 - vdo_log_error("Missing output size pointer"); 259 - return -EINVAL; 260 - } 261 - 262 - result = uds_make_configuration(parameters, &index_config); 263 - if (result != UDS_SUCCESS) { 264 - vdo_log_error_strerror(result, "cannot compute index size"); 265 - return uds_status_to_errno(result); 266 - } 267 - 268 - result = compute_sizes(index_config, &sizes); 269 - uds_free_configuration(index_config); 270 - if (result != UDS_SUCCESS) 271 - return uds_status_to_errno(result); 272 - 273 - *index_size = sizes.total_size; 274 - return UDS_SUCCESS; 275 - } 276 - 277 251 /* Create unique data using the current time and a pseudorandom number. */ 278 252 static void create_unique_nonce_data(u8 *buffer) 279 253 {
-4
drivers/md/dm-vdo/indexer/indexer.h
··· 283 283 enum uds_index_region location; 284 284 }; 285 285 286 - /* Compute the number of bytes needed to store an index. */ 287 - int __must_check uds_compute_index_size(const struct uds_parameters *parameters, 288 - u64 *index_size); 289 - 290 286 /* A session is required for most index operations. */ 291 287 int __must_check uds_create_index_session(struct uds_index_session **session); 292 288
+11 -17
drivers/md/dm-vdo/int-map.c
··· 70 70 * it's crucial to keep the hop fields near the buckets that they use them so they'll tend to share 71 71 * cache lines. 72 72 */ 73 - struct __packed bucket { 73 + struct bucket { 74 74 /** 75 75 * @first_hop: The biased offset of the first entry in the hop list of the neighborhood 76 76 * that hashes to this bucket. ··· 82 82 u64 key; 83 83 /** @value: The value stored in this bucket (NULL if empty). */ 84 84 void *value; 85 - }; 85 + } __packed; 86 86 87 87 /** 88 88 * struct int_map - The concrete definition of the opaque int_map type. ··· 310 310 /** 311 311 * search_hop_list() - Search the hop list associated with given hash bucket for a given search 312 312 * key. 313 - * @map: The map being searched. 314 313 * @bucket: The map bucket to search for the key. 315 314 * @key: The mapping key. 316 315 * @previous_ptr: Output. if not NULL, a pointer in which to store the bucket in the list preceding ··· 320 321 * 321 322 * Return: An entry that matches the key, or NULL if not found. 322 323 */ 323 - static struct bucket *search_hop_list(struct int_map *map __always_unused, 324 - struct bucket *bucket, 325 - u64 key, 324 + static struct bucket *search_hop_list(struct bucket *bucket, u64 key, 326 325 struct bucket **previous_ptr) 327 326 { 328 327 struct bucket *previous = NULL; ··· 354 357 */ 355 358 void *vdo_int_map_get(struct int_map *map, u64 key) 356 359 { 357 - struct bucket *match = search_hop_list(map, select_bucket(map, key), key, NULL); 360 + struct bucket *match = search_hop_list(select_bucket(map, key), key, NULL); 358 361 359 362 return ((match != NULL) ? match->value : NULL); 360 363 } ··· 440 443 441 444 /** 442 445 * move_empty_bucket() - Move an empty bucket closer to the start of the bucket array. 443 - * @map: The map containing the bucket. 444 446 * @hole: The empty bucket to fill with an entry that precedes it in one of its enclosing 445 447 * neighborhoods. 446 448 * ··· 450 454 * Return: The bucket that was vacated by moving its entry to the provided hole, or NULL if no 451 455 * entry could be moved. 452 456 */ 453 - static struct bucket *move_empty_bucket(struct int_map *map __always_unused, 454 - struct bucket *hole) 457 + static struct bucket *move_empty_bucket(struct bucket *hole) 455 458 { 456 459 /* 457 460 * Examine every neighborhood that the empty bucket is part of, starting with the one in ··· 511 516 /** 512 517 * update_mapping() - Find and update any existing mapping for a given key, returning the value 513 518 * associated with the key in the provided pointer. 514 - * @map: The int_map to attempt to modify. 515 519 * @neighborhood: The first bucket in the neighborhood that would contain the search key 516 520 * @key: The key with which to associate the new value. 517 521 * @new_value: The value to be associated with the key. ··· 519 525 * 520 526 * Return: true if the map contains a mapping for the key, false if it does not. 521 527 */ 522 - static bool update_mapping(struct int_map *map, struct bucket *neighborhood, 523 - u64 key, void *new_value, bool update, void **old_value_ptr) 528 + static bool update_mapping(struct bucket *neighborhood, u64 key, void *new_value, 529 + bool update, void **old_value_ptr) 524 530 { 525 - struct bucket *bucket = search_hop_list(map, neighborhood, key, NULL); 531 + struct bucket *bucket = search_hop_list(neighborhood, key, NULL); 526 532 527 533 if (bucket == NULL) { 528 534 /* There is no bucket containing the key in the neighborhood. */ ··· 578 584 * The nearest empty bucket isn't within the neighborhood that must contain the new 579 585 * entry, so try to swap it with bucket that is closer. 580 586 */ 581 - hole = move_empty_bucket(map, hole); 587 + hole = move_empty_bucket(hole); 582 588 } 583 589 584 590 return NULL; ··· 619 625 * Check whether the neighborhood already contains an entry for the key, in which case we 620 626 * optionally update it, returning the old value. 621 627 */ 622 - if (update_mapping(map, neighborhood, key, new_value, update, old_value_ptr)) 628 + if (update_mapping(neighborhood, key, new_value, update, old_value_ptr)) 623 629 return VDO_SUCCESS; 624 630 625 631 /* ··· 673 679 /* Select the bucket to search and search it for an existing entry. */ 674 680 struct bucket *bucket = select_bucket(map, key); 675 681 struct bucket *previous; 676 - struct bucket *victim = search_hop_list(map, bucket, key, &previous); 682 + struct bucket *victim = search_hop_list(bucket, key, &previous); 677 683 678 684 if (victim == NULL) { 679 685 /* There is no matching entry to remove. */
+1 -1
drivers/md/dm-vdo/io-submitter.c
··· 367 367 * completions. 368 368 * @max_requests_active: Number of bios for merge tracking. 369 369 * @vdo: The vdo which will use this submitter. 370 - * @io_submitter: pointer to the new data structure. 370 + * @io_submitter_ptr: pointer to the new data structure. 371 371 * 372 372 * Return: VDO_SUCCESS or an error. 373 373 */
+2 -5
drivers/md/dm-vdo/murmurhash3.c
··· 44 44 u64 *hash_out = out; 45 45 46 46 /* body */ 47 - 48 - const u64 *blocks = (const u64 *)(data); 49 - 50 47 int i; 51 48 52 49 for (i = 0; i < nblocks; i++) { 53 - u64 k1 = get_unaligned_le64(&blocks[i * 2]); 54 - u64 k2 = get_unaligned_le64(&blocks[i * 2 + 1]); 50 + u64 k1 = get_unaligned_le64(&data[i * 16]); 51 + u64 k2 = get_unaligned_le64(&data[i * 16 + 8]); 55 52 56 53 k1 *= c1; 57 54 k1 = ROTL64(k1, 31);
+1 -2
drivers/md/dm-vdo/packer.c
··· 250 250 /** 251 251 * release_compressed_write_waiter() - Update a data_vio for which a successful compressed write 252 252 * has completed and send it on its way. 253 - 254 253 * @data_vio: The data_vio to release. 255 254 * @allocation: The allocation to which the compressed block was written. 256 255 */ ··· 382 383 * @compression: The agent's compression_state to pack in to. 383 384 * @data_vio: The data_vio to pack. 384 385 * @offset: The offset into the compressed block at which to pack the fragment. 385 - * @compressed_block: The compressed block which will be written out when batch is fully packed. 386 + * @block: The compressed block which will be written out when batch is fully packed. 386 387 * 387 388 * Return: The new amount of space used. 388 389 */
+1 -1
drivers/md/dm-vdo/physical-zone.c
··· 517 517 * @waiter: The allocating_vio that was waiting to allocate. 518 518 * @context: The context (unused). 519 519 */ 520 - static void retry_allocation(struct vdo_waiter *waiter, void *context __always_unused) 520 + static void retry_allocation(struct vdo_waiter *waiter, void __always_unused *context) 521 521 { 522 522 struct data_vio *data_vio = vdo_waiter_as_data_vio(waiter); 523 523
+1 -1
drivers/md/dm-vdo/recovery-journal.c
··· 1365 1365 * 1366 1366 * Implements waiter_callback_fn. 1367 1367 */ 1368 - static void write_block(struct vdo_waiter *waiter, void *context __always_unused) 1368 + static void write_block(struct vdo_waiter *waiter, void __always_unused *context) 1369 1369 { 1370 1370 struct recovery_journal_block *block = 1371 1371 container_of(waiter, struct recovery_journal_block, write_waiter);
+3 -6
drivers/md/dm-vdo/slab-depot.c
··· 1287 1287 * slab_block_number_from_pbn() - Determine the index within the slab of a particular physical 1288 1288 * block number. 1289 1289 * @slab: The slab. 1290 - * @physical_block_number: The physical block number. 1290 + * @pbn: The physical block number. 1291 1291 * @slab_block_number_ptr: A pointer to the slab block number. 1292 1292 * 1293 1293 * Return: VDO_SUCCESS or an error code. ··· 1459 1459 * @block_number: The block to update. 1460 1460 * @old_status: The reference status of the data block before this decrement. 1461 1461 * @updater: The reference updater doing this operation in case we need to look up the pbn lock. 1462 - * @lock: The pbn_lock associated with the block being decremented (may be NULL). 1463 1462 * @counter_ptr: A pointer to the count for the data block (in, out). 1464 1463 * @adjust_block_count: Whether to update the allocator's free block count. 1465 1464 * ··· 3231 3232 /** 3232 3233 * vdo_modify_reference_count() - Modify the reference count of a block by first making a slab 3233 3234 * journal entry and then updating the reference counter. 3234 - * 3235 - * @data_vio: The data_vio for which to add the entry. 3235 + * @completion: The data_vio completion for which to add the entry. 3236 3236 * @updater: Which of the data_vio's reference updaters is being submitted. 3237 3237 */ 3238 3238 void vdo_modify_reference_count(struct vdo_completion *completion, ··· 4740 4742 /** 4741 4743 * stop_scrubbing() - Tell the scrubber to stop scrubbing after it finishes the slab it is 4742 4744 * currently working on. 4743 - * @scrubber: The scrubber to stop. 4744 - * @parent: The completion to notify when scrubbing has stopped. 4745 + * @allocator: The block allocator owning the scrubber to stop. 4745 4746 */ 4746 4747 static void stop_scrubbing(struct block_allocator *allocator) 4747 4748 {
+2 -2
drivers/md/dm-vdo/vdo.c
··· 643 643 644 644 /** 645 645 * free_listeners() - Free the list of read-only listeners associated with a thread. 646 - * @thread_data: The thread holding the list to free. 646 + * @thread: The thread holding the list to free. 647 647 */ 648 648 static void free_listeners(struct vdo_thread *thread) 649 649 { ··· 852 852 /** 853 853 * vdo_get_state() - Get the current state of the vdo. 854 854 * @vdo: The vdo. 855 - 855 + * 856 856 * Context: This method may be called from any thread. 857 857 * 858 858 * Return: The current state of the vdo.
+1
drivers/md/dm-vdo/vio.c
··· 202 202 if (data == NULL) 203 203 return VDO_SUCCESS; 204 204 205 + bio->bi_ioprio = 0; 205 206 bio->bi_io_vec = bio->bi_inline_vecs; 206 207 bio->bi_max_vecs = vio->block_count + 1; 207 208 len = VDO_BLOCK_SIZE * vio->block_count;
+3 -3
drivers/md/dm-verity-target.c
··· 93 93 */ 94 94 static sector_t verity_map_sector(struct dm_verity *v, sector_t bi_sector) 95 95 { 96 - return v->data_start + dm_target_offset(v->ti, bi_sector); 96 + return dm_target_offset(v->ti, bi_sector); 97 97 } 98 98 99 99 /* ··· 952 952 953 953 *bdev = v->data_dev->bdev; 954 954 955 - if (v->data_start || ti->len != bdev_nr_sectors(v->data_dev->bdev)) 955 + if (ti->len != bdev_nr_sectors(v->data_dev->bdev)) 956 956 return 1; 957 957 return 0; 958 958 } ··· 962 962 { 963 963 struct dm_verity *v = ti->private; 964 964 965 - return fn(ti, v->data_dev, v->data_start, ti->len, data); 965 + return fn(ti, v->data_dev, 0, ti->len, data); 966 966 } 967 967 968 968 static void verity_io_hints(struct dm_target *ti, struct queue_limits *limits)
-1
drivers/md/dm-verity.h
··· 50 50 unsigned int sig_size; /* root digest signature size */ 51 51 #endif /* CONFIG_SECURITY */ 52 52 unsigned int salt_size; 53 - sector_t data_start; /* data offset in 512-byte sectors */ 54 53 sector_t hash_start; /* hash start in blocks */ 55 54 sector_t data_blocks; /* the number of data blocks */ 56 55 sector_t hash_blocks; /* the number of hash blocks */
-50
drivers/md/dm-zoned-metadata.c
··· 245 245 return zmd->zone_nr_blocks; 246 246 } 247 247 248 - unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd) 249 - { 250 - return zmd->zone_nr_blocks_shift; 251 - } 252 - 253 248 unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd) 254 249 { 255 250 return zmd->zone_nr_sectors; ··· 2999 3004 shrinker_free(zmd->mblk_shrinker); 3000 3005 dmz_cleanup_metadata(zmd); 3001 3006 kfree(zmd); 3002 - } 3003 - 3004 - /* 3005 - * Check zone information on resume. 3006 - */ 3007 - int dmz_resume_metadata(struct dmz_metadata *zmd) 3008 - { 3009 - struct dm_zone *zone; 3010 - sector_t wp_block; 3011 - unsigned int i; 3012 - int ret; 3013 - 3014 - /* Check zones */ 3015 - for (i = 0; i < zmd->nr_zones; i++) { 3016 - zone = dmz_get(zmd, i); 3017 - if (!zone) { 3018 - dmz_zmd_err(zmd, "Unable to get zone %u", i); 3019 - return -EIO; 3020 - } 3021 - wp_block = zone->wp_block; 3022 - 3023 - ret = dmz_update_zone(zmd, zone); 3024 - if (ret) { 3025 - dmz_zmd_err(zmd, "Broken zone %u", i); 3026 - return ret; 3027 - } 3028 - 3029 - if (dmz_is_offline(zone)) { 3030 - dmz_zmd_warn(zmd, "Zone %u is offline", i); 3031 - continue; 3032 - } 3033 - 3034 - /* Check write pointer */ 3035 - if (!dmz_is_seq(zone)) 3036 - zone->wp_block = 0; 3037 - else if (zone->wp_block != wp_block) { 3038 - dmz_zmd_err(zmd, "Zone %u: Invalid wp (%llu / %llu)", 3039 - i, (u64)zone->wp_block, (u64)wp_block); 3040 - zone->wp_block = wp_block; 3041 - dmz_invalidate_blocks(zmd, zone, zone->wp_block, 3042 - zmd->zone_nr_blocks - zone->wp_block); 3043 - } 3044 - } 3045 - 3046 - return 0; 3047 3007 }
-2
drivers/md/dm-zoned.h
··· 192 192 int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev, 193 193 struct dmz_metadata **zmd, const char *devname); 194 194 void dmz_dtr_metadata(struct dmz_metadata *zmd); 195 - int dmz_resume_metadata(struct dmz_metadata *zmd); 196 195 197 196 void dmz_lock_map(struct dmz_metadata *zmd); 198 197 void dmz_unlock_map(struct dmz_metadata *zmd); ··· 229 230 unsigned int dmz_nr_seq_zones(struct dmz_metadata *zmd, int idx); 230 231 unsigned int dmz_nr_unmap_seq_zones(struct dmz_metadata *zmd, int idx); 231 232 unsigned int dmz_zone_nr_blocks(struct dmz_metadata *zmd); 232 - unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd); 233 233 unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd); 234 234 unsigned int dmz_zone_nr_sectors_shift(struct dmz_metadata *zmd); 235 235
+55 -6
drivers/md/dm.c
··· 2517 2517 mutex_unlock(&md->type_lock); 2518 2518 } 2519 2519 2520 - void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type) 2521 - { 2522 - BUG_ON(!mutex_is_locked(&md->type_lock)); 2523 - md->type = type; 2524 - } 2525 - 2526 2520 enum dm_queue_mode dm_get_md_type(struct mapped_device *md) 2527 2521 { 2528 2522 return md->type; ··· 3343 3349 kfree(pools); 3344 3350 } 3345 3351 3352 + struct dm_blkdev_id { 3353 + u8 *id; 3354 + enum blk_unique_id type; 3355 + }; 3356 + 3357 + static int __dm_get_unique_id(struct dm_target *ti, struct dm_dev *dev, 3358 + sector_t start, sector_t len, void *data) 3359 + { 3360 + struct dm_blkdev_id *dm_id = data; 3361 + const struct block_device_operations *fops = dev->bdev->bd_disk->fops; 3362 + 3363 + if (!fops->get_unique_id) 3364 + return 0; 3365 + 3366 + return fops->get_unique_id(dev->bdev->bd_disk, dm_id->id, dm_id->type); 3367 + } 3368 + 3369 + /* 3370 + * Allow access to get_unique_id() for the first device returning a 3371 + * non-zero result. Reasonable use expects all devices to have the 3372 + * same unique id. 3373 + */ 3374 + static int dm_blk_get_unique_id(struct gendisk *disk, u8 *id, 3375 + enum blk_unique_id type) 3376 + { 3377 + struct mapped_device *md = disk->private_data; 3378 + struct dm_table *table; 3379 + struct dm_target *ti; 3380 + int ret = 0, srcu_idx; 3381 + 3382 + struct dm_blkdev_id dm_id = { 3383 + .id = id, 3384 + .type = type, 3385 + }; 3386 + 3387 + table = dm_get_live_table(md, &srcu_idx); 3388 + if (!table || !dm_table_get_size(table)) 3389 + goto out; 3390 + 3391 + /* We only support devices that have a single target */ 3392 + if (table->num_targets != 1) 3393 + goto out; 3394 + ti = dm_table_get_target(table, 0); 3395 + 3396 + if (!ti->type->iterate_devices) 3397 + goto out; 3398 + 3399 + ret = ti->type->iterate_devices(ti, __dm_get_unique_id, &dm_id); 3400 + out: 3401 + dm_put_live_table(md, srcu_idx); 3402 + return ret; 3403 + } 3404 + 3346 3405 struct dm_pr { 3347 3406 u64 old_key; 3348 3407 u64 new_key; ··· 3721 3674 .ioctl = dm_blk_ioctl, 3722 3675 .getgeo = dm_blk_getgeo, 3723 3676 .report_zones = dm_blk_report_zones, 3677 + .get_unique_id = dm_blk_get_unique_id, 3724 3678 .pr_ops = &dm_pr_ops, 3725 3679 .owner = THIS_MODULE 3726 3680 }; ··· 3731 3683 .release = dm_blk_close, 3732 3684 .ioctl = dm_blk_ioctl, 3733 3685 .getgeo = dm_blk_getgeo, 3686 + .get_unique_id = dm_blk_get_unique_id, 3734 3687 .pr_ops = &dm_pr_ops, 3735 3688 .owner = THIS_MODULE 3736 3689 };
-2
drivers/md/dm.h
··· 71 71 struct target_type *dm_table_get_immutable_target_type(struct dm_table *t); 72 72 struct dm_target *dm_table_get_immutable_target(struct dm_table *t); 73 73 struct dm_target *dm_table_get_wildcard_target(struct dm_table *t); 74 - bool dm_table_bio_based(struct dm_table *t); 75 74 bool dm_table_request_based(struct dm_table *t); 76 75 77 76 void dm_lock_md_type(struct mapped_device *md); 78 77 void dm_unlock_md_type(struct mapped_device *md); 79 - void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type); 80 78 enum dm_queue_mode dm_get_md_type(struct mapped_device *md); 81 79 struct target_type *dm_get_immutable_target_type(struct mapped_device *md); 82 80
+1 -1
drivers/md/persistent-data/dm-space-map-common.c
··· 51 51 block_size - sizeof(__le32), 52 52 INDEX_CSUM_XOR)); 53 53 if (csum_disk != mi_le->csum) { 54 - DMERR_LIMIT("i%s failed: csum %u != wanted %u", __func__, 54 + DMERR_LIMIT("%s failed: csum %u != wanted %u", __func__, 55 55 le32_to_cpu(csum_disk), le32_to_cpu(mi_le->csum)); 56 56 return -EILSEQ; 57 57 }