fm 1319 http/modules/ngx_http_geo_module.c ngx_file_mapping_t fm; fm 1324 http/modules/ngx_http_geo_module.c fm.name = ngx_pnalloc(ctx->temp_pool, ctx->include_name.len + 5); fm 1325 http/modules/ngx_http_geo_module.c if (fm.name == NULL) { fm 1329 http/modules/ngx_http_geo_module.c ngx_sprintf(fm.name, "%V.bin%Z", &ctx->include_name); fm 1331 http/modules/ngx_http_geo_module.c fm.size = ctx->data_size; fm 1332 http/modules/ngx_http_geo_module.c fm.log = ctx->pool->log; fm 1334 http/modules/ngx_http_geo_module.c ngx_log_error(NGX_LOG_NOTICE, fm.log, 0, fm 1335 http/modules/ngx_http_geo_module.c "creating binary geo range base \"%s\"", fm.name); fm 1337 http/modules/ngx_http_geo_module.c if (ngx_create_file_mapping(&fm) != NGX_OK) { fm 1341 http/modules/ngx_http_geo_module.c p = ngx_cpymem(fm.addr, &ngx_http_geo_header, fm 1344 http/modules/ngx_http_geo_module.c p = ngx_http_geo_copy_values(fm.addr, p, ctx->rbtree.root, fm 1360 http/modules/ngx_http_geo_module.c ranges[i] = (ngx_http_geo_range_t *) (p - (u_char *) fm.addr); fm 1381 http/modules/ngx_http_geo_module.c header = fm.addr; fm 1382 http/modules/ngx_http_geo_module.c header->crc32 = ngx_crc32_long((u_char *) fm.addr fm 1384 http/modules/ngx_http_geo_module.c fm.size - sizeof(ngx_http_geo_header_t)); fm 1386 http/modules/ngx_http_geo_module.c ngx_close_file_mapping(&fm); fm 262 os/unix/ngx_files.c ngx_create_file_mapping(ngx_file_mapping_t *fm) fm 264 os/unix/ngx_files.c fm->fd = ngx_open_file(fm->name, NGX_FILE_RDWR, NGX_FILE_TRUNCATE, fm 266 os/unix/ngx_files.c if (fm->fd == NGX_INVALID_FILE) { fm 267 os/unix/ngx_files.c ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno, fm 268 os/unix/ngx_files.c ngx_open_file_n " \"%s\" failed", fm->name); fm 272 os/unix/ngx_files.c if (ftruncate(fm->fd, fm->size) == -1) { fm 273 os/unix/ngx_files.c ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno, fm 274 os/unix/ngx_files.c "ftruncate() \"%s\" failed", fm->name); fm 278 os/unix/ngx_files.c fm->addr = mmap(NULL, fm->size, PROT_READ|PROT_WRITE, MAP_SHARED, fm 279 os/unix/ngx_files.c fm->fd, 0); fm 280 os/unix/ngx_files.c if (fm->addr != MAP_FAILED) { fm 284 os/unix/ngx_files.c ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno, fm 285 os/unix/ngx_files.c "mmap(%uz) \"%s\" failed", fm->size, fm->name); fm 289 os/unix/ngx_files.c if (ngx_close_file(fm->fd) == NGX_FILE_ERROR) { fm 290 os/unix/ngx_files.c ngx_log_error(NGX_LOG_ALERT, fm->log, ngx_errno, fm 291 os/unix/ngx_files.c ngx_close_file_n " \"%s\" failed", fm->name); fm 299 os/unix/ngx_files.c ngx_close_file_mapping(ngx_file_mapping_t *fm) fm 301 os/unix/ngx_files.c if (munmap(fm->addr, fm->size) == -1) { fm 302 os/unix/ngx_files.c ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno, fm 303 os/unix/ngx_files.c "munmap(%uz) \"%s\" failed", fm->size, fm->name); fm 306 os/unix/ngx_files.c if (ngx_close_file(fm->fd) == NGX_FILE_ERROR) { fm 307 os/unix/ngx_files.c ngx_log_error(NGX_LOG_ALERT, fm->log, ngx_errno, fm 308 os/unix/ngx_files.c ngx_close_file_n " \"%s\" failed", fm->name); fm 164 os/unix/ngx_files.h ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm); fm 165 os/unix/ngx_files.h void ngx_close_file_mapping(ngx_file_mapping_t *fm);