Changeset 80c760e in mainline for uspace/srv/bd/hr/raid5.c


Ignore:
Timestamp:
2025-04-21T12:34:02Z (3 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
75262d2f
Parents:
18c3658
Message:

hr: remove truncated_blkno calculation from raid*.c

Calculate the initial truncated_blkno in hr_init_extents_from_cfg,
allowing the removal of hr_extent_t.blkno.

Also fixes double block_fini() on failed volume creation in
hr_util_try_assemble().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/raid5.c

    r18c3658 r80c760e  
    131131        assert(vol->level == HR_LVL_5 || vol->level == HR_LVL_4);
    132132
    133         uint64_t truncated_blkno = vol->extents[0].blkno;
    134         for (size_t i = 1; i < vol->extent_no; i++) {
    135                 if (vol->extents[i].blkno < truncated_blkno)
    136                         truncated_blkno = vol->extents[i].blkno;
    137         }
    138 
    139         uint64_t total_blkno = truncated_blkno * vol->extent_no;
    140 
    141         vol->truncated_blkno = truncated_blkno;
     133        uint64_t total_blkno = vol->truncated_blkno * vol->extent_no;
     134
    142135        vol->data_offset = vol->meta_ops->get_data_offset();
    143136
     
    145138        /* count md blocks */
    146139        vol->data_blkno -= vol->meta_ops->get_size() * vol->extent_no;
    147         vol->data_blkno -= truncated_blkno; /* count parity */
     140        vol->data_blkno -= vol->truncated_blkno; /* count parity */
    148141
    149142        vol->strip_size = HR_STRIP_SIZE;
Note: See TracChangeset for help on using the changeset viewer.