comparison src/core/ngx_open_file_cache.c @ 2246:987831d73bd8

cache directio flag in open file cache
author Igor Sysoev <igor@sysoev.ru>
date Fri, 12 Sep 2008 13:39:51 +0000
parents 8564129d49b6
children 225fa4abd76f
comparison
equal deleted inserted replaced
2245:8a98616abb73 2246:987831d73bd8
203 203
204 of->is_dir = file->is_dir; 204 of->is_dir = file->is_dir;
205 of->is_file = file->is_file; 205 of->is_file = file->is_file;
206 of->is_link = file->is_link; 206 of->is_link = file->is_link;
207 of->is_exec = file->is_exec; 207 of->is_exec = file->is_exec;
208 of->is_directio = file->is_directio;
208 209
209 if (!file->is_dir) { 210 if (!file->is_dir) {
210 file->count++; 211 file->count++;
211 ngx_open_file_add_event(cache, file, of, pool->log); 212 ngx_open_file_add_event(cache, file, of, pool->log);
212 } 213 }
358 359
359 file->is_dir = of->is_dir; 360 file->is_dir = of->is_dir;
360 file->is_file = of->is_file; 361 file->is_file = of->is_file;
361 file->is_link = of->is_link; 362 file->is_link = of->is_link;
362 file->is_exec = of->is_exec; 363 file->is_exec = of->is_exec;
364 file->is_directio = of->is_directio;
363 365
364 if (!of->is_dir) { 366 if (!of->is_dir) {
365 file->count++; 367 file->count++;
366 } 368 }
367 } 369 }
497 499
498 } else { 500 } else {
499 of->fd = fd; 501 of->fd = fd;
500 502
501 if (of->directio <= ngx_file_size(&fi)) { 503 if (of->directio <= ngx_file_size(&fi)) {
502 if (ngx_directio(fd) == -1) { 504 if (ngx_directio_on(fd) == -1) {
503 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, 505 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
504 ngx_directio_n " \"%s\" failed", name); 506 ngx_directio_on_n " \"%s\" failed", name);
505 507
506 } else { 508 } else {
507 of->is_directio = 1; 509 of->is_directio = 1;
508 } 510 }
509 } 511 }