… | |
… | |
246 | { |
246 | { |
247 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
247 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
248 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
248 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
249 | } |
249 | } |
250 | |
250 | |
|
|
251 | /* TODO: we only need a compiler barrier here, not a read fence */ |
|
|
252 | ECB_MEMORY_FENCE_RELEASE; |
251 | /* as an extension to C, we hope that the volatile will makethis atomic and once-only */ |
253 | /* as an extension to C, we hope that the volatile will make this atomic and once-only */ |
252 | *(volatile unsigned *)&ring->head = tail; |
254 | *(volatile unsigned *)&ring->head = tail; |
253 | /* make sure kernel can see our new head value - probably not required */ |
255 | /* make sure kernel can see our new head value - probably not required */ |
254 | ECB_MEMORY_FENCE_RELEASE; |
256 | ECB_MEMORY_FENCE_RELEASE; |
255 | |
257 | |
256 | return 1; |
258 | return 1; |