static void aio_sync_all(struct aio_output *output, struct list_head *tmp_list) { unsigned long long latency; int err; output->fdsync_active = true; atomic_inc(&output->total_fdsync_count); latency = TIME_STATS( &timings[2], err = aio_sync(output->mf->mf_filp) ); threshold_check(&aio_sync_threshold, latency); output->fdsync_active = false; wake_up_interruptible_all(&output->fdsync_event); if (err < 0) { MARS_ERR("FDSYNC error %d\n", err); } /* Signal completion for the whole list. * No locking needed, it's on the stack. */ _complete_all(tmp_list, output, err); }
/* Flush all pending I/O */ void aioSync(void) { if (!initialised) return; /* nothing to do then */ /* Flush all pending operations */ debug(32, 1) ("aioSync: flushing pending I/O operations\n"); do { aioCheckCallbacks(); } while (aio_sync()); debug(32, 1) ("aioSync: done\n"); }