of 24 core/ngx_open_file_cache.c static ngx_int_t ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, of 27 core/ngx_open_file_cache.c ngx_cached_open_file_t *file, ngx_open_file_info_t *of, ngx_log_t *log); of 131 core/ngx_open_file_cache.c ngx_open_file_info_t *of, ngx_pool_t *pool) of 142 core/ngx_open_file_cache.c of->fd = NGX_INVALID_FILE; of 143 core/ngx_open_file_cache.c of->err = 0; of 147 core/ngx_open_file_cache.c if (of->test_only) { of 150 core/ngx_open_file_cache.c of->err = ngx_errno; of 151 core/ngx_open_file_cache.c of->failed = ngx_file_info_n; of 155 core/ngx_open_file_cache.c of->uniq = ngx_file_uniq(&fi); of 156 core/ngx_open_file_cache.c of->mtime = ngx_file_mtime(&fi); of 157 core/ngx_open_file_cache.c of->size = ngx_file_size(&fi); of 158 core/ngx_open_file_cache.c of->is_dir = ngx_is_dir(&fi); of 159 core/ngx_open_file_cache.c of->is_file = ngx_is_file(&fi); of 160 core/ngx_open_file_cache.c of->is_link = ngx_is_link(&fi); of 161 core/ngx_open_file_cache.c of->is_exec = ngx_is_exec(&fi); of 171 core/ngx_open_file_cache.c rc = ngx_open_and_stat_file(name->data, of, pool->log); of 173 core/ngx_open_file_cache.c if (rc == NGX_OK && !of->is_dir) { of 177 core/ngx_open_file_cache.c clnf->fd = of->fd; of 206 core/ngx_open_file_cache.c rc = ngx_open_and_stat_file(name->data, of, pool->log); of 208 core/ngx_open_file_cache.c if (rc != NGX_OK && (of->err == 0 || !of->errors)) { of 217 core/ngx_open_file_cache.c && (of->uniq == 0 || of->uniq == file->uniq) of 218 core/ngx_open_file_cache.c && now - file->created < of->valid)) of 222 core/ngx_open_file_cache.c of->fd = file->fd; of 223 core/ngx_open_file_cache.c of->uniq = file->uniq; of 224 core/ngx_open_file_cache.c of->mtime = file->mtime; of 225 core/ngx_open_file_cache.c of->size = file->size; of 227 core/ngx_open_file_cache.c of->is_dir = file->is_dir; of 228 core/ngx_open_file_cache.c of->is_file = file->is_file; of 229 core/ngx_open_file_cache.c of->is_link = file->is_link; of 230 core/ngx_open_file_cache.c of->is_exec = file->is_exec; of 231 core/ngx_open_file_cache.c of->is_directio = file->is_directio; of 235 core/ngx_open_file_cache.c ngx_open_file_add_event(cache, file, of, pool->log); of 239 core/ngx_open_file_cache.c of->err = file->err; of 240 core/ngx_open_file_cache.c of->failed = ngx_open_file_n; of 258 core/ngx_open_file_cache.c of->test_dir = 1; of 261 core/ngx_open_file_cache.c of->fd = file->fd; of 262 core/ngx_open_file_cache.c of->uniq = file->uniq; of 264 core/ngx_open_file_cache.c rc = ngx_open_and_stat_file(name->data, of, pool->log); of 266 core/ngx_open_file_cache.c if (rc != NGX_OK && (of->err == 0 || !of->errors)) { of 270 core/ngx_open_file_cache.c if (of->is_dir) { of 278 core/ngx_open_file_cache.c } else if (of->err == 0) { /* file */ of 284 core/ngx_open_file_cache.c if (of->uniq == file->uniq) { of 330 core/ngx_open_file_cache.c rc = ngx_open_and_stat_file(name->data, of, pool->log); of 332 core/ngx_open_file_cache.c if (rc != NGX_OK && (of->err == 0 || !of->errors)) { of 371 core/ngx_open_file_cache.c ngx_open_file_add_event(cache, file, of, pool->log); of 375 core/ngx_open_file_cache.c file->fd = of->fd; of 376 core/ngx_open_file_cache.c file->err = of->err; of 378 core/ngx_open_file_cache.c if (of->err == 0) { of 379 core/ngx_open_file_cache.c file->uniq = of->uniq; of 380 core/ngx_open_file_cache.c file->mtime = of->mtime; of 381 core/ngx_open_file_cache.c file->size = of->size; of 385 core/ngx_open_file_cache.c file->is_dir = of->is_dir; of 386 core/ngx_open_file_cache.c file->is_file = of->is_file; of 387 core/ngx_open_file_cache.c file->is_link = of->is_link; of 388 core/ngx_open_file_cache.c file->is_exec = of->is_exec; of 389 core/ngx_open_file_cache.c file->is_directio = of->is_directio; of 391 core/ngx_open_file_cache.c if (!of->is_dir) { of 410 core/ngx_open_file_cache.c if (of->err == 0) { of 412 core/ngx_open_file_cache.c if (!of->is_dir) { of 418 core/ngx_open_file_cache.c ofcln->min_uses = of->min_uses; of 452 core/ngx_open_file_cache.c if (of->fd != NGX_INVALID_FILE) { of 453 core/ngx_open_file_cache.c if (ngx_close_file(of->fd) == NGX_FILE_ERROR) { of 464 core/ngx_open_file_cache.c ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log) of 469 core/ngx_open_file_cache.c if (of->fd != NGX_INVALID_FILE) { of 472 core/ngx_open_file_cache.c of->failed = ngx_file_info_n; of 476 core/ngx_open_file_cache.c if (of->uniq == ngx_file_uniq(&fi)) { of 480 core/ngx_open_file_cache.c } else if (of->test_dir) { of 483 core/ngx_open_file_cache.c of->failed = ngx_file_info_n; of 492 core/ngx_open_file_cache.c if (!of->log) { of 508 core/ngx_open_file_cache.c of->failed = ngx_open_file_n; of 521 core/ngx_open_file_cache.c of->fd = NGX_INVALID_FILE; of 532 core/ngx_open_file_cache.c of->fd = NGX_INVALID_FILE; of 535 core/ngx_open_file_cache.c of->fd = fd; of 537 core/ngx_open_file_cache.c if (of->read_ahead && ngx_file_size(&fi) > NGX_MIN_READ_AHEAD) { of 538 core/ngx_open_file_cache.c if (ngx_read_ahead(fd, of->read_ahead) == NGX_ERROR) { of 544 core/ngx_open_file_cache.c if (of->directio <= ngx_file_size(&fi)) { of 550 core/ngx_open_file_cache.c of->is_directio = 1; of 557 core/ngx_open_file_cache.c of->uniq = ngx_file_uniq(&fi); of 558 core/ngx_open_file_cache.c of->mtime = ngx_file_mtime(&fi); of 559 core/ngx_open_file_cache.c of->size = ngx_file_size(&fi); of 560 core/ngx_open_file_cache.c of->is_dir = ngx_is_dir(&fi); of 561 core/ngx_open_file_cache.c of->is_file = ngx_is_file(&fi); of 562 core/ngx_open_file_cache.c of->is_link = ngx_is_link(&fi); of 563 core/ngx_open_file_cache.c of->is_exec = ngx_is_exec(&fi); of 569 core/ngx_open_file_cache.c of->fd = NGX_INVALID_FILE; of 570 core/ngx_open_file_cache.c of->err = ngx_errno; of 583 core/ngx_open_file_cache.c ngx_cached_open_file_t *file, ngx_open_file_info_t *of, ngx_log_t *log) of 588 core/ngx_open_file_cache.c || !of->events of 590 core/ngx_open_file_cache.c || of->fd == NGX_INVALID_FILE of 591 core/ngx_open_file_cache.c || file->uses < of->min_uses) of 610 core/ngx_open_file_cache.c fev->fd = of->fd; of 114 core/ngx_open_file_cache.h ngx_open_file_info_t *of, ngx_pool_t *pool); of 72 http/modules/ngx_http_flv_module.c ngx_open_file_info_t of; of 103 http/modules/ngx_http_flv_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 105 http/modules/ngx_http_flv_module.c of.read_ahead = clcf->read_ahead; of 106 http/modules/ngx_http_flv_module.c of.directio = clcf->directio; of 107 http/modules/ngx_http_flv_module.c of.valid = clcf->open_file_cache_valid; of 108 http/modules/ngx_http_flv_module.c of.min_uses = clcf->open_file_cache_min_uses; of 109 http/modules/ngx_http_flv_module.c of.errors = clcf->open_file_cache_errors; of 110 http/modules/ngx_http_flv_module.c of.events = clcf->open_file_cache_events; of 112 http/modules/ngx_http_flv_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 115 http/modules/ngx_http_flv_module.c switch (of.err) { of 142 http/modules/ngx_http_flv_module.c ngx_log_error(level, log, of.err, of 143 http/modules/ngx_http_flv_module.c "%s \"%s\" failed", of.failed, path.data); of 149 http/modules/ngx_http_flv_module.c if (!of.is_file) { of 151 http/modules/ngx_http_flv_module.c if (ngx_close_file(of.fd) == NGX_FILE_ERROR) { of 162 http/modules/ngx_http_flv_module.c len = of.size; of 186 http/modules/ngx_http_flv_module.c r->headers_out.last_modified_time = of.mtime; of 226 http/modules/ngx_http_flv_module.c b->file_last = of.size; of 232 http/modules/ngx_http_flv_module.c b->file->fd = of.fd; of 235 http/modules/ngx_http_flv_module.c b->file->directio = of.is_directio; of 80 http/modules/ngx_http_gzip_static_module.c ngx_open_file_info_t of; of 123 http/modules/ngx_http_gzip_static_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 125 http/modules/ngx_http_gzip_static_module.c of.read_ahead = clcf->read_ahead; of 126 http/modules/ngx_http_gzip_static_module.c of.directio = clcf->directio; of 127 http/modules/ngx_http_gzip_static_module.c of.valid = clcf->open_file_cache_valid; of 128 http/modules/ngx_http_gzip_static_module.c of.min_uses = clcf->open_file_cache_min_uses; of 129 http/modules/ngx_http_gzip_static_module.c of.errors = clcf->open_file_cache_errors; of 130 http/modules/ngx_http_gzip_static_module.c of.events = clcf->open_file_cache_events; of 132 http/modules/ngx_http_gzip_static_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 135 http/modules/ngx_http_gzip_static_module.c switch (of.err) { of 157 http/modules/ngx_http_gzip_static_module.c ngx_log_error(level, log, of.err, of 158 http/modules/ngx_http_gzip_static_module.c "%s \"%s\" failed", of.failed, path.data); of 169 http/modules/ngx_http_gzip_static_module.c ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd); of 171 http/modules/ngx_http_gzip_static_module.c if (of.is_dir) { of 178 http/modules/ngx_http_gzip_static_module.c if (!of.is_file) { of 198 http/modules/ngx_http_gzip_static_module.c r->headers_out.content_length_n = of.size; of 199 http/modules/ngx_http_gzip_static_module.c r->headers_out.last_modified_time = of.mtime; of 236 http/modules/ngx_http_gzip_static_module.c b->file_last = of.size; of 242 http/modules/ngx_http_gzip_static_module.c b->file->fd = of.fd; of 245 http/modules/ngx_http_gzip_static_module.c b->file->directio = of.is_directio; of 104 http/modules/ngx_http_index_module.c ngx_open_file_info_t of; of 202 http/modules/ngx_http_index_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 204 http/modules/ngx_http_index_module.c of.read_ahead = clcf->read_ahead; of 205 http/modules/ngx_http_index_module.c of.directio = clcf->directio; of 206 http/modules/ngx_http_index_module.c of.valid = clcf->open_file_cache_valid; of 207 http/modules/ngx_http_index_module.c of.min_uses = clcf->open_file_cache_min_uses; of 208 http/modules/ngx_http_index_module.c of.test_only = 1; of 209 http/modules/ngx_http_index_module.c of.errors = clcf->open_file_cache_errors; of 210 http/modules/ngx_http_index_module.c of.events = clcf->open_file_cache_events; of 212 http/modules/ngx_http_index_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 215 http/modules/ngx_http_index_module.c ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err, of 216 http/modules/ngx_http_index_module.c "%s \"%s\" failed", of.failed, path.data); of 218 http/modules/ngx_http_index_module.c if (of.err == 0) { of 222 http/modules/ngx_http_index_module.c if (of.err == NGX_ENOTDIR of 223 http/modules/ngx_http_index_module.c || of.err == NGX_ENAMETOOLONG of 224 http/modules/ngx_http_index_module.c || of.err == NGX_EACCES) of 226 http/modules/ngx_http_index_module.c return ngx_http_index_error(r, clcf, path.data, of.err); of 239 http/modules/ngx_http_index_module.c if (of.err == NGX_ENOENT) { of 243 http/modules/ngx_http_index_module.c ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, of 244 http/modules/ngx_http_index_module.c "%s \"%s\" failed", of.failed, path.data); of 277 http/modules/ngx_http_index_module.c ngx_open_file_info_t of; of 292 http/modules/ngx_http_index_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 294 http/modules/ngx_http_index_module.c of.test_dir = 1; of 295 http/modules/ngx_http_index_module.c of.test_only = 1; of 296 http/modules/ngx_http_index_module.c of.valid = clcf->open_file_cache_valid; of 297 http/modules/ngx_http_index_module.c of.errors = clcf->open_file_cache_errors; of 299 http/modules/ngx_http_index_module.c if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool) of 302 http/modules/ngx_http_index_module.c if (of.err) { of 304 http/modules/ngx_http_index_module.c if (of.err == NGX_ENOENT) { of 309 http/modules/ngx_http_index_module.c if (of.err == NGX_EACCES) { of 322 http/modules/ngx_http_index_module.c ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, of 323 http/modules/ngx_http_index_module.c "%s \"%s\" failed", of.failed, dir.data); of 331 http/modules/ngx_http_index_module.c if (of.is_dir) { of 371 http/modules/ngx_http_log_module.c ngx_open_file_info_t of; of 388 http/modules/ngx_http_log_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 390 http/modules/ngx_http_log_module.c of.valid = clcf->open_file_cache_valid; of 391 http/modules/ngx_http_log_module.c of.min_uses = clcf->open_file_cache_min_uses; of 392 http/modules/ngx_http_log_module.c of.test_dir = 1; of 393 http/modules/ngx_http_log_module.c of.test_only = 1; of 394 http/modules/ngx_http_log_module.c of.errors = clcf->open_file_cache_errors; of 395 http/modules/ngx_http_log_module.c of.events = clcf->open_file_cache_events; of 397 http/modules/ngx_http_log_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 400 http/modules/ngx_http_log_module.c if (of.err == 0) { of 405 http/modules/ngx_http_log_module.c ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, of 412 http/modules/ngx_http_log_module.c if (!of.is_dir) { of 437 http/modules/ngx_http_log_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 439 http/modules/ngx_http_log_module.c of.log = 1; of 440 http/modules/ngx_http_log_module.c of.valid = llcf->open_file_cache_valid; of 441 http/modules/ngx_http_log_module.c of.min_uses = llcf->open_file_cache_min_uses; of 442 http/modules/ngx_http_log_module.c of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; of 444 http/modules/ngx_http_log_module.c if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) of 448 http/modules/ngx_http_log_module.c "%s \"%s\" failed", of.failed, log.data); of 454 http/modules/ngx_http_log_module.c "http log #%d", of.fd); of 456 http/modules/ngx_http_log_module.c n = ngx_write_fd(of.fd, buf, len); of 58 http/modules/ngx_http_static_module.c ngx_open_file_info_t of; of 88 http/modules/ngx_http_static_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 90 http/modules/ngx_http_static_module.c of.read_ahead = clcf->read_ahead; of 91 http/modules/ngx_http_static_module.c of.directio = clcf->directio; of 92 http/modules/ngx_http_static_module.c of.valid = clcf->open_file_cache_valid; of 93 http/modules/ngx_http_static_module.c of.min_uses = clcf->open_file_cache_min_uses; of 94 http/modules/ngx_http_static_module.c of.errors = clcf->open_file_cache_errors; of 95 http/modules/ngx_http_static_module.c of.events = clcf->open_file_cache_events; of 97 http/modules/ngx_http_static_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 100 http/modules/ngx_http_static_module.c switch (of.err) { of 127 http/modules/ngx_http_static_module.c ngx_log_error(level, log, of.err, of 128 http/modules/ngx_http_static_module.c "%s \"%s\" failed", of.failed, path.data); of 136 http/modules/ngx_http_static_module.c ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd); of 138 http/modules/ngx_http_static_module.c if (of.is_dir) { of 187 http/modules/ngx_http_static_module.c if (!of.is_file) { of 209 http/modules/ngx_http_static_module.c r->headers_out.content_length_n = of.size; of 210 http/modules/ngx_http_static_module.c r->headers_out.last_modified_time = of.mtime; of 216 http/modules/ngx_http_static_module.c if (r != r->main && of.size == 0) { of 241 http/modules/ngx_http_static_module.c b->file_last = of.size; of 247 http/modules/ngx_http_static_module.c b->file->fd = of.fd; of 250 http/modules/ngx_http_static_module.c b->file->directio = of.is_directio; of 1143 http/ngx_http_core_module.c ngx_open_file_info_t of; of 1264 http/ngx_http_core_module.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 1266 http/ngx_http_core_module.c of.directio = clcf->directio; of 1267 http/ngx_http_core_module.c of.valid = clcf->open_file_cache_valid; of 1268 http/ngx_http_core_module.c of.min_uses = clcf->open_file_cache_min_uses; of 1269 http/ngx_http_core_module.c of.test_only = 1; of 1270 http/ngx_http_core_module.c of.errors = clcf->open_file_cache_errors; of 1271 http/ngx_http_core_module.c of.events = clcf->open_file_cache_events; of 1273 http/ngx_http_core_module.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 1276 http/ngx_http_core_module.c if (of.err != NGX_ENOENT of 1277 http/ngx_http_core_module.c && of.err != NGX_ENOTDIR of 1278 http/ngx_http_core_module.c && of.err != NGX_ENAMETOOLONG) of 1280 http/ngx_http_core_module.c ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, of 1281 http/ngx_http_core_module.c "%s \"%s\" failed", of.failed, path.data); of 1287 http/ngx_http_core_module.c if (of.is_dir && !test_dir) { of 244 http/ngx_http_file_cache.c ngx_open_file_info_t of; of 317 http/ngx_http_file_cache.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 319 http/ngx_http_file_cache.c of.uniq = c->uniq; of 320 http/ngx_http_file_cache.c of.valid = clcf->open_file_cache_valid; of 321 http/ngx_http_file_cache.c of.min_uses = clcf->open_file_cache_min_uses; of 322 http/ngx_http_file_cache.c of.events = clcf->open_file_cache_events; of 323 http/ngx_http_file_cache.c of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; of 324 http/ngx_http_file_cache.c of.read_ahead = clcf->read_ahead; of 326 http/ngx_http_file_cache.c if (ngx_open_cached_file(clcf->open_file_cache, &c->file.name, &of, r->pool) of 329 http/ngx_http_file_cache.c switch (of.err) { of 339 http/ngx_http_file_cache.c ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, of 346 http/ngx_http_file_cache.c "http file cache fd: %d", of.fd); of 348 http/ngx_http_file_cache.c c->file.fd = of.fd; of 350 http/ngx_http_file_cache.c c->uniq = of.uniq; of 351 http/ngx_http_file_cache.c c->length = of.size; of 1476 http/ngx_http_script.c ngx_open_file_info_t of; of 1496 http/ngx_http_script.c ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of 1498 http/ngx_http_script.c of.read_ahead = clcf->read_ahead; of 1499 http/ngx_http_script.c of.directio = clcf->directio; of 1500 http/ngx_http_script.c of.valid = clcf->open_file_cache_valid; of 1501 http/ngx_http_script.c of.min_uses = clcf->open_file_cache_min_uses; of 1502 http/ngx_http_script.c of.test_only = 1; of 1503 http/ngx_http_script.c of.errors = clcf->open_file_cache_errors; of 1504 http/ngx_http_script.c of.events = clcf->open_file_cache_events; of 1506 http/ngx_http_script.c if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) of 1509 http/ngx_http_script.c if (of.err != NGX_ENOENT of 1510 http/ngx_http_script.c && of.err != NGX_ENOTDIR of 1511 http/ngx_http_script.c && of.err != NGX_ENAMETOOLONG) of 1513 http/ngx_http_script.c ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, of 1514 http/ngx_http_script.c "%s \"%s\" failed", of.failed, value->data); of 1537 http/ngx_http_script.c if (of.is_file) { of 1543 http/ngx_http_script.c if (of.is_file) { of 1549 http/ngx_http_script.c if (of.is_dir) { of 1555 http/ngx_http_script.c if (of.is_dir) { of 1561 http/ngx_http_script.c if (of.is_file || of.is_dir || of.is_link) { of 1567 http/ngx_http_script.c if (of.is_file || of.is_dir || of.is_link) { of 1573 http/ngx_http_script.c if (of.is_exec) { of 1579 http/ngx_http_script.c if (of.is_exec) {