Whamcloud - gitweb
fix LBUG in ptlrpc_check_set() "bad phase ebc0de00"
[fs/lustre-release.git] / lustre / include / lustre_net.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2002, 2003 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  */
22
23 #ifndef _LUSTRE_NET_H
24 #define _LUSTRE_NET_H
25
26 #if defined(__linux__)
27 #include <linux/lustre_net.h>
28 #elif defined(__APPLE__)
29 #include <darwin/lustre_net.h>
30 #elif defined(__WINNT__)
31 #include <winnt/lustre_net.h>
32 #else
33 #error Unsupported operating system.
34 #endif
35
36 #include <libcfs/kp30.h>
37 // #include <obd.h>
38 #include <lnet/lnet.h>
39 #include <lustre/lustre_idl.h>
40 #include <lustre_ha.h>
41 #include <lustre_sec.h>
42 #include <lustre_import.h>
43 #include <lprocfs_status.h>
44 #include <lu_object.h>
45
46 /* MD flags we _always_ use */
47 #define PTLRPC_MD_OPTIONS  0
48
49 /* Define maxima for bulk I/O
50  * CAVEAT EMPTOR, with multinet (i.e. routers forwarding between networks)
51  * these limits are system wide and not interface-local. */
52 #define PTLRPC_MAX_BRW_BITS     LNET_MTU_BITS
53 #define PTLRPC_MAX_BRW_SIZE     (1<<LNET_MTU_BITS)
54 #define PTLRPC_MAX_BRW_PAGES    (PTLRPC_MAX_BRW_SIZE >> CFS_PAGE_SHIFT)
55
56 /* When PAGE_SIZE is a constant, we can check our arithmetic here with cpp! */
57 #ifdef __KERNEL__
58 # if ((PTLRPC_MAX_BRW_PAGES & (PTLRPC_MAX_BRW_PAGES - 1)) != 0)
59 #  error "PTLRPC_MAX_BRW_PAGES isn't a power of two"
60 # endif
61 # if (PTLRPC_MAX_BRW_SIZE != (PTLRPC_MAX_BRW_PAGES * CFS_PAGE_SIZE))
62 #  error "PTLRPC_MAX_BRW_SIZE isn't PTLRPC_MAX_BRW_PAGES * CFS_PAGE_SIZE"
63 # endif
64 # if (PTLRPC_MAX_BRW_SIZE > LNET_MTU)
65 #  error "PTLRPC_MAX_BRW_SIZE too big"
66 # endif
67 # if (PTLRPC_MAX_BRW_PAGES > LNET_MAX_IOV)
68 #  error "PTLRPC_MAX_BRW_PAGES too big"
69 # endif
70 #endif /* __KERNEL__ */
71
72 /* Size over which to OBD_VMALLOC() rather than OBD_ALLOC() service request
73  * buffers */
74 #define SVC_BUF_VMALLOC_THRESHOLD (2 * CFS_PAGE_SIZE)
75
76 /* The following constants determine how memory is used to buffer incoming
77  * service requests.
78  *
79  * ?_NBUFS              # buffers to allocate when growing the pool
80  * ?_BUFSIZE            # bytes in a single request buffer
81  * ?_MAXREQSIZE         # maximum request service will receive
82  *
83  * When fewer than ?_NBUFS/2 buffers are posted for receive, another chunk
84  * of ?_NBUFS is added to the pool.
85  *
86  * Messages larger than ?_MAXREQSIZE are dropped.  Request buffers are
87  * considered full when less than ?_MAXREQSIZE is left in them.
88  */
89
90 #define LDLM_THREADS_AUTO_MIN                                                 \
91         min((int)(num_online_cpus() * num_online_cpus() * 2), 8)
92 #define LDLM_THREADS_AUTO_MAX (LDLM_THREADS_AUTO_MIN * 16)
93 #define LDLM_BL_THREADS  LDLM_THREADS_AUTO_MIN
94 #define LDLM_NBUFS      (64 * num_online_cpus())
95 #define LDLM_BUFSIZE    (8 * 1024)
96 #define LDLM_MAXREQSIZE (5 * 1024)
97 #define LDLM_MAXREPSIZE (1024)
98
99 #define MDT_MIN_THREADS 2UL
100 #define MDT_MAX_THREADS 512UL
101 #define MDT_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
102                                   num_physpages >> (25 - PAGE_SHIFT)), 2UL)
103 #define FLD_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
104                                   num_physpages >> (25 - PAGE_SHIFT)), 2UL)
105 #define SEQ_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
106                                   num_physpages >> (25 - PAGE_SHIFT)), 2UL)
107
108 /* Absolute limits */
109 #define MDS_THREADS_MIN 2
110 #define MDS_THREADS_MAX 512
111 #define MDS_THREADS_MIN_READPAGE 2
112 #define MDS_NBUFS       (64 * num_online_cpus())
113 #define MDS_BUFSIZE     (8 * 1024)
114 /* Assume file name length = FNAME_MAX = 256 (true for ext3).
115  *        path name length = PATH_MAX = 4096
116  *        LOV MD size max  = EA_MAX = 4000
117  * symlink:  FNAME_MAX + PATH_MAX  <- largest
118  * link:     FNAME_MAX + PATH_MAX  (mds_rec_link < mds_rec_create)
119  * rename:   FNAME_MAX + FNAME_MAX
120  * open:     FNAME_MAX + EA_MAX
121  *
122  * MDS_MAXREQSIZE ~= 4736 bytes =
123  * lustre_msg + ldlm_request + mds_body + mds_rec_create + FNAME_MAX + PATH_MAX
124  * MDS_MAXREPSIZE ~= 8300 bytes = lustre_msg + llog_header
125  * or, for mds_close() and mds_reint_unlink() on a many-OST filesystem:
126  *      = 9210 bytes = lustre_msg + mds_body + 160 * (easize + cookiesize)
127  *
128  * Realistic size is about 512 bytes (20 character name + 128 char symlink),
129  * except in the open case where there are a large number of OSTs in a LOV.
130  */
131 #define MDS_MAXREQSIZE  (5 * 1024)
132 #define MDS_MAXREPSIZE  max(9 * 1024, 280 + LOV_MAX_STRIPE_COUNT * 56)
133
134 /* FLD_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + md_fld */
135 #define FLD_MAXREQSIZE  (160)
136
137 /* FLD_MAXREPSIZE == lustre_msg + ptlrpc_body + md_fld */
138 #define FLD_MAXREPSIZE  (152)
139
140 /* SEQ_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + lu_range +
141  * __u32 padding */
142 #define SEQ_MAXREQSIZE  (160)
143
144 /* SEQ_MAXREPSIZE == lustre_msg + ptlrpc_body + lu_range */
145 #define SEQ_MAXREPSIZE  (152)
146
147 #define MGS_THREADS_AUTO_MIN 2
148 #define MGS_THREADS_AUTO_MAX 32
149 #define MGS_NBUFS       (64 * num_online_cpus())
150 #define MGS_BUFSIZE     (8 * 1024)
151 #define MGS_MAXREQSIZE  (7 * 1024)
152 #define MGS_MAXREPSIZE  (9 * 1024)
153
154 /* Absolute limits */
155 #define OSS_THREADS_MIN 2
156 #define OSS_THREADS_MAX 512
157 #define OST_NBUFS       (64 * num_online_cpus())
158 #define OST_BUFSIZE     (8 * 1024)
159 /* OST_MAXREQSIZE ~= 4768 bytes =
160  * lustre_msg + obdo + 16 * obd_ioobj + 256 * niobuf_remote
161  *
162  * - single object with 16 pages is 512 bytes
163  * - OST_MAXREQSIZE must be at least 1 page of cookies plus some spillover
164  */
165 #define OST_MAXREQSIZE  (5 * 1024)
166 #define OST_MAXREPSIZE  (9 * 1024)
167
168 struct ptlrpc_connection {
169         struct list_head        c_link;
170         struct hlist_node       c_hash;
171         lnet_nid_t              c_self;
172         lnet_process_id_t       c_peer;
173         struct obd_uuid         c_remote_uuid;
174         atomic_t                c_refcount;
175 };
176
177 struct ptlrpc_client {
178         __u32                     cli_request_portal;
179         __u32                     cli_reply_portal;
180         char                     *cli_name;
181 };
182
183 /* state flags of requests */
184 /* XXX only ones left are those used by the bulk descs as well! */
185 #define PTL_RPC_FL_INTR      (1 << 0)  /* reply wait was interrupted by user */
186 #define PTL_RPC_FL_TIMEOUT   (1 << 7)  /* request timed out waiting for reply */
187
188 #define REQ_MAX_ACK_LOCKS 8
189
190 union ptlrpc_async_args {
191         /* Scratchpad for passing args to completion interpreter. Users
192          * cast to the struct of their choosing, and LASSERT that this is
193          * big enough.  For _tons_ of context, OBD_ALLOC a struct and store
194          * a pointer to it here.  The pointer_arg ensures this struct is at
195          * least big enough for that. */
196         void      *pointer_arg[9];
197         __u64      space[4];
198 };
199
200 struct ptlrpc_request_set;
201 typedef int (*set_interpreter_func)(struct ptlrpc_request_set *, void *, int);
202
203 struct ptlrpc_request_set {
204         int               set_remaining; /* # uncompleted requests */
205         cfs_waitq_t       set_waitq;
206         cfs_waitq_t      *set_wakeup_ptr;
207         struct list_head  set_requests;
208         struct list_head  set_cblist; /* list of completion callbacks */
209         set_interpreter_func    set_interpret; /* completion callback */
210         void              *set_arg; /* completion context */
211         /* locked so that any old caller can communicate requests to
212          * the set holder who can then fold them into the lock-free set */
213         spinlock_t        set_new_req_lock;
214         struct list_head  set_new_requests;
215 };
216
217 struct ptlrpc_set_cbdata {
218         struct list_head        psc_item;
219         set_interpreter_func    psc_interpret;
220         void                   *psc_data;
221 };
222
223 struct ptlrpc_bulk_desc;
224
225 /*
226  * ptlrpc callback & work item stuff
227  */
228 struct ptlrpc_cb_id {
229         void   (*cbid_fn)(lnet_event_t *ev);     /* specific callback fn */
230         void    *cbid_arg;                      /* additional arg */
231 };
232
233 #define RS_MAX_LOCKS 4
234 #define RS_DEBUG     1
235
236 struct ptlrpc_reply_state {
237         struct ptlrpc_cb_id    rs_cb_id;
238         struct list_head       rs_list;
239         struct list_head       rs_exp_list;
240         struct list_head       rs_obd_list;
241 #if RS_DEBUG
242         struct list_head       rs_debug_list;
243 #endif
244         /* updates to following flag serialised by srv_request_lock */
245         unsigned long          rs_difficult:1;     /* ACK/commit stuff */
246         unsigned long          rs_scheduled:1;     /* being handled? */
247         unsigned long          rs_scheduled_ever:1;/* any schedule attempts? */
248         unsigned long          rs_handled:1;  /* been handled yet? */
249         unsigned long          rs_on_net:1;   /* reply_out_callback pending? */
250         unsigned long          rs_prealloc:1; /* rs from prealloc list */
251
252         int                    rs_size;
253         __u64                  rs_transno;
254         __u64                  rs_xid;
255         struct obd_export     *rs_export;
256         struct ptlrpc_service *rs_service;
257         lnet_handle_md_t       rs_md_h;
258         atomic_t               rs_refcount;
259
260         struct ptlrpc_svc_ctx *rs_svc_ctx;
261         struct lustre_msg     *rs_repbuf;       /* wrapper */
262         int                    rs_repbuf_len;   /* wrapper buf length */
263         int                    rs_repdata_len;  /* wrapper msg length */
264         struct lustre_msg     *rs_msg;          /* reply message */
265
266         /* locks awaiting client reply ACK */
267         int                    rs_nlocks;
268         struct lustre_handle   rs_locks[RS_MAX_LOCKS];
269         ldlm_mode_t            rs_modes[RS_MAX_LOCKS];
270 };
271
272 struct ptlrpc_thread;
273
274 enum rq_phase {
275         RQ_PHASE_NEW         = 0xebc0de00,
276         RQ_PHASE_RPC         = 0xebc0de01,
277         RQ_PHASE_BULK        = 0xebc0de02,
278         RQ_PHASE_INTERPRET   = 0xebc0de03,
279         RQ_PHASE_COMPLETE    = 0xebc0de04,
280 };
281
282 struct ptlrpc_request_pool {
283         spinlock_t prp_lock;
284         struct list_head prp_req_list;    /* list of ptlrpc_request structs */
285         int prp_rq_size;
286         void (*prp_populate)(struct ptlrpc_request_pool *, int);
287 };
288
289 struct lu_context;
290 struct lu_env;
291
292 struct ptlrpc_request {
293         int rq_type; /* one of PTL_RPC_MSG_* */
294         struct list_head rq_list;
295         struct list_head rq_history_list;       /* server-side history */
296         __u64            rq_history_seq;        /* history sequence # */
297         int rq_status;
298         spinlock_t rq_lock;
299         /* client-side flags */
300         unsigned long rq_intr:1, rq_replied:1, rq_err:1,
301                 rq_timedout:1, rq_resend:1, rq_restart:1,
302                 /*
303                  * when ->rq_replay is set, request is kept by the client even
304                  * after server commits corresponding transaction. This is
305                  * used for operations that require sequence of multiple
306                  * requests to be replayed. The only example currently is file
307                  * open/close/dw/setattr. When last request in such a sequence
308                  * is committed, ->rq_replay is cleared on all requests in the
309                  * sequence.
310                  */
311                 rq_replay:1,
312                 /* this is the last request in the sequence. */
313                 rq_sequence:1,
314                 rq_no_resend:1, rq_waiting:1, rq_receiving_reply:1,
315                 rq_no_delay:1, rq_net_err:1, rq_wait_ctx:1;
316         enum rq_phase rq_phase; /* one of RQ_PHASE_* */
317         atomic_t rq_refcount;   /* client-side refcount for SENT race */
318
319         struct ptlrpc_thread *rq_svc_thread; /* initial thread servicing req */
320
321         int rq_request_portal;  /* XXX FIXME bug 249 */
322         int rq_reply_portal;    /* XXX FIXME bug 249 */
323
324         int rq_nob_received; /* client-side # reply bytes actually received  */
325
326         int rq_reqlen;
327         struct lustre_msg *rq_reqmsg;
328
329         int rq_timeout;         /* time to wait for reply (seconds) */
330         int rq_replen;
331         struct lustre_msg *rq_repmsg;
332         __u64 rq_transno;
333         __u64 rq_xid;
334         struct list_head rq_replay_list;
335         struct list_head rq_mod_list;
336
337         struct ptlrpc_cli_ctx   *rq_cli_ctx;     /* client's half ctx */
338         struct ptlrpc_svc_ctx   *rq_svc_ctx;     /* server's half ctx */
339         struct list_head         rq_ctx_chain;   /* link to waited ctx */
340         ptlrpc_sec_flavor_t      rq_sec_flavor;  /* client & server */
341                                  /* client security flags */
342         unsigned long            rq_ctx_init:1,      /* context initiation */
343                                  rq_ctx_fini:1,      /* context destroy */
344                                  rq_bulk_read:1,     /* request bulk read */
345                                  rq_bulk_write:1,    /* request bulk write */
346                                  /* server authentication flags */
347                                  rq_auth_gss:1,      /* authenticated by gss */
348                                  rq_auth_remote:1,   /* authed as remote user */
349                                  rq_auth_usr_root:1, /* authed as root */
350                                  rq_auth_usr_mdt:1,  /* authed as mdt */
351                                  /* doesn't expect reply FIXME */
352                                  rq_no_reply:1;
353
354         uid_t                    rq_auth_uid;        /* authed uid */
355         uid_t                    rq_auth_mapped_uid; /* authed uid mapped to */
356
357         /* (server side), pointed directly into req buffer */
358         struct ptlrpc_user_desc *rq_user_desc;
359
360         /* various buffer pointers */
361         struct lustre_msg       *rq_reqbuf;      /* req wrapper */
362         int                      rq_reqbuf_len;  /* req wrapper buf len */
363         int                      rq_reqdata_len; /* req wrapper msg len */
364         struct lustre_msg       *rq_repbuf;      /* rep wrapper */
365         int                      rq_repbuf_len;  /* rep wrapper buf len */
366         int                      rq_repdata_len; /* rep wrapper msg len */
367         struct lustre_msg       *rq_clrbuf;      /* only in priv mode */
368         int                      rq_clrbuf_len;  /* only in priv mode */
369         int                      rq_clrdata_len; /* only in priv mode */
370
371         __u32 rq_req_swab_mask;
372         __u32 rq_rep_swab_mask;
373
374         int rq_import_generation;
375         enum lustre_imp_state rq_send_state;
376
377         /* client+server request */
378         lnet_handle_md_t     rq_req_md_h;
379         struct ptlrpc_cb_id  rq_req_cbid;
380
381         /* server-side... */
382         struct timeval       rq_arrival_time;       /* request arrival time */
383         struct ptlrpc_reply_state *rq_reply_state;  /* separated reply state */
384         struct ptlrpc_request_buffer_desc *rq_rqbd; /* incoming request buffer*/
385 #ifdef CRAY_XT3
386         __u32                rq_uid;            /* peer uid, used in MDS only */
387 #endif
388
389         /* client-only incoming reply */
390         lnet_handle_md_t     rq_reply_md_h;
391         cfs_waitq_t          rq_reply_waitq;
392         struct ptlrpc_cb_id  rq_reply_cbid;
393
394         lnet_nid_t           rq_self;
395         lnet_process_id_t    rq_peer;
396         struct obd_export   *rq_export;
397         struct obd_import   *rq_import;
398
399         void (*rq_replay_cb)(struct ptlrpc_request *);
400         void (*rq_commit_cb)(struct ptlrpc_request *);
401         void  *rq_cb_data;
402
403         struct ptlrpc_bulk_desc *rq_bulk;       /* client side bulk */
404         time_t rq_sent;                         /* when request sent, seconds,
405                                                  * or time when request should
406                                                  * be sent */
407         /* Multi-rpc bits */
408         struct list_head rq_set_chain;
409         struct ptlrpc_request_set *rq_set;
410         void *rq_interpret_reply;               /* Async completion handler */
411         union ptlrpc_async_args rq_async_args;  /* Async completion context */
412         struct ptlrpc_request_pool *rq_pool;    /* Pool if request from
413                                                    preallocated list */
414         struct lu_context           rq_session;
415 };
416
417 static inline void ptlrpc_close_replay_seq(struct ptlrpc_request *req)
418 {
419         spin_lock(&req->rq_lock);
420         req->rq_replay = 0;
421         req->rq_sequence = 1;
422         spin_unlock(&req->rq_lock);
423 }
424
425 static inline void lustre_set_req_swabbed(struct ptlrpc_request *req, int index)
426 {
427         LASSERT(index < sizeof(req->rq_req_swab_mask) * 8);
428         LASSERT((req->rq_req_swab_mask & (1 << index)) == 0);
429         req->rq_req_swab_mask |= 1 << index;
430 }
431
432 static inline void lustre_set_rep_swabbed(struct ptlrpc_request *req, int index)
433 {
434         LASSERT(index < sizeof(req->rq_rep_swab_mask) * 8);
435         LASSERT((req->rq_rep_swab_mask & (1 << index)) == 0);
436         req->rq_rep_swab_mask |= 1 << index;
437 }
438
439 static inline int lustre_req_swabbed(struct ptlrpc_request *req, int index)
440
441         LASSERT(index < sizeof(req->rq_req_swab_mask) * 8);
442         return req->rq_req_swab_mask & (1 << index);
443 }
444
445 static inline int lustre_rep_swabbed(struct ptlrpc_request *req, int index)
446 {
447         LASSERT(index < sizeof(req->rq_rep_swab_mask) * 8);
448         return req->rq_rep_swab_mask & (1 << index);
449 }
450
451 static inline const char *
452 ptlrpc_rqphase2str(const struct ptlrpc_request *req)
453 {
454         switch (req->rq_phase) {
455         case RQ_PHASE_NEW:
456                 return "New";
457         case RQ_PHASE_RPC:
458                 return "Rpc";
459         case RQ_PHASE_BULK:
460                 return "Bulk";
461         case RQ_PHASE_INTERPRET:
462                 return "Interpret";
463         case RQ_PHASE_COMPLETE:
464                 return "Complete";
465         default:
466                 return "?Phase?";
467         }
468 }
469
470 /* Spare the preprocessor, spoil the bugs. */
471 #define FLAG(field, str) (field ? str : "")
472
473 #define DEBUG_REQ_FLAGS(req)                                                    \
474         ptlrpc_rqphase2str(req),                                                \
475         FLAG(req->rq_intr, "I"), FLAG(req->rq_replied, "R"),                    \
476         FLAG(req->rq_err, "E"),                                                 \
477         FLAG(req->rq_timedout, "X") /* eXpired */, FLAG(req->rq_resend, "S"),   \
478         FLAG(req->rq_restart, "T"), FLAG(req->rq_replay, "P"),                  \
479         FLAG(req->rq_no_resend, "N"),                                           \
480         FLAG(req->rq_waiting, "W"),                                             \
481         FLAG(req->rq_wait_ctx, "C")
482
483 #define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s%s"
484
485 void _debug_req(struct ptlrpc_request *req, __u32 mask,
486                 struct libcfs_debug_msg_data *data, const char *fmt, ...)
487         __attribute__ ((format (printf, 4, 5)));
488
489 #define debug_req(cdls, level, req, file, func, line, fmt, a...)              \
490 do {                                                                          \
491         CHECK_STACK();                                                        \
492                                                                               \
493         if (((level) & D_CANTMASK) != 0 ||                                    \
494             ((libcfs_debug & (level)) != 0 &&                                 \
495              (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) {              \
496                 static struct libcfs_debug_msg_data _req_dbg_data =           \
497                 DEBUG_MSG_DATA_INIT(cdls, DEBUG_SUBSYSTEM, file, func, line); \
498                 _debug_req((req), (level), &_req_dbg_data, fmt, ##a);         \
499         }                                                                     \
500 } while(0)
501
502 /* for most callers (level is a constant) this is resolved at compile time */
503 #define DEBUG_REQ(level, req, fmt, args...)                                   \
504 do {                                                                          \
505         if ((level) & (D_ERROR | D_WARNING)) {                                \
506                 static cfs_debug_limit_state_t cdls;                          \
507                 debug_req(&cdls, level, req, __FILE__, __func__, __LINE__,    \
508                           "@@@ "fmt" ", ## args);                             \
509         } else                                                                \
510                 debug_req(NULL, level, req, __FILE__, __func__, __LINE__,     \
511                           "@@@ "fmt" ", ## args);                             \
512 } while (0)
513
514 struct ptlrpc_bulk_page {
515         struct list_head bp_link;
516         int              bp_buflen;
517         int              bp_pageoffset; /* offset within a page */
518         struct page     *bp_page;
519 };
520
521 #define BULK_GET_SOURCE   0
522 #define BULK_PUT_SINK     1
523 #define BULK_GET_SINK     2
524 #define BULK_PUT_SOURCE   3
525
526 struct ptlrpc_bulk_desc {
527         unsigned long bd_success:1;              /* completed successfully */
528         unsigned long bd_network_rw:1;           /* accessible to the network */
529         unsigned long bd_type:2;                 /* {put,get}{source,sink} */
530         unsigned long bd_registered:1;           /* client side */
531         spinlock_t   bd_lock;                   /* serialise with callback */
532         int bd_import_generation;
533         struct obd_export *bd_export;
534         struct obd_import *bd_import;
535         __u32 bd_portal;
536         struct ptlrpc_request *bd_req;          /* associated request */
537         cfs_waitq_t            bd_waitq;        /* server side only WQ */
538         int                    bd_iov_count;    /* # entries in bd_iov */
539         int                    bd_max_iov;      /* allocated size of bd_iov */
540         int                    bd_nob;          /* # bytes covered */
541         int                    bd_nob_transferred; /* # bytes GOT/PUT */
542
543         __u64                  bd_last_xid;
544
545         struct ptlrpc_cb_id    bd_cbid;         /* network callback info */
546         lnet_handle_md_t       bd_md_h;         /* associated MD */
547         lnet_nid_t             bd_sender;       /* stash event::sender */
548
549         cfs_page_t           **bd_enc_pages;
550 #if defined(__KERNEL__)
551         lnet_kiov_t            bd_iov[0];
552 #else
553         lnet_md_iovec_t        bd_iov[0];
554 #endif
555 };
556
557 struct ptlrpc_thread {
558
559         struct list_head t_link; /* active threads for service, from svc->srv_threads */
560
561         void *t_data;            /* thread-private data (preallocated memory) */
562         __u32 t_flags;
563
564         unsigned int t_id; /* service thread index, from ptlrpc_start_threads */
565         cfs_waitq_t t_ctl_waitq;
566         struct lu_env *t_env;
567 };
568
569 struct ptlrpc_request_buffer_desc {
570         struct list_head       rqbd_list;
571         struct list_head       rqbd_reqs;
572         struct ptlrpc_service *rqbd_service;
573         lnet_handle_md_t       rqbd_md_h;
574         int                    rqbd_refcount;
575         char                  *rqbd_buffer;
576         struct ptlrpc_cb_id    rqbd_cbid;
577         struct ptlrpc_request  rqbd_req;
578 };
579
580 typedef int (*svc_handler_t)(struct ptlrpc_request *req);
581 typedef void (*svcreq_printfn_t)(void *, struct ptlrpc_request *);
582
583 struct ptlrpc_service {
584         struct list_head srv_list;              /* chain thru all services */
585         int              srv_max_req_size;      /* biggest request to receive */
586         int              srv_max_reply_size;    /* biggest reply to send */
587         int              srv_buf_size;          /* size of individual buffers */
588         int              srv_nbuf_per_group;    /* # buffers to allocate in 1 group */
589         int              srv_nbufs;             /* total # req buffer descs allocated */
590         int              srv_threads_min;       /* threads to start at SOW */
591         int              srv_threads_max;       /* thread upper limit */
592         int              srv_threads_started;   /* index of last started thread */
593         int              srv_threads_running;   /* # running threads */
594         int              srv_n_difficult_replies; /* # 'difficult' replies */
595         int              srv_n_active_reqs;     /* # reqs being served */
596         cfs_duration_t   srv_rqbd_timeout;      /* timeout before re-posting reqs, in tick */
597         int              srv_watchdog_timeout; /* soft watchdog timeout, in ms */
598         unsigned         srv_cpu_affinity:1;    /* bind threads to CPUs */
599
600         __u32            srv_req_portal;
601         __u32            srv_rep_portal;
602
603         int               srv_n_queued_reqs;    /* # reqs waiting to be served */
604         struct list_head  srv_request_queue;    /* reqs waiting for service */
605
606         struct list_head  srv_request_history;  /* request history */
607         __u64             srv_request_seq;      /* next request sequence # */
608         __u64             srv_request_max_cull_seq; /* highest seq culled from history */
609         svcreq_printfn_t  srv_request_history_print_fn; /* service-specific print fn */
610
611         struct list_head  srv_idle_rqbds;       /* request buffers to be reposted */
612         struct list_head  srv_active_rqbds;     /* req buffers receiving */
613         struct list_head  srv_history_rqbds;    /* request buffer history */
614         int               srv_nrqbd_receiving;  /* # posted request buffers */
615         int               srv_n_history_rqbds;  /* # request buffers in history */
616         int               srv_max_history_rqbds;/* max # request buffers in history */
617
618         atomic_t          srv_outstanding_replies;
619         struct list_head  srv_active_replies;   /* all the active replies */
620         struct list_head  srv_reply_queue;      /* replies waiting for service */
621
622         cfs_waitq_t       srv_waitq; /* all threads sleep on this. This
623                                       * wait-queue is signalled when new
624                                       * incoming request arrives and when
625                                       * difficult reply has to be handled. */
626
627         struct list_head   srv_threads;         /* service thread list */
628         svc_handler_t      srv_handler;
629
630         char *srv_name; /* only statically allocated strings here; we don't clean them */
631         char *srv_thread_name; /* only statically allocated strings here; we don't clean them */
632
633         spinlock_t               srv_lock;
634
635         cfs_proc_dir_entry_t    *srv_procroot;
636         struct lprocfs_stats    *srv_stats;
637
638         /* List of free reply_states */
639         struct list_head         srv_free_rs_list;
640         /* waitq to run, when adding stuff to srv_free_rs_list */
641         cfs_waitq_t              srv_free_rs_waitq;
642
643         /*
644          * Tags for lu_context associated with this thread, see struct
645          * lu_context.
646          */
647         __u32                    srv_ctx_tags;
648         /*
649          * if non-NULL called during thread creation (ptlrpc_start_thread())
650          * to initialize service specific per-thread state.
651          */
652         int (*srv_init)(struct ptlrpc_thread *thread);
653         /*
654          * if non-NULL called during thread shutdown (ptlrpc_main()) to
655          * destruct state created by ->srv_init().
656          */
657         void (*srv_done)(struct ptlrpc_thread *thread);
658
659         //struct ptlrpc_srv_ni srv_interfaces[0];
660 };
661
662 /* ptlrpc/events.c */
663 extern lnet_handle_eq_t ptlrpc_eq_h;
664 extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
665                                lnet_process_id_t *peer, lnet_nid_t *self);
666 extern void request_out_callback (lnet_event_t *ev);
667 extern void reply_in_callback(lnet_event_t *ev);
668 extern void client_bulk_callback (lnet_event_t *ev);
669 extern void request_in_callback(lnet_event_t *ev);
670 extern void reply_out_callback(lnet_event_t *ev);
671 extern void server_bulk_callback (lnet_event_t *ev);
672
673 /* ptlrpc/connection.c */
674 void ptlrpc_dump_connections(void);
675 void ptlrpc_readdress_connection(struct ptlrpc_connection *, struct obd_uuid *);
676 struct ptlrpc_connection *ptlrpc_get_connection(lnet_process_id_t peer,
677                                                 lnet_nid_t self, struct obd_uuid *uuid);
678 int ptlrpc_put_connection(struct ptlrpc_connection *c);
679 struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *);
680 int ptlrpc_init_connection(void);
681 void ptlrpc_cleanup_connection(void);
682 extern lnet_pid_t ptl_get_pid(void);
683
684 /* ptlrpc/niobuf.c */
685 int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc);
686 void ptlrpc_abort_bulk(struct ptlrpc_bulk_desc *desc);
687 int ptlrpc_register_bulk(struct ptlrpc_request *req);
688 void ptlrpc_unregister_bulk (struct ptlrpc_request *req);
689
690 static inline int ptlrpc_bulk_active (struct ptlrpc_bulk_desc *desc)
691 {
692         int           rc;
693
694         spin_lock(&desc->bd_lock);
695         rc = desc->bd_network_rw;
696         spin_unlock(&desc->bd_lock);
697         return (rc);
698 }
699
700 int ptlrpc_send_reply(struct ptlrpc_request *req, int);
701 int ptlrpc_reply(struct ptlrpc_request *req);
702 int ptlrpc_error(struct ptlrpc_request *req);
703 void ptlrpc_resend_req(struct ptlrpc_request *request);
704 int ptl_send_rpc(struct ptlrpc_request *request, int noreply);
705 int ptlrpc_register_rqbd (struct ptlrpc_request_buffer_desc *rqbd);
706
707 /* ptlrpc/client.c */
708 void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
709                         struct ptlrpc_client *);
710 void ptlrpc_cleanup_client(struct obd_import *imp);
711 struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid);
712
713 static inline int
714 ptlrpc_client_receiving_reply (struct ptlrpc_request *req)
715 {
716         int           rc;
717
718         spin_lock(&req->rq_lock);
719         rc = req->rq_receiving_reply;
720         spin_unlock(&req->rq_lock);
721         return (rc);
722 }
723
724 static inline int
725 ptlrpc_client_replied (struct ptlrpc_request *req)
726 {
727         int           rc;
728
729         spin_lock(&req->rq_lock);
730         rc = req->rq_replied;
731         spin_unlock(&req->rq_lock);
732         return (rc);
733 }
734
735 static inline void
736 ptlrpc_wake_client_req (struct ptlrpc_request *req)
737 {
738         if (req->rq_set == NULL)
739                 cfs_waitq_signal(&req->rq_reply_waitq);
740         else
741                 cfs_waitq_signal(&req->rq_set->set_waitq);
742 }
743
744 int ptlrpc_queue_wait(struct ptlrpc_request *req);
745 int ptlrpc_replay_req(struct ptlrpc_request *req);
746 void ptlrpc_unregister_reply(struct ptlrpc_request *req);
747 void ptlrpc_restart_req(struct ptlrpc_request *req);
748 void ptlrpc_abort_inflight(struct obd_import *imp);
749
750 struct ptlrpc_request_set *ptlrpc_prep_set(void);
751 int ptlrpc_set_add_cb(struct ptlrpc_request_set *set,
752                       set_interpreter_func fn, void *data);
753 int ptlrpc_set_next_timeout(struct ptlrpc_request_set *);
754 int ptlrpc_check_set(struct ptlrpc_request_set *set);
755 int ptlrpc_set_wait(struct ptlrpc_request_set *);
756 int ptlrpc_expired_set(void *data);
757 void ptlrpc_interrupted_set(void *data);
758 void ptlrpc_mark_interrupted(struct ptlrpc_request *req);
759 void ptlrpc_set_destroy(struct ptlrpc_request_set *);
760 void ptlrpc_set_add_req(struct ptlrpc_request_set *, struct ptlrpc_request *);
761 void ptlrpc_set_add_new_req(struct ptlrpc_request_set *,
762                             struct ptlrpc_request *);
763
764 void ptlrpc_free_rq_pool(struct ptlrpc_request_pool *pool);
765 void ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq);
766 struct ptlrpc_request_pool *ptlrpc_init_rq_pool(int, int,
767                                                 void (*populate_pool)(struct ptlrpc_request_pool *, int));
768 struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, __u32 version,
769                                        int opcode, int count, int *lengths,
770                                        char **bufs);
771 struct ptlrpc_request *ptlrpc_prep_req_pool(struct obd_import *imp,
772                                              __u32 version, int opcode,
773                                             int count, int *lengths, char **bufs,
774                                             struct ptlrpc_request_pool *pool,
775                                             struct ptlrpc_cli_ctx *ctx);
776 void ptlrpc_free_req(struct ptlrpc_request *request);
777 void ptlrpc_req_finished(struct ptlrpc_request *request);
778 void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request);
779 struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req);
780 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp (struct ptlrpc_request *req,
781                                                int npages, int type, int portal);
782 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_exp(struct ptlrpc_request *req,
783                                               int npages, int type, int portal);
784 void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *bulk);
785 void ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc,
786                            cfs_page_t *page, int pageoffset, int len);
787 void ptlrpc_retain_replayable_request(struct ptlrpc_request *req,
788                                       struct obd_import *imp);
789 __u64 ptlrpc_next_xid(void);
790 __u64 ptlrpc_sample_next_xid(void);
791 __u64 ptlrpc_req_xid(struct ptlrpc_request *request);
792
793 struct ptlrpc_service_conf {
794         int psc_nbufs;
795         int psc_bufsize;
796         int psc_max_req_size;
797         int psc_max_reply_size;
798         int psc_req_portal;
799         int psc_rep_portal;
800         int psc_watchdog_timeout; /* in ms */
801         int psc_min_threads;
802         int psc_max_threads;
803         __u32 psc_ctx_tags;
804 };
805
806 /* ptlrpc/service.c */
807 void ptlrpc_save_lock (struct ptlrpc_request *req,
808                        struct lustre_handle *lock, int mode);
809 void ptlrpc_commit_replies (struct obd_device *obd);
810 void ptlrpc_schedule_difficult_reply (struct ptlrpc_reply_state *rs);
811 struct ptlrpc_service *ptlrpc_init_svc_conf(struct ptlrpc_service_conf *c,
812                                             svc_handler_t h, char *name,
813                                             struct proc_dir_entry *proc_entry,
814                                             svcreq_printfn_t prntfn,
815                                             char *threadname);
816
817 struct ptlrpc_service *ptlrpc_init_svc(int nbufs, int bufsize, int max_req_size,
818                                        int max_reply_size,
819                                        int req_portal, int rep_portal,
820                                        int watchdog_timeout, /* in ms */
821                                        svc_handler_t, char *name,
822                                        cfs_proc_dir_entry_t *proc_entry,
823                                        svcreq_printfn_t,
824                                        int min_threads, int max_threads,
825                                        char *threadname, __u32 ctx_tags);
826 void ptlrpc_stop_all_threads(struct ptlrpc_service *svc);
827
828 int ptlrpc_start_threads(struct obd_device *dev, struct ptlrpc_service *svc);
829 int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc);
830 int ptlrpc_unregister_service(struct ptlrpc_service *service);
831 int liblustre_check_services (void *arg);
832 void ptlrpc_daemonize(char *name);
833 int ptlrpc_service_health_check(struct ptlrpc_service *);
834
835
836 struct ptlrpc_svc_data {
837         char *name;
838         struct ptlrpc_service *svc;
839         struct ptlrpc_thread *thread;
840         struct obd_device *dev;
841 };
842
843 /* ptlrpc/import.c */
844 int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid);
845 int ptlrpc_init_import(struct obd_import *imp);
846 int ptlrpc_disconnect_import(struct obd_import *imp, int noclose);
847 int ptlrpc_import_recovery_state_machine(struct obd_import *imp);
848
849 /* ptlrpc/pack_generic.c */
850 int lustre_msg_swabbed(struct lustre_msg *msg);
851 int lustre_msg_check_version(struct lustre_msg *msg, __u32 version);
852 void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, int *lens,
853                         char **bufs);
854 int lustre_pack_request(struct ptlrpc_request *, __u32 magic, int count,
855                         int *lens, char **bufs);
856 int lustre_pack_reply(struct ptlrpc_request *, int count, int *lens,
857                       char **bufs);
858 int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
859                          int *lens, char **bufs);
860 int lustre_shrink_msg(struct lustre_msg *msg, int segment,
861                       unsigned int newlen, int move_data);
862 void lustre_free_reply_state(struct ptlrpc_reply_state *rs);
863 int lustre_msg_size(__u32 magic, int count, int *lengths);
864 int lustre_msg_size_v2(int count, int *lengths);
865 int lustre_packed_msg_size(struct lustre_msg *msg);
866 int lustre_unpack_msg(struct lustre_msg *m, int len);
867 void *lustre_msg_buf_v1(void *msg, int n, int min_size);
868 void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, int n, int min_size);
869 void *lustre_msg_buf(struct lustre_msg *m, int n, int minlen);
870 int lustre_msg_buflen(struct lustre_msg *m, int n);
871 void lustre_msg_set_buflen(struct lustre_msg *m, int n, int len);
872 int lustre_msg_bufcount(struct lustre_msg *m);
873 char *lustre_msg_string (struct lustre_msg *m, int n, int max_len);
874 void *lustre_swab_buf(struct lustre_msg *, int n, int minlen, void *swabber);
875 void *lustre_swab_reqbuf(struct ptlrpc_request *req, int n, int minlen,
876                          void *swabber);
877 void *lustre_swab_repbuf(struct ptlrpc_request *req, int n, int minlen,
878                          void *swabber);
879 __u32 lustre_msg_get_flags(struct lustre_msg *msg);
880 void lustre_msg_add_flags(struct lustre_msg *msg, int flags);
881 void lustre_msg_set_flags(struct lustre_msg *msg, int flags);
882 void lustre_msg_clear_flags(struct lustre_msg *msg, int flags);
883 __u32 lustre_msg_get_op_flags(struct lustre_msg *msg);
884 void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags);
885 void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags);
886 struct lustre_handle *lustre_msg_get_handle(struct lustre_msg *msg);
887 __u32 lustre_msg_get_type(struct lustre_msg *msg);
888 __u32 lustre_msg_get_version(struct lustre_msg *msg);
889 void lustre_msg_add_version(struct lustre_msg *msg, int version);
890 __u32 lustre_msg_get_opc(struct lustre_msg *msg);
891 __u64 lustre_msg_get_last_xid(struct lustre_msg *msg);
892 __u64 lustre_msg_get_last_committed(struct lustre_msg *msg);
893 __u64 lustre_msg_get_transno(struct lustre_msg *msg);
894 __u64 lustre_msg_get_slv(struct lustre_msg *msg);
895 __u32 lustre_msg_get_limit(struct lustre_msg *msg);
896 void lustre_msg_set_slv(struct lustre_msg *msg, __u64 slv);
897 void lustre_msg_set_limit(struct lustre_msg *msg, __u64 limit);
898 int lustre_msg_get_status(struct lustre_msg *msg);
899 __u32 lustre_msg_get_conn_cnt(struct lustre_msg *msg);
900 __u32 lustre_msg_get_magic(struct lustre_msg *msg);
901 void lustre_msg_set_handle(struct lustre_msg *msg,struct lustre_handle *handle);
902 void lustre_msg_set_type(struct lustre_msg *msg, __u32 type);
903 void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc);
904 void lustre_msg_set_last_xid(struct lustre_msg *msg, __u64 last_xid);
905 void lustre_msg_set_last_committed(struct lustre_msg *msg,__u64 last_committed);
906 void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno);
907 void lustre_msg_set_status(struct lustre_msg *msg, __u32 status);
908 void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt);
909
910 static inline void
911 lustre_shrink_reply(struct ptlrpc_request *req, int segment,
912                     unsigned int newlen, int move_data)
913 {
914         LASSERT(req->rq_reply_state);
915         LASSERT(req->rq_repmsg);
916         req->rq_replen = lustre_shrink_msg(req->rq_repmsg, segment,
917                                            newlen, move_data);
918 }
919
920 static inline void
921 ptlrpc_rs_addref(struct ptlrpc_reply_state *rs)
922 {
923         LASSERT(atomic_read(&rs->rs_refcount) > 0);
924         atomic_inc(&rs->rs_refcount);
925 }
926
927 static inline void
928 ptlrpc_rs_decref(struct ptlrpc_reply_state *rs)
929 {
930         LASSERT(atomic_read(&rs->rs_refcount) > 0);
931         if (atomic_dec_and_test(&rs->rs_refcount))
932                 lustre_free_reply_state(rs);
933 }
934
935 static inline __u32 lustre_request_magic(struct ptlrpc_request *req)
936 {
937         return lustre_msg_get_magic(req->rq_reqmsg);
938 }
939
940 static inline int ptlrpc_req_get_repsize(struct ptlrpc_request *req)
941 {
942         switch (req->rq_reqmsg->lm_magic) {
943         case LUSTRE_MSG_MAGIC_V1:
944                 CERROR("function not supported for lustre_msg V1!\n");
945                 return -ENOTSUPP;
946         case LUSTRE_MSG_MAGIC_V2:
947                 return req->rq_reqmsg->lm_repsize;
948         default:
949                 LASSERTF(0, "incorrect message magic: %08x\n",
950                          req->rq_reqmsg->lm_magic);
951                 return -EFAULT;
952         }
953 }
954
955 static inline void
956 ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, int *lens)
957 {
958         req->rq_replen = lustre_msg_size(req->rq_reqmsg->lm_magic, count, lens);
959         if (req->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V2)
960                 req->rq_reqmsg->lm_repsize = req->rq_replen;
961 }
962
963 /* ldlm/ldlm_lib.c */
964 int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg);
965 int client_obd_cleanup(struct obd_device *obddev);
966 int client_connect_import(const struct lu_env *env,
967                           struct lustre_handle *conn, struct obd_device *obd,
968                           struct obd_uuid *cluuid, struct obd_connect_data *);
969 int client_disconnect_export(struct obd_export *exp);
970 int client_import_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
971                            int priority);
972 int client_import_del_conn(struct obd_import *imp, struct obd_uuid *uuid);
973 int import_set_conn_priority(struct obd_import *imp, struct obd_uuid *uuid);
974
975 /* ptlrpc/pinger.c */
976 int ptlrpc_pinger_add_import(struct obd_import *imp);
977 int ptlrpc_pinger_del_import(struct obd_import *imp);
978 cfs_time_t ptlrpc_suspend_wakeup_time(void);
979 #ifdef __KERNEL__
980 void ping_evictor_start(void);
981 void ping_evictor_stop(void);
982 #else
983 #define ping_evictor_start()    do {} while (0)
984 #define ping_evictor_stop()     do {} while (0)
985 #endif
986 int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req);
987
988 /* ptlrpc/ptlrpcd.c */
989 void ptlrpcd_wake(struct ptlrpc_request *req);
990 void ptlrpcd_add_req(struct ptlrpc_request *req);
991 int ptlrpcd_addref(void);
992 void ptlrpcd_decref(void);
993
994 /* ptlrpc/lproc_ptlrpc.c */
995 const char* ll_opcode2str(__u32 opcode);
996 #ifdef LPROCFS
997 void ptlrpc_lprocfs_register_obd(struct obd_device *obd);
998 void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd);
999 void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc, int bytes);
1000 #else
1001 static inline void ptlrpc_lprocfs_register_obd(struct obd_device *obd) {}
1002 static inline void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) {}
1003 static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc,
1004                                       int bytes) {}
1005 #endif
1006
1007 /* ptlrpc/llog_server.c */
1008 int llog_origin_handle_create(struct ptlrpc_request *req);
1009 int llog_origin_handle_destroy(struct ptlrpc_request *req);
1010 int llog_origin_handle_prev_block(struct ptlrpc_request *req);
1011 int llog_origin_handle_next_block(struct ptlrpc_request *req);
1012 int llog_origin_handle_read_header(struct ptlrpc_request *req);
1013 int llog_origin_handle_close(struct ptlrpc_request *req);
1014 int llog_origin_handle_cancel(struct ptlrpc_request *req);
1015 int llog_catinfo(struct ptlrpc_request *req);
1016
1017 /* ptlrpc/llog_client.c */
1018 extern struct llog_operations llog_client_ops;
1019
1020 #endif