diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2013-03-19 13:16:46 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-03-22 20:13:59 -0400 |
commit | cccac9857d624dab74b23bafe0482fcdd91df7d8 (patch) | |
tree | a890dc06c096cf2ecdaf6f8cf8f3fd5652fd8799 /drivers/block/drbd | |
parent | 68e41a43f18b681f83329c8ad83123571bb8db0d (diff) |
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>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 16 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 7a2e07b45ecf..6b956fc04dc8 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2836,7 +2836,7 @@ void conn_md_sync(struct drbd_tconn *tconn) | |||
2836 | 2836 | ||
2837 | /* aligned 4kByte */ | 2837 | /* aligned 4kByte */ |
2838 | struct meta_data_on_disk { | 2838 | struct meta_data_on_disk { |
2839 | u64 la_size; /* last agreed size. */ | 2839 | u64 la_size_sect; /* last agreed size. */ |
2840 | u64 uuid[UI_SIZE]; /* UUIDs. */ | 2840 | u64 uuid[UI_SIZE]; /* UUIDs. */ |
2841 | u64 device_uuid; | 2841 | u64 device_uuid; |
2842 | u64 reserved_u64_1; | 2842 | u64 reserved_u64_1; |
@@ -2887,7 +2887,7 @@ void drbd_md_sync(struct drbd_conf *mdev) | |||
2887 | 2887 | ||
2888 | memset(buffer, 0, sizeof(*buffer)); | 2888 | memset(buffer, 0, sizeof(*buffer)); |
2889 | 2889 | ||
2890 | buffer->la_size = cpu_to_be64(drbd_get_capacity(mdev->this_bdev)); | 2890 | buffer->la_size_sect = cpu_to_be64(drbd_get_capacity(mdev->this_bdev)); |
2891 | for (i = UI_CURRENT; i < UI_SIZE; i++) | 2891 | for (i = UI_CURRENT; i < UI_SIZE; i++) |
2892 | buffer->uuid[i] = cpu_to_be64(mdev->ldev->md.uuid[i]); | 2892 | buffer->uuid[i] = cpu_to_be64(mdev->ldev->md.uuid[i]); |
2893 | buffer->flags = cpu_to_be32(mdev->ldev->md.flags); | 2893 | 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) | |||
3049 | 3049 | ||
3050 | rv = NO_ERROR; | 3050 | rv = NO_ERROR; |
3051 | 3051 | ||
3052 | bdev->md.la_size_sect = be64_to_cpu(buffer->la_size); | 3052 | bdev->md.la_size_sect = be64_to_cpu(buffer->la_size_sect); |
3053 | for (i = UI_CURRENT; i < UI_SIZE; i++) | 3053 | for (i = UI_CURRENT; i < UI_SIZE; i++) |
3054 | bdev->md.uuid[i] = be64_to_cpu(buffer->uuid[i]); | 3054 | bdev->md.uuid[i] = be64_to_cpu(buffer->uuid[i]); |
3055 | bdev->md.flags = be32_to_cpu(buffer->flags); | 3055 | bdev->md.flags = be32_to_cpu(buffer->flags); |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 5621df86967a..d5211b06df45 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -819,7 +819,7 @@ void drbd_resume_io(struct drbd_conf *mdev) | |||
819 | enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags) __must_hold(local) | 819 | enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags) __must_hold(local) |
820 | { | 820 | { |
821 | sector_t prev_first_sect, prev_size; /* previous meta location */ | 821 | sector_t prev_first_sect, prev_size; /* previous meta location */ |
822 | sector_t la_size, u_size; | 822 | sector_t la_size_sect, u_size; |
823 | sector_t size; | 823 | sector_t size; |
824 | char ppb[10]; | 824 | char ppb[10]; |
825 | 825 | ||
@@ -842,7 +842,7 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds | |||
842 | 842 | ||
843 | prev_first_sect = drbd_md_first_sector(mdev->ldev); | 843 | prev_first_sect = drbd_md_first_sector(mdev->ldev); |
844 | prev_size = mdev->ldev->md.md_size_sect; | 844 | prev_size = mdev->ldev->md.md_size_sect; |
845 | la_size = mdev->ldev->md.la_size_sect; | 845 | la_size_sect = mdev->ldev->md.la_size_sect; |
846 | 846 | ||
847 | /* TODO: should only be some assert here, not (re)init... */ | 847 | /* TODO: should only be some assert here, not (re)init... */ |
848 | drbd_md_set_sector_offsets(mdev, mdev->ldev); | 848 | 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 | |||
878 | if (rv == dev_size_error) | 878 | if (rv == dev_size_error) |
879 | goto out; | 879 | goto out; |
880 | 880 | ||
881 | la_size_changed = (la_size != mdev->ldev->md.la_size_sect); | 881 | la_size_changed = (la_size_sect != mdev->ldev->md.la_size_sect); |
882 | 882 | ||
883 | md_moved = prev_first_sect != drbd_md_first_sector(mdev->ldev) | 883 | md_moved = prev_first_sect != drbd_md_first_sector(mdev->ldev) |
884 | || prev_size != mdev->ldev->md.md_size_sect; | 884 | || 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 | |||
900 | drbd_md_mark_dirty(mdev); | 900 | drbd_md_mark_dirty(mdev); |
901 | } | 901 | } |
902 | 902 | ||
903 | if (size > la_size) | 903 | if (size > la_size_sect) |
904 | rv = grew; | 904 | rv = grew; |
905 | if (size < la_size) | 905 | if (size < la_size_sect) |
906 | rv = shrunk; | 906 | rv = shrunk; |
907 | out: | 907 | out: |
908 | lc_unlock(mdev->act_log); | 908 | lc_unlock(mdev->act_log); |
@@ -917,7 +917,7 @@ drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev, | |||
917 | sector_t u_size, int assume_peer_has_space) | 917 | sector_t u_size, int assume_peer_has_space) |
918 | { | 918 | { |
919 | sector_t p_size = mdev->p_size; /* partner's disk size. */ | 919 | sector_t p_size = mdev->p_size; /* partner's disk size. */ |
920 | sector_t la_size = bdev->md.la_size_sect; /* last agreed size. */ | 920 | sector_t la_size_sect = bdev->md.la_size_sect; /* last agreed size. */ |
921 | sector_t m_size; /* my size */ | 921 | sector_t m_size; /* my size */ |
922 | sector_t size = 0; | 922 | sector_t size = 0; |
923 | 923 | ||
@@ -931,8 +931,8 @@ drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev, | |||
931 | if (p_size && m_size) { | 931 | if (p_size && m_size) { |
932 | size = min_t(sector_t, p_size, m_size); | 932 | size = min_t(sector_t, p_size, m_size); |
933 | } else { | 933 | } else { |
934 | if (la_size) { | 934 | if (la_size_sect) { |
935 | size = la_size; | 935 | size = la_size_sect; |
936 | if (m_size && m_size < size) | 936 | if (m_size && m_size < size) |
937 | size = m_size; | 937 | size = m_size; |
938 | if (p_size && p_size < size) | 938 | if (p_size && p_size < size) |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index a9eccfc6079b..8172a2cfdead 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3992,7 +3992,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3992 | 3992 | ||
3993 | clear_bit(DISCARD_MY_DATA, &mdev->flags); | 3993 | clear_bit(DISCARD_MY_DATA, &mdev->flags); |
3994 | 3994 | ||
3995 | drbd_md_sync(mdev); /* update connected indicator, la_size, ... */ | 3995 | drbd_md_sync(mdev); /* update connected indicator, la_size_sect, ... */ |
3996 | 3996 | ||
3997 | return 0; | 3997 | return 0; |
3998 | } | 3998 | } |