forked from alibaba/nginx-tfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngx_http_tfs_local_block_cache.h
40 lines (27 loc) · 1.54 KB
/
ngx_http_tfs_local_block_cache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (C) 2010-2013 Alibaba Group Holding Limited
*/
#ifndef _NGX_HTTP_TFS_LOCAL_BLOCK_CACHE_H_INCLUDED_
#define _NGX_HTTP_TFS_LOCAL_BLOCK_CACHE_H_INCLUDED_
#include <ngx_http_tfs_block_cache.h>
typedef struct {
u_char color;
u_char dummy;
ngx_queue_t queue;
ngx_http_tfs_block_cache_key_t key;
u_char len;
u_short count;
u_char data[1];
} ngx_http_tfs_block_cache_node_t;
ngx_int_t ngx_http_tfs_local_block_cache_init_zone(ngx_shm_zone_t *shm_zone, void *data);
ngx_int_t ngx_http_tfs_local_block_cache_lookup(ngx_http_tfs_local_block_cache_ctx_t *ctx,
ngx_pool_t *pool, ngx_log_t *log,
ngx_http_tfs_block_cache_key_t *key, ngx_http_tfs_block_cache_value_t *value);
ngx_int_t ngx_http_tfs_local_block_cache_insert(ngx_http_tfs_local_block_cache_ctx_t *ctx,
ngx_log_t *log, ngx_http_tfs_block_cache_key_t *key, ngx_http_tfs_block_cache_value_t *value);
void ngx_http_tfs_local_block_cache_remove(ngx_http_tfs_local_block_cache_ctx_t *ctx,
ngx_log_t *log, ngx_http_tfs_block_cache_key_t *key);
void ngx_http_tfs_local_block_cache_discard(ngx_http_tfs_local_block_cache_ctx_t *ctx);
ngx_int_t ngx_http_tfs_local_block_cache_batch_lookup(ngx_http_tfs_local_block_cache_ctx_t *ctx,
ngx_pool_t *pool, ngx_log_t *log, ngx_array_t *keys, ngx_array_t *kvs);
#endif /* _NGX_HTTP_TFS_LOCAL_BLOCK_CACHE_H_INCLUDED_ */