4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2011, 2017, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
32 * lustre/include/lustre_lib.h
34 * Basic Lustre library routines.
45 #ifdef HAVE_SCHED_HEADERS
46 #include <linux/sched/signal.h>
47 #include <linux/sched/mm.h>
50 #include <libcfs/libcfs.h>
51 #include <uapi/linux/lustre/lustre_idl.h>
52 #include <uapi/linux/lustre/lustre_ver.h>
53 #include <uapi/linux/lustre/lustre_cfg.h>
56 struct ptlrpc_request;
59 #include <lustre_ha.h>
60 #include <lustre_net.h>
62 #define LI_POISON 0x5a5a5a5a
63 #if BITS_PER_LONG > 32
64 # define LL_POISON 0x5a5a5a5a5a5a5a5aL
66 # define LL_POISON 0x5a5a5a5aL
68 #define LP_POISON ((void *)LL_POISON)
70 #ifdef HAVE_SERVER_SUPPORT
71 int rev_import_init(struct obd_export *exp);
72 int target_handle_connect(struct ptlrpc_request *req);
73 int target_handle_disconnect(struct ptlrpc_request *req);
74 void target_destroy_export(struct obd_export *exp);
75 void target_committed_to_req(struct ptlrpc_request *req);
76 void target_cancel_recovery_timer(struct obd_device *obd);
77 void target_stop_recovery_thread(struct obd_device *obd);
78 void target_cleanup_recovery(struct obd_device *obd);
79 int target_queue_recovery_request(struct ptlrpc_request *req,
80 struct obd_device *obd);
81 int target_bulk_io(struct obd_export *exp, struct ptlrpc_bulk_desc *desc);
84 int target_pack_pool_reply(struct ptlrpc_request *req);
85 int do_set_info_async(struct obd_import *imp,
86 int opcode, int version,
87 size_t keylen, void *key,
88 size_t vallen, void *val,
89 struct ptlrpc_request_set *set);
91 void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id);
95 #endif /* _LUSTRE_LIB_H */