Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>


1167 
1168         return (B_FALSE);
1169 }
1170 
1171 static int
1172 zio_issue_async(zio_t *zio)
1173 {
1174         zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE);
1175 
1176         return (ZIO_PIPELINE_STOP);
1177 }
1178 
1179 void
1180 zio_interrupt(zio_t *zio)
1181 {
1182         zio_taskq_dispatch(zio, ZIO_TASKQ_INTERRUPT, B_FALSE);
1183 }
1184 
1185 /*
1186  * Execute the I/O pipeline until one of the following occurs:
1187  * (1) the I/O completes; (2) the pipeline stalls waiting for
1188  * dependent child I/Os; (3) the I/O issues, so we're waiting
1189  * for an I/O completion interrupt; (4) the I/O is delegated by
1190  * vdev-level caching or aggregation; (5) the I/O is deferred
1191  * due to vdev-level queueing; (6) the I/O is handed off to
1192  * another thread.  In all cases, the pipeline stops whenever
1193  * there's no CPU work; it never burns a thread in cv_wait().



1194  *
1195  * There's no locking on io_stage because there's no legitimate way
1196  * for multiple threads to be attempting to process the same I/O.
1197  */
1198 static zio_pipe_stage_t *zio_pipeline[];
1199 
1200 void
1201 zio_execute(zio_t *zio)
1202 {
1203         zio->io_executor = curthread;
1204 
1205         while (zio->io_stage < ZIO_STAGE_DONE) {
1206                 enum zio_stage pipeline = zio->io_pipeline;
1207                 enum zio_stage stage = zio->io_stage;
1208                 int rv;
1209 
1210                 ASSERT(!MUTEX_HELD(&zio->io_lock));
1211                 ASSERT(ISP2(stage));
1212                 ASSERT(zio->io_stall == NULL);
1213 




1167 
1168         return (B_FALSE);
1169 }
1170 
1171 static int
1172 zio_issue_async(zio_t *zio)
1173 {
1174         zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE);
1175 
1176         return (ZIO_PIPELINE_STOP);
1177 }
1178 
1179 void
1180 zio_interrupt(zio_t *zio)
1181 {
1182         zio_taskq_dispatch(zio, ZIO_TASKQ_INTERRUPT, B_FALSE);
1183 }
1184 
1185 /*
1186  * Execute the I/O pipeline until one of the following occurs:
1187  *
1188  *      (1) the I/O completes
1189  *      (2) the pipeline stalls waiting for dependent child I/Os
1190  *      (3) the I/O issues, so we're waiting for an I/O completion interrupt
1191  *      (4) the I/O is delegated by vdev-level caching or aggregation
1192  *      (5) the I/O is deferred due to vdev-level queueing
1193  *      (6) the I/O is handed off to another thread.
1194  *
1195  * In all cases, the pipeline stops whenever there's no CPU work; it never
1196  * burns a thread in cv_wait().
1197  *
1198  * There's no locking on io_stage because there's no legitimate way
1199  * for multiple threads to be attempting to process the same I/O.
1200  */
1201 static zio_pipe_stage_t *zio_pipeline[];
1202 
1203 void
1204 zio_execute(zio_t *zio)
1205 {
1206         zio->io_executor = curthread;
1207 
1208         while (zio->io_stage < ZIO_STAGE_DONE) {
1209                 enum zio_stage pipeline = zio->io_pipeline;
1210                 enum zio_stage stage = zio->io_stage;
1211                 int rv;
1212 
1213                 ASSERT(!MUTEX_HELD(&zio->io_lock));
1214                 ASSERT(ISP2(stage));
1215                 ASSERT(zio->io_stall == NULL);
1216