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/
31 * lustre/include/lustre_lib.h
33 * Basic Lustre library routines.
44 #ifdef HAVE_SCHED_HEADERS
45 #include <linux/sched/signal.h>
46 #include <linux/sched/mm.h>
49 #include <libcfs/libcfs.h>
50 #include <uapi/linux/lustre/lustre_idl.h>
51 #include <uapi/linux/lustre/lustre_ver.h>
52 #include <uapi/linux/lustre/lustre_cfg.h>
55 struct ptlrpc_request;
58 #include <lustre_ha.h>
59 #include <lustre_net.h>
61 #define LI_POISON 0x5a5a5a5a
62 #if BITS_PER_LONG > 32
63 # define LL_POISON 0x5a5a5a5a5a5a5a5aL
65 # define LL_POISON 0x5a5a5a5aL
67 #define LP_POISON ((void *)LL_POISON)
69 #ifdef HAVE_SERVER_SUPPORT
70 int rev_import_init(struct obd_export *exp);
71 int target_handle_connect(struct ptlrpc_request *req);
72 int target_handle_disconnect(struct ptlrpc_request *req);
73 void target_destroy_export(struct obd_export *exp);
74 void target_committed_to_req(struct ptlrpc_request *req);
75 void target_cancel_recovery_timer(struct obd_device *obd);
76 void target_stop_recovery_thread(struct obd_device *obd);
77 void target_cleanup_recovery(struct obd_device *obd);
78 int target_queue_recovery_request(struct ptlrpc_request *req,
79 struct obd_device *obd);
80 int target_bulk_io(struct obd_export *exp, struct ptlrpc_bulk_desc *desc);
83 int target_pack_pool_reply(struct ptlrpc_request *req);
84 int do_set_info_async(struct obd_import *imp,
85 int opcode, int version,
86 size_t keylen, void *key,
87 size_t vallen, void *val,
88 struct ptlrpc_request_set *set);
90 void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id);
92 #define LL_CDEBUG_PAGE(mask, page, fmt, arg...) \
93 CDEBUG(mask, "page %p map %p index %lu flags %lx count %u priv %0lx: " \
94 fmt, page, page->mapping, page->index, (long)page->flags, \
95 page_count(page), page_private(page), ## arg)
99 #endif /* _LUSTRE_LIB_H */