.. | .. |
---|
83 | 83 | struct work_struct trigger_event; |
---|
84 | 84 | |
---|
85 | 85 | unsigned nr_mirrors; |
---|
86 | | - struct mirror mirror[0]; |
---|
| 86 | + struct mirror mirror[]; |
---|
87 | 87 | }; |
---|
88 | 88 | |
---|
89 | 89 | DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(raid1_resync_throttle, |
---|
.. | .. |
---|
779 | 779 | wakeup_mirrord(ms); |
---|
780 | 780 | } else { |
---|
781 | 781 | map_bio(get_default_mirror(ms), bio); |
---|
782 | | - generic_make_request(bio); |
---|
| 782 | + submit_bio_noacct(bio); |
---|
783 | 783 | } |
---|
784 | 784 | } |
---|
785 | 785 | } |
---|
.. | .. |
---|
878 | 878 | struct dm_target *ti, |
---|
879 | 879 | struct dm_dirty_log *dl) |
---|
880 | 880 | { |
---|
881 | | - size_t len; |
---|
882 | | - struct mirror_set *ms = NULL; |
---|
| 881 | + struct mirror_set *ms = |
---|
| 882 | + kzalloc(struct_size(ms, mirror, nr_mirrors), GFP_KERNEL); |
---|
883 | 883 | |
---|
884 | | - len = sizeof(*ms) + (sizeof(ms->mirror[0]) * nr_mirrors); |
---|
885 | | - |
---|
886 | | - ms = kzalloc(len, GFP_KERNEL); |
---|
887 | 884 | if (!ms) { |
---|
888 | 885 | ti->error = "Cannot allocate mirror context"; |
---|
889 | 886 | return NULL; |
---|