]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drbd: Inlined drbd_free_mdev(); it got called only from one place
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 12 Apr 2011 04:24:24 +0000 (21:24 -0700)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:45:16 +0000 (16:45 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_main.c

index ce56aa08314edd3e0b3411803e1ecd6a075e24f1..c49dc085d93a034d637b6ad1a74f1a61b9da9986 100644 (file)
@@ -1366,7 +1366,6 @@ extern rwlock_t global_state_lock;
 
 extern int conn_lowest_minor(struct drbd_tconn *tconn);
 enum drbd_ret_code conn_new_minor(struct drbd_tconn *tconn, unsigned int minor, int vnr);
-extern void drbd_free_mdev(struct drbd_conf *mdev);
 extern void drbd_delete_device(struct drbd_conf *mdev);
 
 struct drbd_tconn *drbd_new_tconn(const char *name);
index 93a16db8a9998e6092ee9b402eb66fe221099eab..563427bfc274233a461397e7b70a85afea6c0818 100644 (file)
@@ -2233,10 +2233,13 @@ void drbd_delete_device(struct drbd_conf *mdev)
        kfree(mdev->p_uuid);
        /* mdev->p_uuid = NULL; */
 
-       /* cleanup the rest that has been
-        * allocated from drbd_new_device
-        * and actually free the mdev itself */
-       drbd_free_mdev(mdev);
+       kfree(mdev->current_epoch);
+       if (mdev->bitmap) /* should no longer be there. */
+               drbd_bm_cleanup(mdev);
+       __free_page(mdev->md_io_page);
+       put_disk(mdev->vdisk);
+       blk_cleanup_queue(mdev->rq_queue);
+       kfree(mdev);
 }
 
 static void drbd_cleanup(void)
@@ -2551,20 +2554,6 @@ out_no_q:
        return err;
 }
 
-/* counterpart of drbd_new_device.
- * last part of drbd_delete_device. */
-void drbd_free_mdev(struct drbd_conf *mdev)
-{
-       kfree(mdev->current_epoch);
-       if (mdev->bitmap) /* should no longer be there. */
-               drbd_bm_cleanup(mdev);
-       __free_page(mdev->md_io_page);
-       put_disk(mdev->vdisk);
-       blk_cleanup_queue(mdev->rq_queue);
-       kfree(mdev);
-}
-
-
 int __init drbd_init(void)
 {
        int err;