Changeset 78433bb in mainline
- Timestamp:
- 2025-06-27T21:02:40Z (4 weeks ago)
- Children:
- aa9bad8
- Parents:
- c69cbef
- git-author:
- Miroslav Cimerman <mc@…> (2025-06-27 21:01:51)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-06-27 21:02:40)
- Location:
- uspace/srv/bd/hr
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/hr.c
rc69cbef r78433bb 147 147 goto error; 148 148 149 rc = vol->meta_ops->init_vol2meta(vol , vol->in_mem_md);149 rc = vol->meta_ops->init_vol2meta(vol); 150 150 if (rc != EOK) 151 151 goto error; -
uspace/srv/bd/hr/metadata/foreign/geom/hr_g_mirror.c
rc69cbef r78433bb 55 55 56 56 static void *meta_gmirror_alloc_struct(void); 57 static errno_t meta_gmirror_init_vol2meta( const hr_volume_t *, void*);57 static errno_t meta_gmirror_init_vol2meta(hr_volume_t *); 58 58 static errno_t meta_gmirror_init_meta2vol(const list_t *, hr_volume_t *); 59 59 static void meta_gmirror_encode(void *, void *); … … 101 101 } 102 102 103 static errno_t meta_gmirror_init_vol2meta( const hr_volume_t *vol, void *md_v)103 static errno_t meta_gmirror_init_vol2meta(hr_volume_t *vol) 104 104 { 105 105 (void)vol; 106 (void)md_v;107 106 108 107 return ENOTSUP; -
uspace/srv/bd/hr/metadata/foreign/geom/hr_g_stripe.c
rc69cbef r78433bb 55 55 56 56 static void *meta_gstripe_alloc_struct(void); 57 static errno_t meta_gstripe_init_vol2meta( const hr_volume_t *, void*);57 static errno_t meta_gstripe_init_vol2meta(hr_volume_t *); 58 58 static errno_t meta_gstripe_init_meta2vol(const list_t *, hr_volume_t *); 59 59 static void meta_gstripe_encode(void *, void *); … … 101 101 } 102 102 103 static errno_t meta_gstripe_init_vol2meta( const hr_volume_t *vol, void *md_v)103 static errno_t meta_gstripe_init_vol2meta(hr_volume_t *vol) 104 104 { 105 105 (void)vol; 106 (void)md_v;107 106 return ENOTSUP; 108 107 } -
uspace/srv/bd/hr/metadata/foreign/softraid/hr_softraid.c
rc69cbef r78433bb 55 55 56 56 static void *meta_softraid_alloc_struct(void); 57 static errno_t meta_softraid_init_vol2meta( const hr_volume_t *, void*);57 static errno_t meta_softraid_init_vol2meta(hr_volume_t *); 58 58 static errno_t meta_softraid_init_meta2vol(const list_t *, hr_volume_t *); 59 59 static void meta_softraid_encode(void *, void *); … … 101 101 } 102 102 103 static errno_t meta_softraid_init_vol2meta( const hr_volume_t *vol, void *md_v)103 static errno_t meta_softraid_init_vol2meta(hr_volume_t *vol) 104 104 { 105 105 (void)vol; 106 (void)md_v; 106 107 107 return ENOTSUP; 108 108 } -
uspace/srv/bd/hr/metadata/native.c
rc69cbef r78433bb 55 55 56 56 static void *meta_native_alloc_struct(void); 57 static errno_t meta_native_init_vol2meta( const hr_volume_t *, void*);57 static errno_t meta_native_init_vol2meta(hr_volume_t *); 58 58 static errno_t meta_native_init_meta2vol(const list_t *, hr_volume_t *); 59 59 static void meta_native_encode(void *, void *); … … 103 103 } 104 104 105 static errno_t meta_native_init_vol2meta(const hr_volume_t *vol, void *md_v) 106 { 107 HR_DEBUG("%s()", __func__); 108 109 hr_metadata_t *md = md_v; 105 static errno_t meta_native_init_vol2meta(hr_volume_t *vol) 106 { 107 HR_DEBUG("%s()", __func__); 108 109 hr_metadata_t *md = calloc(1, sizeof(*md)); 110 if (md == NULL) 111 return ENOMEM; 110 112 111 113 str_cpy(md->magic, HR_NATIVE_MAGIC_SIZE, HR_NATIVE_MAGIC_STR); … … 132 134 md->bsize = vol->bsize; 133 135 memcpy(md->devname, vol->devname, HR_DEVNAME_LEN); 136 137 vol->in_mem_md = md; 134 138 135 139 return EOK; … … 163 167 /* already set */ 164 168 /* memcpy(vol->devname, main_meta->devname, HR_DEVNAME_LEN); */ 169 170 vol->in_mem_md = calloc(1, sizeof(hr_metadata_t)); 171 if (vol->in_mem_md == NULL) 172 return ENOMEM; 165 173 memcpy(vol->in_mem_md, main_meta, sizeof(hr_metadata_t)); 166 174 -
uspace/srv/bd/hr/superblock.h
rc69cbef r78433bb 45 45 typedef struct hr_superblock_ops { 46 46 void *(*alloc_struct)(void); 47 errno_t (*init_vol2meta)( const hr_volume_t *, void*);47 errno_t (*init_vol2meta)(hr_volume_t *); 48 48 errno_t (*init_meta2vol)(const list_t *, hr_volume_t *); 49 49 void (*encode)(void *, void *); -
uspace/srv/bd/hr/util.c
rc69cbef r78433bb 159 159 } 160 160 161 vol->in_mem_md = vol->meta_ops->alloc_struct();162 if (vol->in_mem_md == NULL) {163 free(vol->fge);164 rc = ENOMEM;165 goto error;166 }167 168 161 vol->state = HR_VOL_NONE; 169 162
Note:
See TracChangeset
for help on using the changeset viewer.