xref: /OK3568_Linux_fs/kernel/drivers/block/drbd/drbd_req.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun    drbd_req.h
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun    This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun    Copyright (C) 2006-2008, LINBIT Information Technologies GmbH.
8*4882a593Smuzhiyun    Copyright (C) 2006-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
9*4882a593Smuzhiyun    Copyright (C) 2006-2008, Philipp Reisner <philipp.reisner@linbit.com>.
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun  */
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #ifndef _DRBD_REQ_H
14*4882a593Smuzhiyun #define _DRBD_REQ_H
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #include <linux/module.h>
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #include <linux/slab.h>
19*4882a593Smuzhiyun #include <linux/drbd.h>
20*4882a593Smuzhiyun #include "drbd_int.h"
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun /* The request callbacks will be called in irq context by the IDE drivers,
23*4882a593Smuzhiyun    and in Softirqs/Tasklets/BH context by the SCSI drivers,
24*4882a593Smuzhiyun    and by the receiver and worker in kernel-thread context.
25*4882a593Smuzhiyun    Try to get the locking right :) */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun /*
28*4882a593Smuzhiyun  * Objects of type struct drbd_request do only exist on a R_PRIMARY node, and are
29*4882a593Smuzhiyun  * associated with IO requests originating from the block layer above us.
30*4882a593Smuzhiyun  *
31*4882a593Smuzhiyun  * There are quite a few things that may happen to a drbd request
32*4882a593Smuzhiyun  * during its lifetime.
33*4882a593Smuzhiyun  *
34*4882a593Smuzhiyun  *  It will be created.
35*4882a593Smuzhiyun  *  It will be marked with the intention to be
36*4882a593Smuzhiyun  *    submitted to local disk and/or
37*4882a593Smuzhiyun  *    send via the network.
38*4882a593Smuzhiyun  *
39*4882a593Smuzhiyun  *  It has to be placed on the transfer log and other housekeeping lists,
40*4882a593Smuzhiyun  *  In case we have a network connection.
41*4882a593Smuzhiyun  *
42*4882a593Smuzhiyun  *  It may be identified as a concurrent (write) request
43*4882a593Smuzhiyun  *    and be handled accordingly.
44*4882a593Smuzhiyun  *
45*4882a593Smuzhiyun  *  It may me handed over to the local disk subsystem.
46*4882a593Smuzhiyun  *  It may be completed by the local disk subsystem,
47*4882a593Smuzhiyun  *    either successfully or with io-error.
48*4882a593Smuzhiyun  *  In case it is a READ request, and it failed locally,
49*4882a593Smuzhiyun  *    it may be retried remotely.
50*4882a593Smuzhiyun  *
51*4882a593Smuzhiyun  *  It may be queued for sending.
52*4882a593Smuzhiyun  *  It may be handed over to the network stack,
53*4882a593Smuzhiyun  *    which may fail.
54*4882a593Smuzhiyun  *  It may be acknowledged by the "peer" according to the wire_protocol in use.
55*4882a593Smuzhiyun  *    this may be a negative ack.
56*4882a593Smuzhiyun  *  It may receive a faked ack when the network connection is lost and the
57*4882a593Smuzhiyun  *  transfer log is cleaned up.
58*4882a593Smuzhiyun  *  Sending may be canceled due to network connection loss.
59*4882a593Smuzhiyun  *  When it finally has outlived its time,
60*4882a593Smuzhiyun  *    corresponding dirty bits in the resync-bitmap may be cleared or set,
61*4882a593Smuzhiyun  *    it will be destroyed,
62*4882a593Smuzhiyun  *    and completion will be signalled to the originator,
63*4882a593Smuzhiyun  *      with or without "success".
64*4882a593Smuzhiyun  */
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun enum drbd_req_event {
67*4882a593Smuzhiyun 	CREATED,
68*4882a593Smuzhiyun 	TO_BE_SENT,
69*4882a593Smuzhiyun 	TO_BE_SUBMITTED,
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun 	/* XXX yes, now I am inconsistent...
72*4882a593Smuzhiyun 	 * these are not "events" but "actions"
73*4882a593Smuzhiyun 	 * oh, well... */
74*4882a593Smuzhiyun 	QUEUE_FOR_NET_WRITE,
75*4882a593Smuzhiyun 	QUEUE_FOR_NET_READ,
76*4882a593Smuzhiyun 	QUEUE_FOR_SEND_OOS,
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun 	/* An empty flush is queued as P_BARRIER,
79*4882a593Smuzhiyun 	 * which will cause it to complete "successfully",
80*4882a593Smuzhiyun 	 * even if the local disk flush failed.
81*4882a593Smuzhiyun 	 *
82*4882a593Smuzhiyun 	 * Just like "real" requests, empty flushes (blkdev_issue_flush()) will
83*4882a593Smuzhiyun 	 * only see an error if neither local nor remote data is reachable. */
84*4882a593Smuzhiyun 	QUEUE_AS_DRBD_BARRIER,
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun 	SEND_CANCELED,
87*4882a593Smuzhiyun 	SEND_FAILED,
88*4882a593Smuzhiyun 	HANDED_OVER_TO_NETWORK,
89*4882a593Smuzhiyun 	OOS_HANDED_TO_NETWORK,
90*4882a593Smuzhiyun 	CONNECTION_LOST_WHILE_PENDING,
91*4882a593Smuzhiyun 	READ_RETRY_REMOTE_CANCELED,
92*4882a593Smuzhiyun 	RECV_ACKED_BY_PEER,
93*4882a593Smuzhiyun 	WRITE_ACKED_BY_PEER,
94*4882a593Smuzhiyun 	WRITE_ACKED_BY_PEER_AND_SIS, /* and set_in_sync */
95*4882a593Smuzhiyun 	CONFLICT_RESOLVED,
96*4882a593Smuzhiyun 	POSTPONE_WRITE,
97*4882a593Smuzhiyun 	NEG_ACKED,
98*4882a593Smuzhiyun 	BARRIER_ACKED, /* in protocol A and B */
99*4882a593Smuzhiyun 	DATA_RECEIVED, /* (remote read) */
100*4882a593Smuzhiyun 
101*4882a593Smuzhiyun 	COMPLETED_OK,
102*4882a593Smuzhiyun 	READ_COMPLETED_WITH_ERROR,
103*4882a593Smuzhiyun 	READ_AHEAD_COMPLETED_WITH_ERROR,
104*4882a593Smuzhiyun 	WRITE_COMPLETED_WITH_ERROR,
105*4882a593Smuzhiyun 	DISCARD_COMPLETED_NOTSUPP,
106*4882a593Smuzhiyun 	DISCARD_COMPLETED_WITH_ERROR,
107*4882a593Smuzhiyun 
108*4882a593Smuzhiyun 	ABORT_DISK_IO,
109*4882a593Smuzhiyun 	RESEND,
110*4882a593Smuzhiyun 	FAIL_FROZEN_DISK_IO,
111*4882a593Smuzhiyun 	RESTART_FROZEN_DISK_IO,
112*4882a593Smuzhiyun 	NOTHING,
113*4882a593Smuzhiyun };
114*4882a593Smuzhiyun 
115*4882a593Smuzhiyun /* encoding of request states for now.  we don't actually need that many bits.
116*4882a593Smuzhiyun  * we don't need to do atomic bit operations either, since most of the time we
117*4882a593Smuzhiyun  * need to look at the connection state and/or manipulate some lists at the
118*4882a593Smuzhiyun  * same time, so we should hold the request lock anyways.
119*4882a593Smuzhiyun  */
120*4882a593Smuzhiyun enum drbd_req_state_bits {
121*4882a593Smuzhiyun 	/* 3210
122*4882a593Smuzhiyun 	 * 0000: no local possible
123*4882a593Smuzhiyun 	 * 0001: to be submitted
124*4882a593Smuzhiyun 	 *    UNUSED, we could map: 011: submitted, completion still pending
125*4882a593Smuzhiyun 	 * 0110: completed ok
126*4882a593Smuzhiyun 	 * 0010: completed with error
127*4882a593Smuzhiyun 	 * 1001: Aborted (before completion)
128*4882a593Smuzhiyun 	 * 1x10: Aborted and completed -> free
129*4882a593Smuzhiyun 	 */
130*4882a593Smuzhiyun 	__RQ_LOCAL_PENDING,
131*4882a593Smuzhiyun 	__RQ_LOCAL_COMPLETED,
132*4882a593Smuzhiyun 	__RQ_LOCAL_OK,
133*4882a593Smuzhiyun 	__RQ_LOCAL_ABORTED,
134*4882a593Smuzhiyun 
135*4882a593Smuzhiyun 	/* 87654
136*4882a593Smuzhiyun 	 * 00000: no network possible
137*4882a593Smuzhiyun 	 * 00001: to be send
138*4882a593Smuzhiyun 	 * 00011: to be send, on worker queue
139*4882a593Smuzhiyun 	 * 00101: sent, expecting recv_ack (B) or write_ack (C)
140*4882a593Smuzhiyun 	 * 11101: sent,
141*4882a593Smuzhiyun 	 *        recv_ack (B) or implicit "ack" (A),
142*4882a593Smuzhiyun 	 *        still waiting for the barrier ack.
143*4882a593Smuzhiyun 	 *        master_bio may already be completed and invalidated.
144*4882a593Smuzhiyun 	 * 11100: write acked (C),
145*4882a593Smuzhiyun 	 *        data received (for remote read, any protocol)
146*4882a593Smuzhiyun 	 *        or finally the barrier ack has arrived (B,A)...
147*4882a593Smuzhiyun 	 *        request can be freed
148*4882a593Smuzhiyun 	 * 01100: neg-acked (write, protocol C)
149*4882a593Smuzhiyun 	 *        or neg-d-acked (read, any protocol)
150*4882a593Smuzhiyun 	 *        or killed from the transfer log
151*4882a593Smuzhiyun 	 *        during cleanup after connection loss
152*4882a593Smuzhiyun 	 *        request can be freed
153*4882a593Smuzhiyun 	 * 01000: canceled or send failed...
154*4882a593Smuzhiyun 	 *        request can be freed
155*4882a593Smuzhiyun 	 */
156*4882a593Smuzhiyun 
157*4882a593Smuzhiyun 	/* if "SENT" is not set, yet, this can still fail or be canceled.
158*4882a593Smuzhiyun 	 * if "SENT" is set already, we still wait for an Ack packet.
159*4882a593Smuzhiyun 	 * when cleared, the master_bio may be completed.
160*4882a593Smuzhiyun 	 * in (B,A) the request object may still linger on the transaction log
161*4882a593Smuzhiyun 	 * until the corresponding barrier ack comes in */
162*4882a593Smuzhiyun 	__RQ_NET_PENDING,
163*4882a593Smuzhiyun 
164*4882a593Smuzhiyun 	/* If it is QUEUED, and it is a WRITE, it is also registered in the
165*4882a593Smuzhiyun 	 * transfer log. Currently we need this flag to avoid conflicts between
166*4882a593Smuzhiyun 	 * worker canceling the request and tl_clear_barrier killing it from
167*4882a593Smuzhiyun 	 * transfer log.  We should restructure the code so this conflict does
168*4882a593Smuzhiyun 	 * no longer occur. */
169*4882a593Smuzhiyun 	__RQ_NET_QUEUED,
170*4882a593Smuzhiyun 
171*4882a593Smuzhiyun 	/* well, actually only "handed over to the network stack".
172*4882a593Smuzhiyun 	 *
173*4882a593Smuzhiyun 	 * TODO can potentially be dropped because of the similar meaning
174*4882a593Smuzhiyun 	 * of RQ_NET_SENT and ~RQ_NET_QUEUED.
175*4882a593Smuzhiyun 	 * however it is not exactly the same. before we drop it
176*4882a593Smuzhiyun 	 * we must ensure that we can tell a request with network part
177*4882a593Smuzhiyun 	 * from a request without, regardless of what happens to it. */
178*4882a593Smuzhiyun 	__RQ_NET_SENT,
179*4882a593Smuzhiyun 
180*4882a593Smuzhiyun 	/* when set, the request may be freed (if RQ_NET_QUEUED is clear).
181*4882a593Smuzhiyun 	 * basically this means the corresponding P_BARRIER_ACK was received */
182*4882a593Smuzhiyun 	__RQ_NET_DONE,
183*4882a593Smuzhiyun 
184*4882a593Smuzhiyun 	/* whether or not we know (C) or pretend (B,A) that the write
185*4882a593Smuzhiyun 	 * was successfully written on the peer.
186*4882a593Smuzhiyun 	 */
187*4882a593Smuzhiyun 	__RQ_NET_OK,
188*4882a593Smuzhiyun 
189*4882a593Smuzhiyun 	/* peer called drbd_set_in_sync() for this write */
190*4882a593Smuzhiyun 	__RQ_NET_SIS,
191*4882a593Smuzhiyun 
192*4882a593Smuzhiyun 	/* keep this last, its for the RQ_NET_MASK */
193*4882a593Smuzhiyun 	__RQ_NET_MAX,
194*4882a593Smuzhiyun 
195*4882a593Smuzhiyun 	/* Set when this is a write, clear for a read */
196*4882a593Smuzhiyun 	__RQ_WRITE,
197*4882a593Smuzhiyun 	__RQ_WSAME,
198*4882a593Smuzhiyun 	__RQ_UNMAP,
199*4882a593Smuzhiyun 	__RQ_ZEROES,
200*4882a593Smuzhiyun 
201*4882a593Smuzhiyun 	/* Should call drbd_al_complete_io() for this request... */
202*4882a593Smuzhiyun 	__RQ_IN_ACT_LOG,
203*4882a593Smuzhiyun 
204*4882a593Smuzhiyun 	/* This was the most recent request during some blk_finish_plug()
205*4882a593Smuzhiyun 	 * or its implicit from-schedule equivalent.
206*4882a593Smuzhiyun 	 * We may use it as hint to send a P_UNPLUG_REMOTE */
207*4882a593Smuzhiyun 	__RQ_UNPLUG,
208*4882a593Smuzhiyun 
209*4882a593Smuzhiyun 	/* The peer has sent a retry ACK */
210*4882a593Smuzhiyun 	__RQ_POSTPONED,
211*4882a593Smuzhiyun 
212*4882a593Smuzhiyun 	/* would have been completed,
213*4882a593Smuzhiyun 	 * but was not, because of drbd_suspended() */
214*4882a593Smuzhiyun 	__RQ_COMPLETION_SUSP,
215*4882a593Smuzhiyun 
216*4882a593Smuzhiyun 	/* We expect a receive ACK (wire proto B) */
217*4882a593Smuzhiyun 	__RQ_EXP_RECEIVE_ACK,
218*4882a593Smuzhiyun 
219*4882a593Smuzhiyun 	/* We expect a write ACK (wite proto C) */
220*4882a593Smuzhiyun 	__RQ_EXP_WRITE_ACK,
221*4882a593Smuzhiyun 
222*4882a593Smuzhiyun 	/* waiting for a barrier ack, did an extra kref_get */
223*4882a593Smuzhiyun 	__RQ_EXP_BARR_ACK,
224*4882a593Smuzhiyun };
225*4882a593Smuzhiyun 
226*4882a593Smuzhiyun #define RQ_LOCAL_PENDING   (1UL << __RQ_LOCAL_PENDING)
227*4882a593Smuzhiyun #define RQ_LOCAL_COMPLETED (1UL << __RQ_LOCAL_COMPLETED)
228*4882a593Smuzhiyun #define RQ_LOCAL_OK        (1UL << __RQ_LOCAL_OK)
229*4882a593Smuzhiyun #define RQ_LOCAL_ABORTED   (1UL << __RQ_LOCAL_ABORTED)
230*4882a593Smuzhiyun 
231*4882a593Smuzhiyun #define RQ_LOCAL_MASK      ((RQ_LOCAL_ABORTED << 1)-1)
232*4882a593Smuzhiyun 
233*4882a593Smuzhiyun #define RQ_NET_PENDING     (1UL << __RQ_NET_PENDING)
234*4882a593Smuzhiyun #define RQ_NET_QUEUED      (1UL << __RQ_NET_QUEUED)
235*4882a593Smuzhiyun #define RQ_NET_SENT        (1UL << __RQ_NET_SENT)
236*4882a593Smuzhiyun #define RQ_NET_DONE        (1UL << __RQ_NET_DONE)
237*4882a593Smuzhiyun #define RQ_NET_OK          (1UL << __RQ_NET_OK)
238*4882a593Smuzhiyun #define RQ_NET_SIS         (1UL << __RQ_NET_SIS)
239*4882a593Smuzhiyun 
240*4882a593Smuzhiyun #define RQ_NET_MASK        (((1UL << __RQ_NET_MAX)-1) & ~RQ_LOCAL_MASK)
241*4882a593Smuzhiyun 
242*4882a593Smuzhiyun #define RQ_WRITE           (1UL << __RQ_WRITE)
243*4882a593Smuzhiyun #define RQ_WSAME           (1UL << __RQ_WSAME)
244*4882a593Smuzhiyun #define RQ_UNMAP           (1UL << __RQ_UNMAP)
245*4882a593Smuzhiyun #define RQ_ZEROES          (1UL << __RQ_ZEROES)
246*4882a593Smuzhiyun #define RQ_IN_ACT_LOG      (1UL << __RQ_IN_ACT_LOG)
247*4882a593Smuzhiyun #define RQ_UNPLUG          (1UL << __RQ_UNPLUG)
248*4882a593Smuzhiyun #define RQ_POSTPONED	   (1UL << __RQ_POSTPONED)
249*4882a593Smuzhiyun #define RQ_COMPLETION_SUSP (1UL << __RQ_COMPLETION_SUSP)
250*4882a593Smuzhiyun #define RQ_EXP_RECEIVE_ACK (1UL << __RQ_EXP_RECEIVE_ACK)
251*4882a593Smuzhiyun #define RQ_EXP_WRITE_ACK   (1UL << __RQ_EXP_WRITE_ACK)
252*4882a593Smuzhiyun #define RQ_EXP_BARR_ACK    (1UL << __RQ_EXP_BARR_ACK)
253*4882a593Smuzhiyun 
254*4882a593Smuzhiyun /* For waking up the frozen transfer log mod_req() has to return if the request
255*4882a593Smuzhiyun    should be counted in the epoch object*/
256*4882a593Smuzhiyun #define MR_WRITE       1
257*4882a593Smuzhiyun #define MR_READ        2
258*4882a593Smuzhiyun 
drbd_req_make_private_bio(struct drbd_request * req,struct bio * bio_src)259*4882a593Smuzhiyun static inline void drbd_req_make_private_bio(struct drbd_request *req, struct bio *bio_src)
260*4882a593Smuzhiyun {
261*4882a593Smuzhiyun 	struct bio *bio;
262*4882a593Smuzhiyun 	bio = bio_clone_fast(bio_src, GFP_NOIO, &drbd_io_bio_set);
263*4882a593Smuzhiyun 
264*4882a593Smuzhiyun 	req->private_bio = bio;
265*4882a593Smuzhiyun 
266*4882a593Smuzhiyun 	bio->bi_private  = req;
267*4882a593Smuzhiyun 	bio->bi_end_io   = drbd_request_endio;
268*4882a593Smuzhiyun 	bio->bi_next     = NULL;
269*4882a593Smuzhiyun }
270*4882a593Smuzhiyun 
271*4882a593Smuzhiyun /* Short lived temporary struct on the stack.
272*4882a593Smuzhiyun  * We could squirrel the error to be returned into
273*4882a593Smuzhiyun  * bio->bi_iter.bi_size, or similar. But that would be too ugly. */
274*4882a593Smuzhiyun struct bio_and_error {
275*4882a593Smuzhiyun 	struct bio *bio;
276*4882a593Smuzhiyun 	int error;
277*4882a593Smuzhiyun };
278*4882a593Smuzhiyun 
279*4882a593Smuzhiyun extern void start_new_tl_epoch(struct drbd_connection *connection);
280*4882a593Smuzhiyun extern void drbd_req_destroy(struct kref *kref);
281*4882a593Smuzhiyun extern void _req_may_be_done(struct drbd_request *req,
282*4882a593Smuzhiyun 		struct bio_and_error *m);
283*4882a593Smuzhiyun extern int __req_mod(struct drbd_request *req, enum drbd_req_event what,
284*4882a593Smuzhiyun 		struct bio_and_error *m);
285*4882a593Smuzhiyun extern void complete_master_bio(struct drbd_device *device,
286*4882a593Smuzhiyun 		struct bio_and_error *m);
287*4882a593Smuzhiyun extern void request_timer_fn(struct timer_list *t);
288*4882a593Smuzhiyun extern void tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
289*4882a593Smuzhiyun extern void _tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
290*4882a593Smuzhiyun extern void tl_abort_disk_io(struct drbd_device *device);
291*4882a593Smuzhiyun 
292*4882a593Smuzhiyun /* this is in drbd_main.c */
293*4882a593Smuzhiyun extern void drbd_restart_request(struct drbd_request *req);
294*4882a593Smuzhiyun 
295*4882a593Smuzhiyun /* use this if you don't want to deal with calling complete_master_bio()
296*4882a593Smuzhiyun  * outside the spinlock, e.g. when walking some list on cleanup. */
_req_mod(struct drbd_request * req,enum drbd_req_event what)297*4882a593Smuzhiyun static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what)
298*4882a593Smuzhiyun {
299*4882a593Smuzhiyun 	struct drbd_device *device = req->device;
300*4882a593Smuzhiyun 	struct bio_and_error m;
301*4882a593Smuzhiyun 	int rv;
302*4882a593Smuzhiyun 
303*4882a593Smuzhiyun 	/* __req_mod possibly frees req, do not touch req after that! */
304*4882a593Smuzhiyun 	rv = __req_mod(req, what, &m);
305*4882a593Smuzhiyun 	if (m.bio)
306*4882a593Smuzhiyun 		complete_master_bio(device, &m);
307*4882a593Smuzhiyun 
308*4882a593Smuzhiyun 	return rv;
309*4882a593Smuzhiyun }
310*4882a593Smuzhiyun 
311*4882a593Smuzhiyun /* completion of master bio is outside of our spinlock.
312*4882a593Smuzhiyun  * We still may or may not be inside some irqs disabled section
313*4882a593Smuzhiyun  * of the lower level driver completion callback, so we need to
314*4882a593Smuzhiyun  * spin_lock_irqsave here. */
req_mod(struct drbd_request * req,enum drbd_req_event what)315*4882a593Smuzhiyun static inline int req_mod(struct drbd_request *req,
316*4882a593Smuzhiyun 		enum drbd_req_event what)
317*4882a593Smuzhiyun {
318*4882a593Smuzhiyun 	unsigned long flags;
319*4882a593Smuzhiyun 	struct drbd_device *device = req->device;
320*4882a593Smuzhiyun 	struct bio_and_error m;
321*4882a593Smuzhiyun 	int rv;
322*4882a593Smuzhiyun 
323*4882a593Smuzhiyun 	spin_lock_irqsave(&device->resource->req_lock, flags);
324*4882a593Smuzhiyun 	rv = __req_mod(req, what, &m);
325*4882a593Smuzhiyun 	spin_unlock_irqrestore(&device->resource->req_lock, flags);
326*4882a593Smuzhiyun 
327*4882a593Smuzhiyun 	if (m.bio)
328*4882a593Smuzhiyun 		complete_master_bio(device, &m);
329*4882a593Smuzhiyun 
330*4882a593Smuzhiyun 	return rv;
331*4882a593Smuzhiyun }
332*4882a593Smuzhiyun 
333*4882a593Smuzhiyun extern bool drbd_should_do_remote(union drbd_dev_state);
334*4882a593Smuzhiyun 
335*4882a593Smuzhiyun #endif
336