@@ -371,7 +371,13 @@ struct cache_stats {
371371
372372struct cache {
373373 struct dm_target * ti ;
374- struct dm_target_callbacks callbacks ;
374+ spinlock_t lock ;
375+
376+ /*
377+ * Fields for converting from sectors to blocks.
378+ */
379+ int sectors_per_block_shift ;
380+ sector_t sectors_per_block ;
375381
376382 struct dm_cache_metadata * cmd ;
377383
@@ -402,13 +408,11 @@ struct cache {
402408 dm_cblock_t cache_size ;
403409
404410 /*
405- * Fields for converting from sectors to blocks .
411+ * Invalidation fields .
406412 */
407- sector_t sectors_per_block ;
408- int sectors_per_block_shift ;
413+ spinlock_t invalidation_lock ;
414+ struct list_head invalidation_requests ;
409415
410- spinlock_t lock ;
411- struct bio_list deferred_bios ;
412416 sector_t migration_threshold ;
413417 wait_queue_head_t migration_wait ;
414418 atomic_t nr_allocated_migrations ;
@@ -419,13 +423,11 @@ struct cache {
419423 */
420424 atomic_t nr_io_migrations ;
421425
426+ struct bio_list deferred_bios ;
427+
422428 struct rw_semaphore quiesce_lock ;
423429
424- /*
425- * cache_size entries, dirty if set
426- */
427- atomic_t nr_dirty ;
428- unsigned long * dirty_bitset ;
430+ struct dm_target_callbacks callbacks ;
429431
430432 /*
431433 * origin_blocks entries, discarded if set.
@@ -442,17 +444,27 @@ struct cache {
442444 const char * * ctr_args ;
443445
444446 struct dm_kcopyd_client * copier ;
445- struct workqueue_struct * wq ;
446447 struct work_struct deferred_bio_worker ;
447448 struct work_struct migration_worker ;
449+ struct workqueue_struct * wq ;
448450 struct delayed_work waker ;
449451 struct dm_bio_prison_v2 * prison ;
450- struct bio_set bs ;
451452
452- mempool_t migration_pool ;
453+ /*
454+ * cache_size entries, dirty if set
455+ */
456+ unsigned long * dirty_bitset ;
457+ atomic_t nr_dirty ;
453458
454- struct dm_cache_policy * policy ;
455459 unsigned policy_nr_args ;
460+ struct dm_cache_policy * policy ;
461+
462+ /*
463+ * Cache features such as write-through.
464+ */
465+ struct cache_features features ;
466+
467+ struct cache_stats stats ;
456468
457469 bool need_tick_bio :1 ;
458470 bool sized :1 ;
@@ -461,25 +473,16 @@ struct cache {
461473 bool loaded_mappings :1 ;
462474 bool loaded_discards :1 ;
463475
464- /*
465- * Cache features such as write-through.
466- */
467- struct cache_features features ;
468-
469- struct cache_stats stats ;
476+ struct rw_semaphore background_work_lock ;
470477
471- /*
472- * Invalidation fields.
473- */
474- spinlock_t invalidation_lock ;
475- struct list_head invalidation_requests ;
478+ struct batcher committer ;
479+ struct work_struct commit_ws ;
476480
477481 struct io_tracker tracker ;
478482
479- struct work_struct commit_ws ;
480- struct batcher committer ;
483+ mempool_t migration_pool ;
481484
482- struct rw_semaphore background_work_lock ;
485+ struct bio_set bs ;
483486};
484487
485488struct per_bio_data {
0 commit comments