~fallenpegasus/drizzle/logcsv

« back to all changes in this revision

Viewing changes to plugin/innobase/buf/buf0flu.c

  • Committer: lbieber at stabletransit
  • Date: 2010-10-13 16:20:08 UTC
  • mfrom: (1843.1.3 build)
  • Revision ID: lbieber@drizzle-build-n02.wc1.dfw1.stabletransit.com-20101013162008-qi2e6k5yvfm16964
Merge Stewart - update innobase plugin to be based on innodb_plugin 1.0.6
Merge Monty - more valgrind cleanup
Merge Monty - Moved libdrizzle api listings from doxygen to sphinx

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
}
305
305
 
306
306
/********************************************************************//**
 
307
Flush a batch of writes to the datafiles that have already been
 
308
written by the OS. */
 
309
static
 
310
void
 
311
buf_flush_sync_datafiles(void)
 
312
/*==========================*/
 
313
{
 
314
        /* Wake possible simulated aio thread to actually post the
 
315
        writes to the operating system */
 
316
        os_aio_simulated_wake_handler_threads();
 
317
 
 
318
        /* Wait that all async writes to tablespaces have been posted to
 
319
        the OS */
 
320
        os_aio_wait_until_no_pending_writes();
 
321
 
 
322
        /* Now we flush the data to disk (for example, with fsync) */
 
323
        fil_flush_file_spaces(FIL_TABLESPACE);
 
324
 
 
325
        return;
 
326
}
 
327
 
 
328
/********************************************************************//**
307
329
Flushes possible buffered writes from the doublewrite memory buffer to disk,
308
330
and also wakes up the aio thread if simulated aio is used. It is very
309
331
important to call this function after a batch of writes has been posted,
320
342
        ulint           i;
321
343
 
322
344
        if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) {
323
 
                os_aio_simulated_wake_handler_threads();
324
 
 
 
345
                /* Sync the writes to the disk. */
 
346
                buf_flush_sync_datafiles();
325
347
                return;
326
348
        }
327
349
 
529
551
                buf_LRU_stat_inc_io();
530
552
        }
531
553
 
532
 
        /* Wake possible simulated aio thread to actually post the
533
 
        writes to the operating system */
534
 
 
535
 
        os_aio_simulated_wake_handler_threads();
536
 
 
537
 
        /* Wait that all async writes to tablespaces have been posted to
538
 
        the OS */
539
 
 
540
 
        os_aio_wait_until_no_pending_writes();
541
 
 
542
 
        /* Now we flush the data to disk (for example, with fsync) */
543
 
 
544
 
        fil_flush_file_spaces(FIL_TABLESPACE);
 
554
        /* Sync the writes to the disk. */
 
555
        buf_flush_sync_datafiles();
545
556
 
546
557
        /* We can now reuse the doublewrite memory buffer: */
547
 
 
548
558
        trx_doublewrite->first_free = 0;
549
559
 
550
560
        mutex_exit(&(trx_doublewrite->mutex));