diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-03-24 10:51:26 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:14:04 -0400 |
commit | d845030f21859dd11bcecc7e1b8575fb845eb425 (patch) | |
tree | 4b1a5bcf9389bf0e7eb31aa762b2a37ba6070cf4 /drivers/block | |
parent | 3a11a4878939e0e3c355bf3f52ef642a4cb6ba84 (diff) |
drbd: made determin_dev_size's parameter an flag enum
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index d6f1ae342b1d..f5c56f4fd2a3 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1382,8 +1382,12 @@ extern void drbd_suspend_io(struct drbd_conf *mdev); | |||
1382 | extern void drbd_resume_io(struct drbd_conf *mdev); | 1382 | extern void drbd_resume_io(struct drbd_conf *mdev); |
1383 | extern char *ppsize(char *buf, unsigned long long size); | 1383 | extern char *ppsize(char *buf, unsigned long long size); |
1384 | extern sector_t drbd_new_dev_size(struct drbd_conf *, struct drbd_backing_dev *, int); | 1384 | extern sector_t drbd_new_dev_size(struct drbd_conf *, struct drbd_backing_dev *, int); |
1385 | enum dds_flags { | ||
1386 | DDSF_FORCED = 1, | ||
1387 | DDSF_NO_RESYNC = 2, /* Do not run a resync for the new space */ | ||
1388 | }; | ||
1385 | enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 }; | 1389 | enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 }; |
1386 | extern enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *, int force) __must_hold(local); | 1390 | extern enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *, enum dds_flags) __must_hold(local); |
1387 | extern void resync_after_online_grow(struct drbd_conf *); | 1391 | extern void resync_after_online_grow(struct drbd_conf *); |
1388 | extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local); | 1392 | extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local); |
1389 | extern int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, | 1393 | extern int drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 6429d2b19e06..97abbc2acc5c 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -510,7 +510,7 @@ void drbd_resume_io(struct drbd_conf *mdev) | |||
510 | * Returns 0 on success, negative return values indicate errors. | 510 | * Returns 0 on success, negative return values indicate errors. |
511 | * You should call drbd_md_sync() after calling this function. | 511 | * You should call drbd_md_sync() after calling this function. |
512 | */ | 512 | */ |
513 | enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *mdev, int force) __must_hold(local) | 513 | enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *mdev, enum dds_flags flags) __must_hold(local) |
514 | { | 514 | { |
515 | sector_t prev_first_sect, prev_size; /* previous meta location */ | 515 | sector_t prev_first_sect, prev_size; /* previous meta location */ |
516 | sector_t la_size; | 516 | sector_t la_size; |
@@ -541,7 +541,7 @@ enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *mdev, int force | |||
541 | /* TODO: should only be some assert here, not (re)init... */ | 541 | /* TODO: should only be some assert here, not (re)init... */ |
542 | drbd_md_set_sector_offsets(mdev, mdev->ldev); | 542 | drbd_md_set_sector_offsets(mdev, mdev->ldev); |
543 | 543 | ||
544 | size = drbd_new_dev_size(mdev, mdev->ldev, force); | 544 | size = drbd_new_dev_size(mdev, mdev->ldev, flags & DDSF_FORCED); |
545 | 545 | ||
546 | if (drbd_get_capacity(mdev->this_bdev) != size || | 546 | if (drbd_get_capacity(mdev->this_bdev) != size || |
547 | drbd_bm_capacity(mdev) != size) { | 547 | drbd_bm_capacity(mdev) != size) { |
@@ -1508,7 +1508,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, | |||
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | mdev->ldev->dc.disk_size = (sector_t)rs.resize_size; | 1510 | mdev->ldev->dc.disk_size = (sector_t)rs.resize_size; |
1511 | dd = drbd_determin_dev_size(mdev, rs.resize_force); | 1511 | dd = drbd_determin_dev_size(mdev, rs.resize_force ? DDSF_FORCED : 0); |
1512 | drbd_md_sync(mdev); | 1512 | drbd_md_sync(mdev); |
1513 | put_ldev(mdev); | 1513 | put_ldev(mdev); |
1514 | if (dd == dev_size_error) { | 1514 | if (dd == dev_size_error) { |