Whamcloud - gitweb
branch: HEAD
[fs/lustre-release.git] / lustre / ost / ost_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef OST_INTERNAL_H
6 #define OST_INTERNAL_H
7
8 #define OSS_SERVICE_WATCHDOG_FACTOR 2000
9
10 /*
11  * tunables for per-thread page pool (bug 5137)
12  */
13 #define OST_THREAD_POOL_SIZE PTLRPC_MAX_BRW_PAGES  /* pool size in pages */
14 #define OST_THREAD_POOL_GFP  CFS_ALLOC_HIGHUSER    /* GFP mask for pool pages */
15
16 struct page;
17 struct niobuf_local;
18 struct niobuf_remote;
19 struct ptlrpc_request;
20
21 /*
22  * struct ost_thread_local_cache is allocated and initialized for each OST
23  * thread by ost_thread_init().
24  */
25 struct ost_thread_local_cache {
26         /*
27          * pool of pages and nio buffers used by write-path
28          */
29         struct page          *page  [OST_THREAD_POOL_SIZE];
30         struct niobuf_local   local [OST_THREAD_POOL_SIZE];
31         struct niobuf_remote  remote[OST_THREAD_POOL_SIZE];
32 };
33
34 struct ost_thread_local_cache *ost_tls(struct ptlrpc_request *r);
35
36 #define OSS_MIN_CREATE_THREADS  2UL
37 #define OSS_MAX_CREATE_THREADS 16UL
38
39 /* Quota stuff */
40 extern quota_interface_t *quota_interface;
41
42 #ifdef LPROCFS
43 void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars);
44 #else
45 static void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars)
46 {
47         memset(lvars, 0, sizeof(*lvars));
48 }
49 #endif
50
51 #endif /* OST_INTERNAL_H */