Changeset d946c27 in mainline


Ignore:
Timestamp:
2025-03-29T13:58:15Z (3 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
2e7df2e
Parents:
49de61c
Message:

hr: initialize and populate in memory metadata

Location:
uspace/srv/bd/hr
Files:
2 edited

Legend:

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

    r49de61c rd946c27  
    8989
    9090        }
     91
     92        memcpy(vol->in_mem_md, metadata, sizeof(hr_metadata_t));
    9193error:
    9294        free(metadata);
  • uspace/srv/bd/hr/util.c

    r49de61c rd946c27  
    109109        }
    110110
     111        vol->in_mem_md = calloc(1, sizeof(hr_metadata_t));
     112        if (vol->in_mem_md == NULL) {
     113                free(vol->fge);
     114                rc = ENOMEM;
     115                goto error;
     116        }
     117
    111118        vol->status = HR_VOL_NONE;
    112119
     
    813820        memcpy(vol->devname, main_md->devname, HR_DEVNAME_LEN);
    814821
     822        memcpy(vol->in_mem_md, main_md, sizeof(hr_metadata_t));
     823
    815824        list_foreach(*list, link, struct svc_id_linked, iter) {
    816825                vol->extents[iter->md->index].svc_id = iter->svc_id;
     
    840849         * XXX: register it here
    841850         * ... if it fails on EEXIST try different name... like + 1 on the end
     851         *
     852         * or have metadata edit utility as a part of hrctl..., or create
     853         * the original name + 4 random characters, tell the user that the device
     854         * was created with this new name, and add a option to hrctl to rename
     855         * an active array, and then write the new dirty metadata...
     856         *
     857         * or just refuse to assemble a name that is already used...
    842858         *
    843859         * TODO: discuss
     
    893909                iter = list_pop(&dev_id_list, struct svc_id_linked, link);
    894910
    895                 printf("svc_id: %lu\n", iter->svc_id);
    896 
    897911                void *metadata_block;
    898912                hr_metadata_t metadata;
     
    907921
    908922                if (!hr_valid_md_magic(&metadata)) {
    909                         printf("BAD magic\n");
    910923                        block_fini(iter->svc_id);
    911924                        free_svc_id_linked(iter);
     
    913926                }
    914927
    915                 hr_metadata_dump(&metadata);
     928                /* hr_metadata_dump(&metadata); */
    916929
    917930                char *svc_name = NULL;
     
    944957                list_foreach(matching_svcs_list, link, struct svc_id_linked,
    945958                    iter2) {
    946                         printf("matching svc_id: %lu\n", iter2->svc_id);
    947959                        struct svc_id_linked *to_remove;
    948960                        list_foreach_safe(dev_id_list, cur_link, next_link) {
Note: See TracChangeset for help on using the changeset viewer.