Deleted Added
full compact
secondary.c (223181) secondary.c (225782)
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by Pawel Jakub Dawidek under sponsorship from
7 * the FreeBSD Foundation.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by Pawel Jakub Dawidek under sponsorship from
7 * the FreeBSD Foundation.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 223181 2011-06-17 07:07:26Z trociny $");
32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 225782 2011-09-27 07:57:15Z pjd $");
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <err.h>

--- 745 unchanged lines hidden (view full) ---

786 /* FALLTHROUGH */
787 case HIO_DELETE:
788 case HIO_FLUSH:
789 case HIO_WRITE:
790 data = NULL;
791 length = 0;
792 break;
793 default:
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <err.h>

--- 745 unchanged lines hidden (view full) ---

786 /* FALLTHROUGH */
787 case HIO_DELETE:
788 case HIO_FLUSH:
789 case HIO_WRITE:
790 data = NULL;
791 length = 0;
792 break;
793 default:
794 abort();
795 break;
794 PJDLOG_ABORT("Unexpected command (cmd=%hhu).",
795 hio->hio_cmd);
796 }
797 if (hio->hio_error != 0)
798 nv_add_int16(nvout, hio->hio_error, "error");
799 if (hast_proto_send(res, res->hr_remoteout, nvout, data,
800 length) < 0) {
801 secondary_exit(EX_TEMPFAIL, "Unable to send reply.");
802 }
803 nv_free(nvout);
804 pjdlog_debug(2, "send: (%p) Moving request to the free queue.",
805 hio);
806 nv_free(hio->hio_nv);
807 hio->hio_error = 0;
808 QUEUE_INSERT(free, hio);
809 }
810 /* NOTREACHED */
811 return (NULL);
812}
796 }
797 if (hio->hio_error != 0)
798 nv_add_int16(nvout, hio->hio_error, "error");
799 if (hast_proto_send(res, res->hr_remoteout, nvout, data,
800 length) < 0) {
801 secondary_exit(EX_TEMPFAIL, "Unable to send reply.");
802 }
803 nv_free(nvout);
804 pjdlog_debug(2, "send: (%p) Moving request to the free queue.",
805 hio);
806 nv_free(hio->hio_nv);
807 hio->hio_error = 0;
808 QUEUE_INSERT(free, hio);
809 }
810 /* NOTREACHED */
811 return (NULL);
812}