Changeset f0950d2 in mainline
- Timestamp:
- 2025-06-17T13:23:57Z (5 days ago)
- Children:
- d574c11
- Parents:
- 234212a
- Location:
- uspace/srv/bd/hr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/util.c
r234212a rf0950d2 76 76 extern fibril_rwlock_t hr_volumes_lock; 77 77 78 /* 79 * malloc() wrapper that behaves like 80 * FreeBSD malloc(9) with M_WAITOK flag. 81 * 82 * Return value is never NULL. 83 */ 84 void *malloc_waitok(size_t size) 85 { 86 void *ret; 87 while ((ret = malloc(size)) == NULL) 88 fibril_usleep(MSEC2USEC(250)); /* sleep 250ms */ 89 90 return ret; 91 } 92 93 void *calloc_waitok(size_t nmemb, size_t size) 94 { 95 void *ret; 96 while ((ret = calloc(nmemb, size)) == NULL) 97 fibril_usleep(MSEC2USEC(250)); /* sleep 250ms */ 98 99 return ret; 100 } 101 78 102 errno_t hr_create_vol_struct(hr_volume_t **rvol, hr_level_t level, 79 103 const char *devname, hr_metadata_type_t metadata_type) -
uspace/srv/bd/hr/util.h
r234212a rf0950d2 77 77 } hr_range_lock_t; 78 78 79 extern void *malloc_waitok(size_t) 80 __attribute__((malloc)); 81 82 extern void *calloc_waitok(size_t, size_t) 83 __attribute__((malloc)); 84 79 85 extern errno_t hr_create_vol_struct(hr_volume_t **, hr_level_t, const char *, 80 86 hr_metadata_type_t);
Note:
See TracChangeset
for help on using the changeset viewer.