diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-09-12 17:39:51 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-09-12 17:39:51 +0400 |
commit | 77cdae1814d6d359febee8c85edd1f2671869db4 (patch) | |
tree | 5b80bf0b6e90b56810f7461f78fe8786ff8ff072 /src/core | |
parent | d0df295655ea9e44cca9e4a51f5712a6d2d0fc31 (diff) |
cache directio flag in open file cache
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_open_file_cache.c | 6 | ||||
-rw-r--r-- | src/core/ngx_open_file_cache.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c index 614484d93..f9c6a459a 100644 --- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -205,6 +205,7 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name, of->is_file = file->is_file; of->is_link = file->is_link; of->is_exec = file->is_exec; + of->is_directio = file->is_directio; if (!file->is_dir) { file->count++; @@ -360,6 +361,7 @@ update: file->is_file = of->is_file; file->is_link = of->is_link; file->is_exec = of->is_exec; + file->is_directio = of->is_directio; if (!of->is_dir) { file->count++; @@ -499,9 +501,9 @@ ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log) of->fd = fd; if (of->directio <= ngx_file_size(&fi)) { - if (ngx_directio(fd) == -1) { + if (ngx_directio_on(fd) == -1) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_directio_n " \"%s\" failed", name); + ngx_directio_on_n " \"%s\" failed", name); } else { of->is_directio = 1; diff --git a/src/core/ngx_open_file_cache.h b/src/core/ngx_open_file_cache.h index b15de1d13..af39094a3 100644 --- a/src/core/ngx_open_file_cache.h +++ b/src/core/ngx_open_file_cache.h @@ -63,6 +63,7 @@ struct ngx_cached_open_file_s { unsigned is_file:1; unsigned is_link:1; unsigned is_exec:1; + unsigned is_directio:1; ngx_event_t *event; }; |