drbd: remove ->this_bdev
[linux-2.6-microblaze.git] / drivers / block / drbd / drbd_receiver.c
index 1d17593..dc333db 100644 (file)
@@ -1797,7 +1797,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
                        break;
                else
                        drbd_warn(connection, "Allocation of an epoch failed, slowing down\n");
-                       /* Fall through */
+               fallthrough;
 
        case WO_BDEV_FLUSH:
        case WO_DRAIN_IO:
@@ -1860,7 +1860,7 @@ read_in_block(struct drbd_peer_device *peer_device, u64 id, sector_t sector,
              struct packet_info *pi) __must_hold(local)
 {
        struct drbd_device *device = peer_device->device;
-       const sector_t capacity = drbd_get_capacity(device->this_bdev);
+       const sector_t capacity = get_capacity(device->vdisk);
        struct drbd_peer_request *peer_req;
        struct page *page;
        int digest_size, err;
@@ -2789,7 +2789,7 @@ bool drbd_rs_should_slow_down(struct drbd_device *device, sector_t sector,
 
 bool drbd_rs_c_min_rate_throttle(struct drbd_device *device)
 {
-       struct gendisk *disk = device->ldev->backing_bdev->bd_contains->bd_disk;
+       struct gendisk *disk = device->ldev->backing_bdev->bd_disk;
        unsigned long db, dt, dbdt;
        unsigned int c_min_rate;
        int curr_events;
@@ -2849,7 +2849,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
        if (!peer_device)
                return -EIO;
        device = peer_device->device;
-       capacity = drbd_get_capacity(device->this_bdev);
+       capacity = get_capacity(device->vdisk);
 
        sector = be64_to_cpu(p->sector);
        size   = be32_to_cpu(p->blksize);
@@ -2917,7 +2917,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
                   then we would do something smarter here than reading
                   the block... */
                peer_req->flags |= EE_RS_THIN_REQ;
-               /* fall through */
+               fallthrough;
        case P_RS_DATA_REQUEST:
                peer_req->w.cb = w_e_end_rsdata_req;
                fault_type = DRBD_FAULT_RS_RD;
@@ -3083,7 +3083,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
                        rv =  1;
                        break;
                }
-               /* Else fall through - to one of the other strategies... */
+               fallthrough;    /* to one of the other strategies */
        case ASB_DISCARD_OLDER_PRI:
                if (self == 0 && peer == 1) {
                        rv = 1;
@@ -3096,7 +3096,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
                /* Else fall through to one of the other strategies... */
                drbd_warn(device, "Discard younger/older primary did not find a decision\n"
                     "Using discard-least-changes instead\n");
-               /* fall through */
+               fallthrough;
        case ASB_DISCARD_ZERO_CHG:
                if (ch_peer == 0 && ch_self == 0) {
                        rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)
@@ -3108,7 +3108,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
                }
                if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
                        break;
-               /* else, fall through */
+               fallthrough;
        case ASB_DISCARD_LEAST_CHG:
                if      (ch_self < ch_peer)
                        rv = -1;
@@ -3608,7 +3608,7 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_peer_device *peer_device,
                switch (rr_conflict) {
                case ASB_CALL_HELPER:
                        drbd_khelper(device, "pri-lost");
-                       /* fall through */
+                       fallthrough;
                case ASB_DISCONNECT:
                        drbd_err(device, "I shall become SyncTarget, but I am primary!\n");
                        return C_MASK;
@@ -4117,7 +4117,7 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info
        if (!peer_device)
                return config_unknown_volume(connection, pi);
        device = peer_device->device;
-       cur_size = drbd_get_capacity(device->this_bdev);
+       cur_size = get_capacity(device->vdisk);
 
        p_size = be64_to_cpu(p->d_size);
        p_usize = be64_to_cpu(p->u_size);
@@ -4252,8 +4252,8 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info
        }
 
        if (device->state.conn > C_WF_REPORT_PARAMS) {
-               if (be64_to_cpu(p->c_size) !=
-                   drbd_get_capacity(device->this_bdev) || ldsc) {
+               if (be64_to_cpu(p->c_size) != get_capacity(device->vdisk) ||
+                   ldsc) {
                        /* we have different sizes, probably peer
                         * needs to know my new size... */
                        drbd_send_sizes(peer_device, 0, ddsf);