~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/os/os0file.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
652
652
        const char*     name)   /*!< in: file name */
653
653
{
654
654
        struct flock lk;
 
655
 
 
656
        if (srv_read_only)
 
657
          return 0;
 
658
 
655
659
        lk.l_type = F_WRLCK;
656
660
        lk.l_whence = SEEK_SET;
657
661
        lk.l_start = lk.l_len = 0;
1495
1499
        if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1496
1500
            || create_mode == OS_FILE_OPEN_RETRY) {
1497
1501
                mode_str = "OPEN";
1498
 
                create_flag = O_RDWR;
 
1502
                if (srv_read_only)
 
1503
                  create_flag = O_RDONLY;
 
1504
                else
 
1505
                  create_flag = O_RDWR;
1499
1506
        } else if (create_mode == OS_FILE_CREATE) {
1500
1507
                mode_str = "CREATE";
1501
1508
                create_flag = O_RDWR | O_CREAT | O_EXCL;
1564
1571
                os_file_set_nocache(file, name, mode_str);
1565
1572
        }
1566
1573
 
 
1574
        /* With ALL_O_DIRECT we disable OS caching for trx log file too */
 
1575
        if (srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT) {
 
1576
                os_file_set_nocache(file, name, mode_str);
 
1577
        }
 
1578
 
1567
1579
#ifdef USE_FILE_LOCK
1568
1580
        if (create_mode != OS_FILE_OPEN_RAW && os_file_lock(file, name)) {
1569
1581
 
2291
2303
                }
2292
2304
        }
2293
2305
 
 
2306
        if (srv_fake_write)
 
2307
          return(TRUE);
 
2308
 
2294
2309
        os_n_file_writes++;
2295
2310
 
2296
2311
#if defined(HAVE_PWRITE) && !defined(HAVE_BROKEN_PREAD)
2673
2688
        ut_a((offset & 0xFFFFFFFFUL) == offset);
2674
2689
        ut_a((n & 0xFFFFFFFFUL) == n);
2675
2690
 
 
2691
        if (srv_fake_write)
 
2692
          return(TRUE);
 
2693
 
2676
2694
        os_n_file_writes++;
2677
2695
 
2678
2696
        ut_ad(file);