dm-target: target_type improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | dm-target: use the module's refcount insteaddrivers/ | +4 | 0 replies | |
| 2/3 | dm-target: use pointer reference instead of making a copydrivers/ | +8 | 0 replies | |
| 3/3 | dm-target: embed internally used list_head into target_typedrivers/ include/ | +37 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] dm-target: target_type improvements
From: Cheng Renquan <[email protected]>
The series of patches:
1. use module's refcount instead of self-maintained use field;
2. use pointer reference instead of making a copy of target_type;
3. totally remove tt_internal;
The 3rd patch may be controversial,
Quoted 8 lines · Alasdair G Kergon
Target registrations should be rare one-off events. The existing trade-off is
in favour of a cleaner interface (that does not expose private fields). The structtarget_typepassed todm_register_targetis always static read-only data
and perhaps that could be enforced and a pointer stored intt_internalinstead
of making a copy.
But I still think it's worth it:
1. current users of struct target_type hasn't been marked with const, just static;
2. other similar structures (file_system_type in filesystems, packet_type in net core, ) all have internally used list_head for manage purpose; this design can avoid memory frag from kmalloc/kfree.
--
Cheng Renquan, Shenzhen, China