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