~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to storage/innobase/buf/buf0rea.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
299
299
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
300
300
released by the i/o-handler thread. Does a random read-ahead if it seems
301
301
sensible. */
302
 
 
303
 
ulint
 
302
ibool
304
303
buf_read_page(
305
304
/*==========*/
306
 
                        /* out: number of page read requests issued: this can
307
 
                        be > 1 if read-ahead occurred */
 
305
                        /* out: TRUE if success, FALSE otherwise */
308
306
        ulint   space,  /* in: space id */
309
307
        ulint   offset) /* in: page number */
310
308
{
311
309
        ib_longlong     tablespace_version;
312
310
        ulint           count;
313
 
        ulint           count2;
314
311
        ulint           err;
315
312
 
316
313
        tablespace_version = fil_space_get_version(space);
317
314
 
318
 
        count = buf_read_ahead_random(space, offset);
 
315
        buf_read_ahead_random(space, offset);
319
316
 
320
317
        /* We do the i/o in the synchronous aio mode to save thread
321
318
        switches: hence TRUE */
322
319
 
323
 
        count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
 
320
        count = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
324
321
                                   tablespace_version, offset);
325
 
        srv_buf_pool_reads+= count2;
 
322
        srv_buf_pool_reads+= count;
326
323
        if (err == DB_TABLESPACE_DELETED) {
327
324
                ut_print_timestamp(stderr);
328
325
                fprintf(stderr,
336
333
        /* Flush pages from the end of the LRU list if necessary */
337
334
        buf_flush_free_margin();
338
335
 
339
 
        return(count + count2);
 
336
        return(count > 0);
340
337
}
341
338
 
342
339
/************************************************************************