drbd: mechanically rename la_size to la_size_sect
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 19 Mar 2013 17:16:46 +0000 (18:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Sat, 23 Mar 2013 00:13:59 +0000 (18:13 -0600)
Make it obvious that this value is in units of 512 Byte sectors.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_receiver.c

index 7a2e07b45ecfec278dcb383fd3453051089492fd..6b956fc04dc8dc4f73b7fc98f680fed9139f29b5 100644 (file)
@@ -2836,7 +2836,7 @@ void conn_md_sync(struct drbd_tconn *tconn)
 
 /* aligned 4kByte */
 struct meta_data_on_disk {
-       u64 la_size;           /* last agreed size. */
+       u64 la_size_sect;      /* last agreed size. */
        u64 uuid[UI_SIZE];   /* UUIDs. */
        u64 device_uuid;
        u64 reserved_u64_1;
@@ -2887,7 +2887,7 @@ void drbd_md_sync(struct drbd_conf *mdev)
 
        memset(buffer, 0, sizeof(*buffer));
 
-       buffer->la_size = cpu_to_be64(drbd_get_capacity(mdev->this_bdev));
+       buffer->la_size_sect = cpu_to_be64(drbd_get_capacity(mdev->this_bdev));
        for (i = UI_CURRENT; i < UI_SIZE; i++)
                buffer->uuid[i] = cpu_to_be64(mdev->ldev->md.uuid[i]);
        buffer->flags = cpu_to_be32(mdev->ldev->md.flags);
@@ -3049,7 +3049,7 @@ int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)
 
        rv = NO_ERROR;
 
-       bdev->md.la_size_sect = be64_to_cpu(buffer->la_size);
+       bdev->md.la_size_sect = be64_to_cpu(buffer->la_size_sect);
        for (i = UI_CURRENT; i < UI_SIZE; i++)
                bdev->md.uuid[i] = be64_to_cpu(buffer->uuid[i]);
        bdev->md.flags = be32_to_cpu(buffer->flags);
index 5621df86967aea4e0b91346058d06c999e916603..d5211b06df45bae091fb7908fded2c9a1ef22317 100644 (file)
@@ -819,7 +819,7 @@ void drbd_resume_io(struct drbd_conf *mdev)
 enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags) __must_hold(local)
 {
        sector_t prev_first_sect, prev_size; /* previous meta location */
-       sector_t la_size, u_size;
+       sector_t la_size_sect, u_size;
        sector_t size;
        char ppb[10];
 
@@ -842,7 +842,7 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds
 
        prev_first_sect = drbd_md_first_sector(mdev->ldev);
        prev_size = mdev->ldev->md.md_size_sect;
-       la_size = mdev->ldev->md.la_size_sect;
+       la_size_sect = mdev->ldev->md.la_size_sect;
 
        /* TODO: should only be some assert here, not (re)init... */
        drbd_md_set_sector_offsets(mdev, mdev->ldev);
@@ -878,7 +878,7 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds
        if (rv == dev_size_error)
                goto out;
 
-       la_size_changed = (la_size != mdev->ldev->md.la_size_sect);
+       la_size_changed = (la_size_sect != mdev->ldev->md.la_size_sect);
 
        md_moved = prev_first_sect != drbd_md_first_sector(mdev->ldev)
                || prev_size       != mdev->ldev->md.md_size_sect;
@@ -900,9 +900,9 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds
                drbd_md_mark_dirty(mdev);
        }
 
-       if (size > la_size)
+       if (size > la_size_sect)
                rv = grew;
-       if (size < la_size)
+       if (size < la_size_sect)
                rv = shrunk;
 out:
        lc_unlock(mdev->act_log);
@@ -917,7 +917,7 @@ drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev,
                  sector_t u_size, int assume_peer_has_space)
 {
        sector_t p_size = mdev->p_size;   /* partner's disk size. */
-       sector_t la_size = bdev->md.la_size_sect; /* last agreed size. */
+       sector_t la_size_sect = bdev->md.la_size_sect; /* last agreed size. */
        sector_t m_size; /* my size */
        sector_t size = 0;
 
@@ -931,8 +931,8 @@ drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev,
        if (p_size && m_size) {
                size = min_t(sector_t, p_size, m_size);
        } else {
-               if (la_size) {
-                       size = la_size;
+               if (la_size_sect) {
+                       size = la_size_sect;
                        if (m_size && m_size < size)
                                size = m_size;
                        if (p_size && p_size < size)
index a9eccfc6079b02e6fb2f9838a1728b76c9599582..8172a2cfdeadf9ea9004352a1edc6be0a5798162 100644 (file)
@@ -3992,7 +3992,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
 
        clear_bit(DISCARD_MY_DATA, &mdev->flags);
 
-       drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
+       drbd_md_sync(mdev); /* update connected indicator, la_size_sect, ... */
 
        return 0;
 }