Deleted Added
full compact
primary.c (255716) primary.c (257154)
1/*-
2 * Copyright (c) 2009 The FreeBSD Foundation
3 * Copyright (c) 2010-2011 Pawel Jakub Dawidek <pawel@dawidek.net>
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 The FreeBSD Foundation
3 * Copyright (c) 2010-2011 Pawel Jakub Dawidek <pawel@dawidek.net>
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/primary.c 255716 2013-09-19 20:19:08Z trociny $");
32__FBSDID("$FreeBSD: head/sbin/hastd/primary.c 257154 2013-10-26 08:35:54Z trociny $");
33
34#include <sys/types.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <geom/gate/g_gate.h>

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

776 if (hast_proto_recv_data(res, out, nvin, map,
777 mapsize) == -1) {
778 pjdlog_errno(LOG_ERR,
779 "Unable to receive remote activemap");
780 nv_free(nvin);
781 free(map);
782 goto close;
783 }
33
34#include <sys/types.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <geom/gate/g_gate.h>

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

776 if (hast_proto_recv_data(res, out, nvin, map,
777 mapsize) == -1) {
778 pjdlog_errno(LOG_ERR,
779 "Unable to receive remote activemap");
780 nv_free(nvin);
781 free(map);
782 goto close;
783 }
784 mtx_lock(&res->hr_amp_lock);
784 /*
785 * Merge local and remote bitmaps.
786 */
787 activemap_merge(res->hr_amp, map, mapsize);
788 free(map);
789 /*
790 * Now that we merged bitmaps from both nodes, flush it to the
791 * disk before we start to synchronize.
792 */
785 /*
786 * Merge local and remote bitmaps.
787 */
788 activemap_merge(res->hr_amp, map, mapsize);
789 free(map);
790 /*
791 * Now that we merged bitmaps from both nodes, flush it to the
792 * disk before we start to synchronize.
793 */
793 mtx_lock(&res->hr_amp_lock);
794 (void)hast_activemap_flush(res);
795 }
796 nv_free(nvin);
797#ifdef notyet
798 /* Setup directions. */
799 if (proto_send(out, NULL, 0) == -1)
800 pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
801 if (proto_recv(in, NULL, 0) == -1)

--- 1676 unchanged lines hidden ---
794 (void)hast_activemap_flush(res);
795 }
796 nv_free(nvin);
797#ifdef notyet
798 /* Setup directions. */
799 if (proto_send(out, NULL, 0) == -1)
800 pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
801 if (proto_recv(in, NULL, 0) == -1)

--- 1676 unchanged lines hidden ---