diff options
author | Neil Brown <neilb@suse.de> | 2008-05-27 09:18:38 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-05-27 09:18:38 +1000 |
commit | 4e5528c6f7b66f40617dabb232bc6c016bb86204 (patch) | |
tree | 2350d3462e587c1a28ea19f2aa908bc368cc3d57 /super-intel.c | |
parent | d52690acc48b3dcea1785d038fa12fc3de11d0a1 (diff) | |
download | mdadm-4e5528c6f7b66f40617dabb232bc6c016bb86204.tar.gz mdadm-4e5528c6f7b66f40617dabb232bc6c016bb86204.tar.xz mdadm-4e5528c6f7b66f40617dabb232bc6c016bb86204.zip |
Implement mark_clean for ddf and remove mark_dirty and mark_sync
mark_dirty is just a special case of mark_clean - with sync_pos == 0.
mark_sync is not required. We don't modify the metadata when sync
finishes. Only when the array becomes non-writeable at which point we
use mark_clean to record how far the resync progressed.
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/super-intel.c b/super-intel.c index a72d0de..b57e9b1 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1129,23 +1129,12 @@ static void imsm_mark_clean(struct active_array *a, unsigned long long sync_pos) int inst = a->info.container_member; struct intel_super *super = a->container->sb; struct imsm_dev *dev = get_imsm_dev(super->mpb, inst); + int dirty = (sync_pos != ~0ULL); - if (dev->vol.dirty) { - fprintf(stderr, "imsm: mark clean %llu\n", sync_pos); - dev->vol.dirty = 0; - super->updates_pending++; - } -} + if (dev->vol.dirty != dirty) { + fprintf(stderr, "imsm: mark 'clean' %llu\n", sync_pos); -static void imsm_mark_dirty(struct active_array *a) -{ - int inst = a->info.container_member; - struct intel_super *super = a->container->sb; - struct imsm_dev *dev = get_imsm_dev(super->mpb, inst); - - if (!dev->vol.dirty) { - fprintf(stderr, "imsm: mark dirty\n"); - dev->vol.dirty = 1; + dev->vol.dirty = dirty; super->updates_pending++; } } @@ -1227,30 +1216,6 @@ static int imsm_count_failed(struct imsm_super *mpb, struct imsm_map *map) return failed; } -static void imsm_mark_sync(struct active_array *a, unsigned long long resync) -{ - int inst = a->info.container_member; - struct intel_super *super = a->container->sb; - struct imsm_dev *dev = get_imsm_dev(super->mpb, inst); - struct imsm_map *map = dev->vol.map; - int failed; - __u8 map_state; - - if (resync != ~0ULL) - return; - - fprintf(stderr, "imsm: mark sync\n"); - - failed = imsm_count_failed(super->mpb, map); - map_state = imsm_check_degraded(super->mpb, inst, failed); - if (!failed) - map_state = IMSM_T_STATE_NORMAL; - if (map->map_state != map_state) { - map->map_state = map_state; - super->updates_pending++; - } -} - static void imsm_set_disk(struct active_array *a, int n, int state) { int inst = a->info.container_member; @@ -1392,8 +1357,6 @@ struct superswitch super_imsm = { .open_new = imsm_open_new, .load_super = load_super_imsm, .mark_clean = imsm_mark_clean, - .mark_dirty = imsm_mark_dirty, - .mark_sync = imsm_mark_sync, .set_disk = imsm_set_disk, .sync_metadata = imsm_sync_metadata, }; |