summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher2011-01-26 18:45:11 +0100
committerPhilipp Reisner2011-09-28 10:26:28 +0200
commit9e204cddaf76d19ce0e84f025b0946110694dbfb (patch)
tree1aa2b56518366033498a404bb4b35954894851d9 /drivers/block/drbd/drbd_main.c
parentdrbd: Move sequence number logic into drbd_receiver.c and simplify it (diff)
downloadkernel-qcow2-linux-9e204cddaf76d19ce0e84f025b0946110694dbfb.tar.gz
kernel-qcow2-linux-9e204cddaf76d19ce0e84f025b0946110694dbfb.tar.xz
kernel-qcow2-linux-9e204cddaf76d19ce0e84f025b0946110694dbfb.zip
drbd: Move some functions to where they are used
Move drbd_update_congested() to drbd_main.c, and drbd_req_new() and drbd_req_free() to drbd_req.c: those functions are not used anywhere else. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 701f231cf4bf..5da1df023a49 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2528,6 +2528,13 @@ static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *
return drop_it; /* && (mdev->state == R_PRIMARY) */;
}
+static void drbd_update_congested(struct drbd_conf *mdev)
+{
+ struct sock *sk = mdev->tconn->data.socket->sk;
+ if (sk->sk_wmem_queued > sk->sk_sndbuf * 4 / 5)
+ set_bit(NET_CONGESTED, &mdev->flags);
+}
+
/* The idea of sendpage seems to be to put some kind of reference
* to the page into the skb, and to hand it over to the NIC. In
* this process get_page() gets called.