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.

dm-verity: consolidate the BH and normal work structs

Since each dm_verity_io is never on both the BH and normal workqueues at
the same time, there's no need for two different work_structs. Replace
the 'bh_work' and 'work' fields with just 'work'.

Note: this is correct even though it means 'work' may be reused while
verity_bh_work() is running. The workqueue API allows work functions to
reuse or free their work_struct, and many workqueue users rely on that.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Eric Biggers and committed by
Mikulas Patocka
569e7859 d4880868

+4 -5
+4 -4
drivers/md/dm-verity-target.c
··· 651 651 652 652 static void verity_bh_work(struct work_struct *w) 653 653 { 654 - struct dm_verity_io *io = container_of(w, struct dm_verity_io, bh_work); 654 + struct dm_verity_io *io = container_of(w, struct dm_verity_io, work); 655 655 int err; 656 656 657 657 io->in_bh = true; ··· 690 690 if (static_branch_unlikely(&use_bh_wq_enabled) && io->v->use_bh_wq && 691 691 verity_use_bh(bytes, ioprio)) { 692 692 if (in_hardirq() || irqs_disabled()) { 693 - INIT_WORK(&io->bh_work, verity_bh_work); 694 - queue_work(system_bh_wq, &io->bh_work); 693 + INIT_WORK(&io->work, verity_bh_work); 694 + queue_work(system_bh_wq, &io->work); 695 695 } else { 696 - verity_bh_work(&io->bh_work); 696 + verity_bh_work(&io->work); 697 697 } 698 698 } else { 699 699 INIT_WORK(&io->work, verity_work);
-1
drivers/md/dm-verity.h
··· 109 109 #endif 110 110 111 111 struct work_struct work; 112 - struct work_struct bh_work; 113 112 114 113 u8 tmp_digest[HASH_MAX_DIGESTSIZE]; 115 114