Philipp Reisner
bd0c824a9d
drbd: Use the idr_for_each_entry() iterator instead of idr_for_each()
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:56 +01:00
Andreas Gruenbacher
4a76b1612f
drbd: Map from (connection, volume number) to device in the receive handlers
...
The receive handlers do not all handle unknown volume numbers the same
way.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:56 +01:00
Andreas Gruenbacher
e28572167c
drbd: Pass struct packet_info down to the receive functions
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:56 +01:00
Andreas Gruenbacher
49ba9b1bb3
drbd: Remove useless error messages
...
These messages can only trigger in case there is a pretty obvious
internal programming error.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:55 +01:00
Andreas Gruenbacher
deebe19579
drbd: A small cleanup in drbdd()
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:55 +01:00
Andreas Gruenbacher
79ed9bd053
drbd: _drbd_send_bitmap(): Use the pre-allocated send buffer
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:54 +01:00
Andreas Gruenbacher
5a87d920f3
drbd: Preallocate one page per drbd_socket as a send buffer
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:54 +01:00
Andreas Gruenbacher
fc56815c81
drbd: receive_bitmap(): Use the pre-allocated receive buffer
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:54 +01:00
Andreas Gruenbacher
e6ef8a5cb3
drbd: Preallocate one page per drbd_socket as a receive buffer
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:53 +01:00
Philipp Reisner
cb703454a2
drbd: Converted drbd_try_outdate_peer() from mdev to tconn
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:53 +01:00
Andreas Gruenbacher
a02d124091
drbd: Rename the DCBP_* functions to dcbp_* and move them to where they are used
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:52 +01:00
Andreas Gruenbacher
058820cdd7
drbd: Make _drbd_send_bitmap() static
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:52 +01:00
Andreas Gruenbacher
e307f352b4
drbd: Move drbd_send_ping() and drbd_send_ping_ack() to drbd_main.c
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:52 +01:00
Andreas Gruenbacher
0916e0e308
drbd: Always use the same protocol version for the same peer
...
There is no need to send protocol 80 headers to peers that understand
protocol 95 headers. Make sure that we don't send protocol 95 headers
until we have agreed upon a protocol version with our peer, though.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:51 +01:00
Andreas Gruenbacher
0829f5edf3
drbd: drbd_connected(): Return an error code upon failure.
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:51 +01:00
Andreas Gruenbacher
a5c3190435
drbd: Introduce and use drbd_recv_all_warn()
...
The pattern of receiving a fixed number of bytes and warning if a short
packet is received and the receiver has not actively been interruped is
repeated many times; clean that up.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:50 +01:00
Andreas Gruenbacher
309a834896
drbd: Get rid of typedef drbd_work_cb
...
This type is not used anywhere else.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:50 +01:00
Andreas Gruenbacher
8f7bed7774
drbd: Rename various functions from *_oos_* to *_out_of_sync_* for clarity
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:50 +01:00
Andreas Gruenbacher
0da34df0d0
drbd: drbd_may_do_local_read(): Use bool/true/false
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:49 +01:00
Andreas Gruenbacher
1097e9a80c
drbd: Remove unnecessary assertion
...
This is also checked further below in the same function.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:49 +01:00
Andreas Gruenbacher
69f5ec728c
drbd: Remove duplicate initialization
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:49 +01:00
Andreas Gruenbacher
3fbf4d21ae
drbd: drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:48 +01:00
Andreas Gruenbacher
ac29f4039a
drbd: _drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:48 +01:00
Andreas Gruenbacher
22ab6a30b8
drbd: drbd_bm_read() never returns a positive value through drbd_bitmap_io()
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:47 +01:00
Andreas Gruenbacher
82bc01940a
drbd: Make all command handlers return 0 upon success and an error code otherwise
...
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com >
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com >
2012-11-08 16:44:47 +01:00