secondary.c (209185) | secondary.c (210879) |
---|---|
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/secondary.c 209185 2010-06-14 21:46:48Z pjd $"); | 31__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 210879 2010-08-05 18:56:24Z pjd $"); |
32 33#include <sys/param.h> 34#include <sys/time.h> 35#include <sys/bio.h> 36#include <sys/disk.h> 37#include <sys/stat.h> 38 39#include <assert.h> --- 82 unchanged lines hidden (view full) --- 122 cv_init(&hio_send_list_cond); 123 124 /* 125 * Allocate requests pool and initialize requests. 126 */ 127 for (ii = 0; ii < HAST_HIO_MAX; ii++) { 128 hio = malloc(sizeof(*hio)); 129 if (hio == NULL) { | 32 33#include <sys/param.h> 34#include <sys/time.h> 35#include <sys/bio.h> 36#include <sys/disk.h> 37#include <sys/stat.h> 38 39#include <assert.h> --- 82 unchanged lines hidden (view full) --- 122 cv_init(&hio_send_list_cond); 123 124 /* 125 * Allocate requests pool and initialize requests. 126 */ 127 for (ii = 0; ii < HAST_HIO_MAX; ii++) { 128 hio = malloc(sizeof(*hio)); 129 if (hio == NULL) { |
130 errx(EX_TEMPFAIL, "cannot allocate %zu bytes of memory " 131 "for hio request", sizeof(*hio)); | 130 pjdlog_exitx(EX_TEMPFAIL, 131 "Unable to allocate memory (%zu bytes) for hio request.", 132 sizeof(*hio)); |
132 } 133 hio->hio_error = 0; 134 hio->hio_data = malloc(MAXPHYS); 135 if (hio->hio_data == NULL) { | 133 } 134 hio->hio_error = 0; 135 hio->hio_data = malloc(MAXPHYS); 136 if (hio->hio_data == NULL) { |
136 errx(EX_TEMPFAIL, "cannot allocate %zu bytes of memory " 137 "for gctl_data", (size_t)MAXPHYS); | 137 pjdlog_exitx(EX_TEMPFAIL, 138 "Unable to allocate memory (%zu bytes) for gctl_data.", 139 (size_t)MAXPHYS); |
138 } 139 TAILQ_INSERT_HEAD(&hio_free_list, hio, hio_next); 140 } 141} 142 143static void 144init_local(struct hast_resource *res) 145{ --- 559 unchanged lines hidden --- | 140 } 141 TAILQ_INSERT_HEAD(&hio_free_list, hio, hio_next); 142 } 143} 144 145static void 146init_local(struct hast_resource *res) 147{ --- 559 unchanged lines hidden --- |