summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher2011-01-13 23:05:39 +0100
committerPhilipp Reisner2011-08-25 14:57:58 +0200
commitd628769b3c6b4ddafea358944ef1f106fccfaaff (patch)
tree42fc5693c848b5486e3475a6b5051ec17b93f502 /drivers/block/drbd/drbd_main.c
parentdrbd: Magic reserved block_id value cleanup (diff)
downloadkernel-qcow2-linux-d628769b3c6b4ddafea358944ef1f106fccfaaff.tar.gz
kernel-qcow2-linux-d628769b3c6b4ddafea358944ef1f106fccfaaff.tar.xz
kernel-qcow2-linux-d628769b3c6b4ddafea358944ef1f106fccfaaff.zip
drbd: Move drbd_free_tl_hash() to drbd_main()
This is the only place where this function is used. Make it static. 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.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index f65b8c532248..eecbfc8f8978 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -228,6 +228,36 @@ static void tl_cleanup(struct drbd_conf *mdev)
mdev->tl_hash_s = 0;
}
+static void drbd_free_tl_hash(struct drbd_conf *mdev)
+{
+ struct hlist_head *h;
+
+ spin_lock_irq(&mdev->req_lock);
+
+ if (!mdev->tl_hash || mdev->state.conn != C_STANDALONE) {
+ spin_unlock_irq(&mdev->req_lock);
+ return;
+ }
+ /* paranoia code */
+ for (h = mdev->ee_hash; h < mdev->ee_hash + mdev->ee_hash_s; h++)
+ if (h->first)
+ dev_err(DEV, "ASSERT FAILED ee_hash[%u].first == %p, expected NULL\n",
+ (int)(h - mdev->ee_hash), h->first);
+ kfree(mdev->ee_hash);
+ mdev->ee_hash = NULL;
+ mdev->ee_hash_s = 0;
+
+ /* paranoia code */
+ for (h = mdev->tl_hash; h < mdev->tl_hash + mdev->tl_hash_s; h++)
+ if (h->first)
+ dev_err(DEV, "ASSERT FAILED tl_hash[%u] == %p, expected NULL\n",
+ (int)(h - mdev->tl_hash), h->first);
+ kfree(mdev->tl_hash);
+ mdev->tl_hash = NULL;
+ mdev->tl_hash_s = 0;
+ spin_unlock_irq(&mdev->req_lock);
+}
+
/**
* _tl_add_barrier() - Adds a barrier to the transfer log
* @mdev: DRBD device.