mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Linux O_NOATIME support
This commit is contained in:
parent
acdb80aed4
commit
dc1e3060eb
@ -239,7 +239,8 @@ ngx_http_index_handler(ngx_http_request_t *r)
|
|||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = ngx_open_file(ctx->path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN);
|
fd = ngx_open_file(ctx->path.data, NGX_FILE_RDONLY|NGX_FILE_NOATIME,
|
||||||
|
NGX_FILE_OPEN);
|
||||||
|
|
||||||
if (fd == (ngx_fd_t) NGX_AGAIN) {
|
if (fd == (ngx_fd_t) NGX_AGAIN) {
|
||||||
ctx->current = i;
|
ctx->current = i;
|
||||||
|
@ -125,7 +125,8 @@ ngx_http_static_handler(ngx_http_request_t *r)
|
|||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = ngx_open_file(path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN);
|
fd = ngx_open_file(path.data, NGX_FILE_RDONLY|NGX_FILE_NOATIME,
|
||||||
|
NGX_FILE_OPEN);
|
||||||
|
|
||||||
if (fd == NGX_INVALID_FILE) {
|
if (fd == NGX_INVALID_FILE) {
|
||||||
err = ngx_errno;
|
err = ngx_errno;
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
#define NGX_FILE_TRUNCATE O_TRUNC
|
#define NGX_FILE_TRUNCATE O_TRUNC
|
||||||
#define NGX_FILE_APPEND O_APPEND
|
#define NGX_FILE_APPEND O_APPEND
|
||||||
|
|
||||||
|
#ifdef O_NOATIME
|
||||||
|
#define NGX_FILE_NOATIME O_NOATIME
|
||||||
|
#else
|
||||||
|
#define NGX_FILE_NOATIME 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ngx_close_file close
|
#define ngx_close_file close
|
||||||
#define ngx_close_file_n "close()"
|
#define ngx_close_file_n "close()"
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS
|
#define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS
|
||||||
#define NGX_FILE_OPEN OPEN_EXISTING
|
#define NGX_FILE_OPEN OPEN_EXISTING
|
||||||
#define NGX_FILE_APPEND 0
|
#define NGX_FILE_APPEND 0
|
||||||
|
#define NGX_FILE_NOATIME 0
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t ngx_file_append_mode(ngx_fd_t fd);
|
ngx_int_t ngx_file_append_mode(ngx_fd_t fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user