proposal-dm.txt revision 1.2
11.2Shaad 21.2Shaad 31.2Shaad/* constant dm_target structures for error, zero, linear, stripes etc. */ 41.2Shaadstruct dm_target { 51.2Shaad int (*init)(struct dm_table_entry *, int argc, char **argv); 61.2Shaad int (*destroy)(struct dm_table_entry *); 71.2Shaad int (*strategy)(struct dm_table_entry *, struct buf *); 81.2Shaad int (*upcall)(struct dm_table_entry *, struct buf *); 91.2Shaad 101.2Shaad SLIST_ENTRY(dm_target) next; 111.2Shaad}; 121.2Shaad 131.2Shaad 141.2Shaadstruct dm_table_entry { 151.2Shaad struct dm_dev *dm_dev; /* backlink */ 161.2Shaad uint64_t start; 171.2Shaad uint64_t length; 181.2Shaad 191.2Shaad struct dm_target *target; 201.2Shaad void *target_config; 211.2Shaad SLIST_ENTRY(dm_table_entry) next; 221.2Shaad}; 231.2ShaadSLIST(dm_table, dm_table_entry); 241.2Shaad 251.2Shaad 261.2Shaadstruct dm_pdev { 271.2Shaad struct vnode *pdev_vnode; 281.2Shaad int refcnt; 291.2Shaad SLIST_ENTRY(dm_pdev) next_pdev; 301.2Shaad}; 311.2ShaadSLIST(dm_pdevs, pm_pdev); 321.2Shaad 331.2Shaad 341.2Shaadstruct dm_dev { 351.2Shaad char name[DM_NAME_LEN]; 361.2Shaad char uuid[DM_UUID_LEN]; 371.2Shaad 381.2Shaad int minor; 391.2Shaad uint32_t flags; 401.2Shaad 411.2Shaad kmutex_t dev_mtx; 421.2Shaad uint32_t event_nr; 431.2Shaad uint32_t ref_cnt; 441.2Shaad 451.2Shaad struct dm_pdev pdevs; 461.2Shaad 471.2Shaad int cur_active_table; 481.2Shaad struct dm_table tables[2]; 491.2Shaad 501.2Shaad struct dm_dev_list upcalls; 511.2Shaad SLIST_NEXT(dm_dev) next_upcall; 521.2Shaad 531.2Shaad SLIST_NEXT(dm_dev) next_devlist; 541.2Shaad}; 551.2ShaadSLIST(dm_dev_list, dm_dev) dm_devs; 561.2Shaad 571.2Shaad 581.2Shaad/* for zero,error : dm_target->target_config == NULL */ 591.2Shaad/* for linear : */ 601.2Shaadstruct target_linear_config { 611.2Shaad struct dm_pdev *pdev; 621.2Shaad uint64_t offset; 631.2Shaad}; 641.2Shaad 651.2Shaad 661.2Shaad/* for mirror : */ 671.2Shaadstruct target_mirror_config { 681.2Shaad struct dm_pdev *orig; 691.2Shaad struct dm_pdev *copies[MAX_MIRROR_COPIES]; 701.2Shaad 711.2Shaad /* copied blocks bitmaps administration etc*/ 721.2Shaad struct dm_pdev *log_pdev; /* for administration */ 731.2Shaad uint64_t log_regionsize; /* blocksize of mirror */ 741.2Shaad 751.2Shaad /* list of parts that still need copied etc.; run length encoded? */ 761.2Shaad .... 771.2Shaad}; 781.2Shaad 791.2Shaad 801.2Shaad/* for snapshot : */ 811.2Shaadstruct target_snapshot_config { 821.2Shaad struct dm_dev *orig; 831.2Shaad 841.2Shaad /* modified blocks bitmaps administration etc*/ 851.2Shaad struct dm_pdev *log_pdev; 861.2Shaad uint64_t log_regionsize; 871.2Shaad /* list of sector renames to the log device */ 881.2Shaad ... 891.2Shaad}; 901.2Shaad 91