Changeset aaf741f in mainline


Ignore:
Timestamp:
2025-06-28T15:07:17Z (3 weeks ago)
Author:
Miroslav Cimerman <mc@…>
Children:
d220b7d
Parents:
8ad48d1c
Message:

hr: metadata/foreign: alloc metadata structs

Location:
uspace/srv/bd/hr/metadata/foreign
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/metadata/foreign/geom/hr_g_mirror.c

    r8ad48d1c raaf741f  
    178178        vol->bsize = main_meta->md_sectorsize;
    179179
     180        vol->in_mem_md = calloc(1, sizeof(struct g_mirror_metadata));
     181        if (vol->in_mem_md == NULL)
     182                return ENOMEM;
    180183        memcpy(vol->in_mem_md, main_meta, sizeof(struct g_mirror_metadata));
    181184
  • uspace/srv/bd/hr/metadata/foreign/geom/hr_g_stripe.c

    r8ad48d1c raaf741f  
    185185        vol->layout = HR_LAYOUT_NONE;
    186186
     187        vol->in_mem_md = calloc(1, sizeof(struct g_stripe_metadata));
     188        if (vol->in_mem_md == NULL)
     189                return ENOMEM;
    187190        memcpy(vol->in_mem_md, main_meta, sizeof(struct g_stripe_metadata));
    188191
  • uspace/srv/bd/hr/metadata/foreign/softraid/hr_softraid.c

    r8ad48d1c raaf741f  
    183183        vol->strip_size = main_meta->ssdi.ssd_strip_size;
    184184
     185        vol->in_mem_md = calloc(1, SR_META_SIZE * DEV_BSIZE);
     186        if (vol->in_mem_md == NULL)
     187                return ENOMEM;
    185188        memcpy(vol->in_mem_md, main_meta, SR_META_SIZE * DEV_BSIZE);
    186189
Note: See TracChangeset for help on using the changeset viewer.