aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-04-22 15:20:23 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:49:05 +0100
commit1d041225999c6f6246494b02d8f9b405155b52e1 (patch)
treea6c249281d1ba58a267b5300d96be171dfce3b7d
parentf5e2b8b3b6bed8c60103b4ed5341af072129d7c0 (diff)
downloadvexpress-lsk-1d041225999c6f6246494b02d8f9b405155b52e1.tar.gz
drbd: Eliminated drbd_free_resoruces() it is superseeded by conn_free_crypto()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_int.h1
-rw-r--r--drivers/block/drbd/drbd_main.c35
2 files changed, 12 insertions, 24 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 30801922a97..0fb3fc32a99 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1046,7 +1046,6 @@ extern void drbd_calc_cpu_mask(struct drbd_tconn *tconn);
#define drbd_thread_current_set_cpu(A) ({})
#define drbd_calc_cpu_mask(A) ({})
#endif
-extern void drbd_free_resources(struct drbd_conf *mdev);
extern void tl_release(struct drbd_tconn *, unsigned int barrier_nr,
unsigned int set_size);
extern void tl_clear(struct drbd_tconn *);
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index bfea92297f6..b9c103f16ae 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2057,7 +2057,9 @@ void drbd_mdev_cleanup(struct drbd_conf *mdev)
drbd_bm_cleanup(mdev);
}
- drbd_free_resources(mdev);
+ drbd_free_bc(mdev->ldev);
+ mdev->ldev = NULL;
+
clear_bit(AL_SUSPENDED, &mdev->flags);
D_ASSERT(list_empty(&mdev->active_ee));
@@ -2252,7 +2254,8 @@ void drbd_delete_device(struct drbd_conf *mdev)
if (mdev->this_bdev)
bdput(mdev->this_bdev);
- drbd_free_resources(mdev);
+ drbd_free_bc(mdev->ldev);
+ mdev->ldev = NULL;
drbd_release_all_peer_reqs(mdev);
@@ -2387,11 +2390,18 @@ static void drbd_free_socket(struct drbd_socket *socket)
void conn_free_crypto(struct drbd_tconn *tconn)
{
+ drbd_free_sock(tconn);
+
+ crypto_free_hash(tconn->csums_tfm);
+ crypto_free_hash(tconn->verify_tfm);
crypto_free_hash(tconn->cram_hmac_tfm);
crypto_free_hash(tconn->integrity_w_tfm);
crypto_free_hash(tconn->integrity_r_tfm);
kfree(tconn->int_dig_in);
kfree(tconn->int_dig_vv);
+
+ tconn->csums_tfm = NULL;
+ tconn->verify_tfm = NULL;
tconn->cram_hmac_tfm = NULL;
tconn->integrity_w_tfm = NULL;
tconn->integrity_r_tfm = NULL;
@@ -2700,27 +2710,6 @@ void drbd_free_sock(struct drbd_tconn *tconn)
}
}
-
-void drbd_free_resources(struct drbd_conf *mdev)
-{
- crypto_free_hash(mdev->tconn->csums_tfm);
- mdev->tconn->csums_tfm = NULL;
- crypto_free_hash(mdev->tconn->verify_tfm);
- mdev->tconn->verify_tfm = NULL;
- crypto_free_hash(mdev->tconn->cram_hmac_tfm);
- mdev->tconn->cram_hmac_tfm = NULL;
- crypto_free_hash(mdev->tconn->integrity_w_tfm);
- mdev->tconn->integrity_w_tfm = NULL;
- crypto_free_hash(mdev->tconn->integrity_r_tfm);
- mdev->tconn->integrity_r_tfm = NULL;
-
- drbd_free_sock(mdev->tconn);
-
- __no_warn(local,
- drbd_free_bc(mdev->ldev);
- mdev->ldev = NULL;);
-}
-
/* meta data management */
struct meta_data_on_disk {