diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2013-06-25 10:50:08 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-06-28 10:04:36 -0400 |
commit | d752b2696072ed52fd5afab08b601e2220a3b87e (patch) | |
tree | a6a88c4af1c6e82575d58a68651f0156431d5c09 /include | |
parent | e96c96333fe5a4f252cc4e1d7edde8ee7dce7dfe (diff) |
drbd: Allow online change of al-stripes and al-stripe-size
Allow to change the AL layout with an resize operation. For that
the reisze command gets two new fields: al_stripes and al_stripe_size.
In order to make the operation crash save:
1) Lock out all IO and MD-IO
2) Write the super block with MDF_PRIMARY_IND clear
3) write the bitmap to the new location (all zeros, since
we allow only while connected)
4) Initialize the new AL-area
5) Write the super block with the restored MDF_PRIMARY_IND.
6) Unfreeze all IO
Since the AL-layout has no influence on the protocol, this operation
needs to be beforemed on both sides of a resource (if intended).
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/drbd.h | 6 | ||||
-rw-r--r-- | include/linux/drbd_genl.h | 2 | ||||
-rw-r--r-- | include/linux/drbd_limits.h | 9 |
3 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 1b4d4ee1168f..de7d74ab3de6 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -177,7 +177,11 @@ enum drbd_ret_code { | |||
177 | ERR_NEED_APV_100 = 163, | 177 | ERR_NEED_APV_100 = 163, |
178 | ERR_NEED_ALLOW_TWO_PRI = 164, | 178 | ERR_NEED_ALLOW_TWO_PRI = 164, |
179 | ERR_MD_UNCLEAN = 165, | 179 | ERR_MD_UNCLEAN = 165, |
180 | 180 | ERR_MD_LAYOUT_CONNECTED = 166, | |
181 | ERR_MD_LAYOUT_TOO_BIG = 167, | ||
182 | ERR_MD_LAYOUT_TOO_SMALL = 168, | ||
183 | ERR_MD_LAYOUT_NO_FIT = 169, | ||
184 | ERR_IMPLICIT_SHRINK = 170, | ||
181 | /* insert new ones above this line */ | 185 | /* insert new ones above this line */ |
182 | AFTER_LAST_ERR_CODE | 186 | AFTER_LAST_ERR_CODE |
183 | }; | 187 | }; |
diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h index d0d8fac8a6e4..e8c44572b8cb 100644 --- a/include/linux/drbd_genl.h +++ b/include/linux/drbd_genl.h | |||
@@ -181,6 +181,8 @@ GENL_struct(DRBD_NLA_RESIZE_PARMS, 7, resize_parms, | |||
181 | __u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size) | 181 | __u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size) |
182 | __flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force) | 182 | __flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force) |
183 | __flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync) | 183 | __flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync) |
184 | __u32_field_def(4, 0 /* OPTIONAL */, al_stripes, DRBD_AL_STRIPES_DEF) | ||
185 | __u32_field_def(5, 0 /* OPTIONAL */, al_stripe_size, DRBD_AL_STRIPE_SIZE_DEF) | ||
184 | ) | 186 | ) |
185 | 187 | ||
186 | GENL_struct(DRBD_NLA_STATE_INFO, 8, state_info, | 188 | GENL_struct(DRBD_NLA_STATE_INFO, 8, state_info, |
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 1fedf2b17cc8..17e50bb00521 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -215,4 +215,13 @@ | |||
215 | #define DRBD_ALWAYS_ASBP_DEF 0 | 215 | #define DRBD_ALWAYS_ASBP_DEF 0 |
216 | #define DRBD_USE_RLE_DEF 1 | 216 | #define DRBD_USE_RLE_DEF 1 |
217 | 217 | ||
218 | #define DRBD_AL_STRIPES_MIN 1 | ||
219 | #define DRBD_AL_STRIPES_MAX 1024 | ||
220 | #define DRBD_AL_STRIPES_DEF 1 | ||
221 | #define DRBD_AL_STRIPES_SCALE '1' | ||
222 | |||
223 | #define DRBD_AL_STRIPE_SIZE_MIN 4 | ||
224 | #define DRBD_AL_STRIPE_SIZE_MAX 16777216 | ||
225 | #define DRBD_AL_STRIPE_SIZE_DEF 32 | ||
226 | #define DRBD_AL_STRIPE_SIZE_SCALE 'k' /* kilobytes */ | ||
218 | #endif | 227 | #endif |