activemap.c (225787) | activemap.c (229778) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sbin/hastd/activemap.c 225787 2011-09-27 08:50:37Z pjd $"); | 31__FBSDID("$FreeBSD: head/sbin/hastd/activemap.c 229778 2012-01-07 16:09:33Z uqs $"); |
32 33#include <sys/param.h> /* powerof2() */ 34#include <sys/queue.h> 35 36#include <bitstring.h> 37#include <errno.h> 38#include <stdint.h> 39#include <stdio.h> --- 174 unchanged lines hidden (view full) --- 214static bool 215keepdirty_add(struct activemap *amp, int extent) 216{ 217 struct keepdirty *kd; 218 219 kd = keepdirty_find(amp, extent); 220 if (kd != NULL) { 221 /* | 32 33#include <sys/param.h> /* powerof2() */ 34#include <sys/queue.h> 35 36#include <bitstring.h> 37#include <errno.h> 38#include <stdint.h> 39#include <stdio.h> --- 174 unchanged lines hidden (view full) --- 214static bool 215keepdirty_add(struct activemap *amp, int extent) 216{ 217 struct keepdirty *kd; 218 219 kd = keepdirty_find(amp, extent); 220 if (kd != NULL) { 221 /* |
222 * Only move element at the begining. | 222 * Only move element at the beginning. |
223 */ 224 TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); 225 TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); 226 return (false); 227 } 228 /* 229 * Add new element, but first remove the most unused one if 230 * we have too many. --- 337 unchanged lines hidden (view full) --- 568 569 bit_ffs(amp->am_syncmap, amp->am_nextents, &ext); 570 if (ext == -1) { 571 /* There are no extents to synchronize. */ 572 amp->am_syncoff = -2; 573 return; 574 } 575 /* | 223 */ 224 TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); 225 TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); 226 return (false); 227 } 228 /* 229 * Add new element, but first remove the most unused one if 230 * we have too many. --- 337 unchanged lines hidden (view full) --- 568 569 bit_ffs(amp->am_syncmap, amp->am_nextents, &ext); 570 if (ext == -1) { 571 /* There are no extents to synchronize. */ 572 amp->am_syncoff = -2; 573 return; 574 } 575 /* |
576 * Mark that we want to start synchronization from the begining. | 576 * Mark that we want to start synchronization from the beginning. |
577 */ 578 amp->am_syncoff = -1; 579} 580 581/* 582 * Return next offset of where we should synchronize. 583 */ 584off_t --- 117 unchanged lines hidden --- | 577 */ 578 amp->am_syncoff = -1; 579} 580 581/* 582 * Return next offset of where we should synchronize. 583 */ 584off_t --- 117 unchanged lines hidden --- |