Changeset 800d188 in mainline for uspace/srv/bd/hr/io.c
- Timestamp:
- 2025-04-15T07:00:31Z (2 months ago)
- Children:
- 29e7cc7
- Parents:
- ca7fa5b
- git-author:
- Miroslav Cimerman <mc@…> (2025-04-15 06:55:25)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-04-15 07:00:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/io.c
rca7fa5b r800d188 45 45 #include "var.h" 46 46 47 static errno_t exec_io_op(hr_io_t *); 48 47 49 errno_t hr_io_worker(void *arg) 48 50 { 49 51 hr_io_t *io = arg; 52 53 errno_t rc = exec_io_op(io); 54 55 /* 56 * We don't have to invalidate extents who got ENOMEM 57 * on READ/SYNC. But when we get ENOMEM on a WRITE, we have 58 * to invalidate it, because there could have been 59 * other writes, there is no way to rollback. 60 */ 61 if (rc != EOK && (rc != ENOMEM || io->type == HR_BD_WRITE)) 62 io->vol->state_callback(io->vol, io->extent, rc); 63 64 return rc; 65 } 66 67 errno_t hr_io_worker_basic(void *arg) 68 { 69 hr_io_t *io = arg; 70 71 errno_t rc = exec_io_op(io); 72 73 return rc; 74 } 75 76 static errno_t exec_io_op(hr_io_t *io) 77 { 78 size_t ext_idx = io->extent; 50 79 hr_extent_t *extents = (hr_extent_t *)&io->vol->extents; 51 size_t ext_idx = io->extent;52 80 errno_t rc; 53 81 … … 90 118 HR_DEBUG("WORKER (%p) rc: %s\n", io, str_error(rc)); 91 119 92 /*93 * We don't have to invalidate extents who got ENOMEM94 * on READ/SYNC. But when we get ENOMEM on a WRITE, we have95 * to invalidate it, because there could have been96 * other writes, there is no way to rollback.97 */98 if (rc != EOK && (rc != ENOMEM || io->type == HR_BD_WRITE))99 io->state_callback(io->vol, io->extent, rc);100 101 120 return rc; 102 121 }
Note:
See TracChangeset
for help on using the changeset viewer.