Whamcloud - gitweb
Branch b1_4_mountconf
[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 #ifdef LPROCFS
9 extern void ost_print_req(void *seq_file, struct ptlrpc_request *req);
10 #else
11 # define ost_print_req NULL
12 #endif
13
14 /*
15  * tunables for per-thread page pool (bug 5137)
16  */
17 enum {
18         /*
19          * pool size in pages
20          */
21         OST_THREAD_POOL_SIZE = PTLRPC_MAX_BRW_PAGES,
22         /*
23          * GFP mask used to allocate pages for pool
24          */
25         OST_THREAD_POOL_GFP  = GFP_HIGHUSER
26 };
27
28 struct page;
29 struct niobuf_local;
30 struct niobuf_remote;
31 struct ptlrpc_request;
32
33 /*
34  * struct ost_thread_local_cache is allocated and initialized for each OST
35  * thread by ost_thread_init().
36  */
37 struct ost_thread_local_cache {
38         /*
39          * pool of pages and nio buffers used by write-path
40          */
41         struct page          *page  [OST_THREAD_POOL_SIZE];
42         struct niobuf_local   local [OST_THREAD_POOL_SIZE];
43         struct niobuf_remote  remote[OST_THREAD_POOL_SIZE];
44 };
45
46 struct ost_thread_local_cache *ost_tls(struct ptlrpc_request *r);
47
48 #ifdef HAVE_QUOTA_SUPPORT
49 /* Quota stuff */
50 int ost_quotacheck(struct ptlrpc_request *req);
51 int ost_quotactl(struct ptlrpc_request *req);
52 #else
53 static inline int ost_quotacheck(struct ptlrpc_request *req)
54 {
55         req->rq_status = -ENOTSUPP;
56         return -ENOTSUPP;
57 }
58 static inline int ost_quotactl(struct ptlrpc_request *req)
59 {
60         req->rq_status = -ENOTSUPP;
61         return -ENOTSUPP;
62 }
63 #endif
64
65 #endif /* OST_INTERNAL_H */