Changeset 3c518fc in mainline


Ignore:
Timestamp:
2025-06-17T22:31:01Z (4 days ago)
Author:
Miroslav Cimerman <mc@…>
Children:
f0360ec
Parents:
137f7cf5
Message:

hr: remove HR_BD_SYNC

All syncs are now done with common util hr_sync_extents().

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

Legend:

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

    r137f7cf5 r3c518fc  
    253253        uint8_t *data_read = dst;
    254254
     255        if (size < cnt * vol->bsize)
     256                return EINVAL;
     257
    255258        fibril_rwlock_read_lock(&vol->states_lock);
    256259        if (vol->state != HR_VOL_ONLINE) {
     
    259262        }
    260263        fibril_rwlock_read_unlock(&vol->states_lock);
    261 
    262         /* propagate sync */
    263         if (type == HR_BD_SYNC && ba == 0 && cnt == 0) {
    264                 hr_fgroup_t *group = hr_fgroup_create(vol->fge,
    265                     vol->extent_no);
    266                 if (group == NULL)
    267                         return ENOMEM;
    268 
    269                 for (size_t i = 0; i < vol->extent_no; i++) {
    270                         hr_io_t *io = hr_fgroup_alloc(group);
    271                         io->extent = i;
    272                         io->ba = ba;
    273                         io->cnt = cnt;
    274                         io->type = type;
    275                         io->vol = vol;
    276 
    277                         hr_fgroup_submit(group, hr_io_worker, io);
    278                 }
    279 
    280                 size_t bad;
    281                 rc = hr_fgroup_wait(group, NULL, &bad);
    282                 if (rc == ENOMEM)
    283                         return ENOMEM;
    284 
    285                 if (bad > 0)
    286                         return EIO;
    287 
    288                 return EOK;
    289         }
    290 
    291         if (type == HR_BD_READ || type == HR_BD_WRITE)
    292                 if (size < cnt * vol->bsize)
    293                         return EINVAL;
    294264
    295265        rc = hr_check_ba_range(vol, cnt, ba);
     
    334304                        break;
    335305
    336                 if (type == HR_BD_READ)
    337                         data_read += len;
    338                 else if (type == HR_BD_WRITE)
    339                         data_write += len;
     306                data_read += len;
     307                data_write += len;
    340308
    341309                strip_off = 0;
  • uspace/srv/bd/hr/raid1.c

    r137f7cf5 r3c518fc  
    347347                return rc;
    348348
    349         /* allow full dev sync */
    350         if (!(type == HR_BD_SYNC && ba == 0 && cnt == 0))
    351                 hr_add_data_offset(vol, &ba);
     349        hr_add_data_offset(vol, &ba);
    352350
    353351        /*
  • uspace/srv/bd/hr/var.h

    r137f7cf5 r3c518fc  
    114114
    115115typedef enum {
    116         HR_BD_SYNC,
    117116        HR_BD_READ,
    118117        HR_BD_WRITE
Note: See TracChangeset for help on using the changeset viewer.