mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 03:47:43 +00:00
drbd: mechanically rename la_size to la_size_sect
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>
This commit is contained in:
parent
68e41a43f1
commit
cccac9857d
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user