From patchwork Thu Aug 8 15:25:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757800 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6928818F2C1 for ; Thu, 8 Aug 2024 15:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130798; cv=none; b=hg8bXA2isHAE5YqVsSWGrEi+AaxPD+2tCCVKsf5BKqvyGah4qS5SnkHUqUw4sqPEZ46ieeXNB6LpYJhe526CS7lRhJLo+uKhenvg1AOGJbpCJIvK4fDwrXEvaJC9kXoo70GUbIrsPm1mPxmfdwN+TCB30RNa6W5amQrihP5LwWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130798; c=relaxed/simple; bh=d4l6Zdrj2dAxZ55hbewueGl6NyCfMz4ZAAq3qegHoBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FVP5BXYLBcW+cueK6Zot3s05KWM5eZBrRWWXI4XUMp6tkKFVhcKkrefXOWDt7BVmho3G6iWcT3E0p2UxFMD83NEK+ji6McVKvvTVPRdIB2KW4dkT0fvJED6l4xS/h2UO4MmhMnkajPbrJ5CU6AaOU2CfRBGzhiQL5ldttv8MJ18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=YiFyYsAl; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YiFyYsAl" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a7ad02501c3so135716766b.2 for ; Thu, 08 Aug 2024 08:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130795; x=1723735595; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=alGp66DNaPrmoJFpQJ5nlyEFIQ7NpArivQ1RgTLtD/g=; b=YiFyYsAlcCq8+KKrwePO8wjUIgsFSHqLlE01R7lQOHufCgqOvKqwI0dbR/F3KFsC/s KvlPd68NV2hJxUs8FfviXdBPLdtTgZdnpTNXNZ1NLUt4IfA9bOVF0FPcbcHwS6bcvUoM fl14XkwScT12c1EQpigNBabicus4oXDg2hbTbL+02Kqk8sGxiM4Oae0O1DRcIZq5qxRU sdjn8eeTOpZxSnz/nthXCn9XEbxVNtQPHdn2R2RLGISH+YMbC5cTQwEnxELE1BKNCbA9 ZenmAKOqx1+5r8Fvuj+4128CDAZmAlecQ1lqD1xzF74bMIBkdks4JyM+TEiuAfxXSrf4 dcBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130795; x=1723735595; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=alGp66DNaPrmoJFpQJ5nlyEFIQ7NpArivQ1RgTLtD/g=; b=T2xDt/6rc6Rcj5Vcw+qPSk6scV7U9b+OHPWjpBgFrZFJFh1Teas1GS+k3j7qbLaHF1 V5DXnmwAbFbH+KR2vV3k/59CGY08atUOYgEblZdALQDnwHOt89FmPO8KbukJ5Wu12arn 5swk8MZy/YT24rpmN0MkNsqnQYEF39f8anv0RKzYvfWYMkXTI11pcHt3APu6Kq8sahVt 0Bt8DYCm+ro1ivPDKGrrscZQURU5Gj72tfsuXwdiQjTB7XNlVLwQCNGZNt2RRmlO0+mw bvKNk3ueVyUG7mse/W3uQgYDMTB8ao0IokSRQagayzaP00oeE+toc5YSHg7YDs+cZPxO +8tQ== X-Gm-Message-State: AOJu0YzMuxVZrrzaR3NKiGIieYqoDe5XYz5Y+owITxz5Jh4WXqvD2G1f QKESmUn2xii24v+btN5w20hTz7Dw4ZLeUrUX+/nDM86FNbknb1aRxHy9ZtMuQz0XNRP+MZyhtm8 j1OE= X-Google-Smtp-Source: AGHT+IEZQz/Ge/sJdTGwXocZ/Iyzs0FRv8kt4z43ZjNpOK5OTwZ7xGLF1UwXrDme4f3TootD7puWWA== X-Received: by 2002:a17:907:6d2a:b0:a72:aeff:dfed with SMTP id a640c23a62f3a-a8090e62cdemr154759666b.53.1723130794489; Thu, 08 Aug 2024 08:26:34 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c12ad3sm753356466b.88.2024.08.08.08.26.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:34 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 01/41] multipath-tools tests: make alias.test succeed with increased verbosity Date: Thu, 8 Aug 2024 17:25:40 +0200 Message-ID: <20240808152620.93965-2-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With MPATHTEST_VERBOSITY > 3, the alias test fails because of an unexpected message at verbosity level 4. Fix it. Signed-off-by: Martin Wilck --- tests/alias.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/alias.c b/tests/alias.c index a95b308..4f23cf9 100644 --- a/tests/alias.c +++ b/tests/alias.c @@ -1438,6 +1438,7 @@ static void gufa_empty_new_rw(void **state) { mock_bindings_file(""); mock_unused_alias("MPATHa"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); mock_allocate_binding("MPATHa", "WWID0"); @@ -1451,6 +1452,7 @@ static void gufa_empty_new_ro_1(void **state) { mock_bindings_file(""); mock_unused_alias("MPATHa"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); mock_allocate_binding_err("MPATHa", "WWID0", -EROFS, "Read-only file system"); @@ -1462,6 +1464,7 @@ static void gufa_empty_new_ro_2(void **state) { char *alias; mock_bindings_file(""); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); mock_unused_alias("MPATHa"); @@ -1473,6 +1476,7 @@ static void gufa_match_a_unused(void **state) { char *alias; mock_bindings_file("MPATHa WWID0"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_STR("MPATHa", "WWID0")); mock_unused_alias("MPATHa"); expect_condlog(3, EXISTING_STR("MPATHa", "WWID0")); @@ -1486,6 +1490,7 @@ static void gufa_match_a_self(void **state) { char *alias; mock_bindings_file("MPATHa WWID0"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_STR("MPATHa", "WWID0")); mock_self_alias("MPATHa", "WWID0"); expect_condlog(3, EXISTING_STR("MPATHa", "WWID0")); @@ -1500,6 +1505,7 @@ static void gufa_match_a_used(void **state) { mock_bindings_file("MPATHa WWID0"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_STR("MPATHa", "WWID0")); mock_used_alias("MPATHa", "WWID0"); @@ -1514,6 +1520,7 @@ static void gufa_nomatch_a_c(void **state) { mock_bindings_file(bindings); mock_unused_alias("MPATHb"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID1")); mock_allocate_binding_len("MPATHb", "WWID1", strlen(bindings)); @@ -1530,6 +1537,7 @@ static void gufa_nomatch_c_a(void **state) { mock_bindings_file(bindings); mock_unused_alias("MPATHb"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID1")); mock_allocate_binding_len("MPATHb", "WWID1", sizeof(bindings) - 1); @@ -1545,6 +1553,7 @@ static void gufa_nomatch_c_b(void **state) { "MPATHb WWID1\n"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); mock_unused_alias("MPATHa"); @@ -1561,6 +1570,7 @@ static void gufa_nomatch_c_b_used(void **state) { "MPATHb WWID1\n"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID4")); mock_used_alias("MPATHa", "WWID4"); mock_unused_alias("MPATHd"); @@ -1579,6 +1589,7 @@ static void gufa_nomatch_b_f_a(void **state) { "MPATHa WWID0\n"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID7")); mock_unused_alias("MPATHc"); @@ -1595,6 +1606,7 @@ static void gufa_nomatch_b_aa_a(void **state) { fill_bindings(&buf, 0, 26); mock_bindings_file(get_strbuf_str(&buf)); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID28")); mock_unused_alias("MPATHab"); mock_allocate_binding_len("MPATHab", "WWID28", get_strbuf_len(&buf)); @@ -1611,6 +1623,7 @@ static void gufa_nomatch_b_f_a_sorted(void **state) { "MPATHa WWID0\n"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_WWID_STR("WWID7")); mock_unused_alias("MPATHc"); @@ -1626,6 +1639,7 @@ static void gufa_old_empty(void **state) { /* rlookup_binding for ALIAS */ mock_bindings_file(""); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_STR("MPATHz")); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); @@ -1642,6 +1656,7 @@ static void gufa_old_match(void **state) { mock_bindings_file("MPATHb WWID1\n" "MPATHz WWID0"); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_ALIAS_STR("MPATHz", "WWID0")); alias = get_user_friendly_alias("WWID0", "MPATHz", "MPATH", false); @@ -1654,6 +1669,7 @@ static void gufa_old_match_other(void **state) { static const char bindings[] = "MPATHz WWID9\n"; mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_ALIAS_STR("MPATHz", "WWID9")); expect_condlog(0, REUSE_STR("MPATHz", "WWID9")); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); @@ -1671,6 +1687,7 @@ static void gufa_old_match_other_used(void **state) { static const char bindings[] = "MPATHz WWID9\n"; mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_ALIAS_STR("MPATHz", "WWID9")); expect_condlog(0, REUSE_STR("MPATHz", "WWID9")); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); @@ -1689,6 +1706,7 @@ static void gufa_old_match_other_wwidmatch(void **state) { "MPATHc WWID2"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_ALIAS_STR("MPATHz", "WWID9")); expect_condlog(0, REUSE_STR("MPATHz", "WWID9")); expect_condlog(3, FOUND_STR("MPATHc", "WWID2")); @@ -1706,6 +1724,7 @@ static void gufa_old_match_other_wwidmatch_used(void **state) { "MPATHc WWID2"); mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, FOUND_ALIAS_STR("MPATHz", "WWID9")); expect_condlog(0, REUSE_STR("MPATHz", "WWID9")); expect_condlog(3, FOUND_STR("MPATHc", "WWID2")); @@ -1720,6 +1739,7 @@ static void gufa_old_nomatch_wwidmatch(void **state) { static const char bindings[] = "MPATHa WWID0"; mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_STR("MPATHz")); expect_condlog(3, FOUND_STR("MPATHa", "WWID0")); mock_unused_alias("MPATHa"); @@ -1735,6 +1755,7 @@ static void gufa_old_nomatch_wwidmatch_used(void **state) { static const char bindings[] = "MPATHa WWID0"; mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_STR("MPATHz")); expect_condlog(3, FOUND_STR("MPATHa", "WWID0")); mock_used_alias("MPATHa", "WWID0"); @@ -1748,6 +1769,7 @@ static void gufa_old_nomatch_nowwidmatch(void **state) { static const char bindings[] = "MPATHb WWID1\n"; mock_bindings_file(bindings); + expect_condlog(4, "_read_bindings_file: bindings are unchanged"); expect_condlog(3, NOMATCH_STR("MPATHz")); expect_condlog(3, NOMATCH_WWID_STR("WWID0")); From patchwork Thu Aug 8 15:25:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757801 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9F4B18EFF1 for ; Thu, 8 Aug 2024 15:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130800; cv=none; b=lLv4UIt0+OFuc97u0qzu5xpTuhmCmGC9iOYNONdO/eKpKGUF6jDzpCroWCAu77G0oxi3eJvJdSnFmvSoaxEj/sLg4wScY64+d02XxXjGnPRgsuwio45rKTTGWKhCX+3h2k1xbfB1wu7GSSYJ1q3JsdjKMMang1+U33dc1LpTSwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130800; c=relaxed/simple; bh=4e7B3gw9NVEVg04YlIjII1PGEKp5UTsGx+J/EXdAoZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aGnaHUmufOvTvABqOQDD9bo+V6taudblfwJ2hwJdqvIGO2rvge+t+DdVp0+ntkM4YVrd9OWNVL/noW7RCxdH8F7SovZUEGs2iB1vgDly/IBJiS1+tUpfTr8SLGSHO9SO1LrLbQLJjNo4X17kqZODeZlZ7RKFvlvupKUgYf/ttKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=bB40/XJ4; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="bB40/XJ4" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52f04b4abdcso1476145e87.2 for ; Thu, 08 Aug 2024 08:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130796; x=1723735596; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wnb23KUTGi2kskRm2CmXuMG7AFya/4/GbJu+Fi0g2zM=; b=bB40/XJ4zS8z7bwu04tUsq/WAF29BwtCU2KgeKW8JkAmXbG1J/a+ClelapWQUAQ/lm 4UBJpIkMFE76rdBSNsm9to7y0g5dATob2TGm6QGDzboTElgFUliGNdk3WhmFa0I/Nbfz bYbjmplNaBITPhbKziUXO/U1XFnu6ml8geMLRFCIZhil6GCSm9388WFjKw5IVjG/0ljM NvDX104FLdF9M+X3Ptwi37M0/Y6w85viv8rpRSO2L1RAWyVd6scuaHM1z5ngQAm9DBaq qosHYRzJdbOZx/aOIBny0nNylM20THvSClGkroQqzF1b9eMdvZaRLIS3H48VfTtK7b/0 UWVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130796; x=1723735596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wnb23KUTGi2kskRm2CmXuMG7AFya/4/GbJu+Fi0g2zM=; b=i1HH/15quWtonT4lueckrUUPeaDom4GbFaQgo0zGyXun/QaniECZFukd9cZTmXyrnm knrMZ9wlzwCO9HzXNX2s+yoPrxupAmRA5GSp7wzN4YquDHYdjfzVFqUqAlBVDuo4ShZp hteFBTrrt4q0e4pGgMqoga4bWY5Z+DtQiYMK+AuPVbL3ynP+NpKE30FfExYuBXN+eZ+p 6h2vApur34j1dcyFvWIQoMMCqEECzbadbXEDi4s8w5jGF3ia2ZYDF1LejtLAdBhlZn6M jaPCcWwoRI1DPAUxiyxTeQZEd2/RsxCz56/Lc3nKaGFMm0BOowDnAhfK18XSbORRIRoV BTjg== X-Gm-Message-State: AOJu0YwT9otz6XlKsZnpentIzksxiDi7QvB6Q+UD4pWbcY5hMs9GVe+r goSbVqIz4pJICQcZLUpPlbW/SW7kzaD+FLMcoBkQURGQSqDcxPAageEW5onOoAg= X-Google-Smtp-Source: AGHT+IE9s99cRohOvpvWphP8HtrEez0i0zPI9NfaWMH3qW/6ZuVifjuQxWgf2EBupyIh+4VR75bsEw== X-Received: by 2002:a05:6512:68b:b0:52c:d76a:867f with SMTP id 2adb3069b0e04-530e578fbc5mr1623749e87.0.1723130795546; Thu, 08 Aug 2024 08:26:35 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9d437easm753193166b.139.2024.08.08.08.26.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:35 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 02/41] libmpathutil: avoid extra memory allocation in print_strbuf() Date: Thu, 8 Aug 2024 17:25:41 +0200 Message-ID: <20240808152620.93965-3-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of allocating a temporary buffer with vasprintf() and copying its contents to the strbuf, try to print directly into the strbuf and use the return value to expand the buffer if necessary. This saves a memory allocation on every invocation of print_strbuf(), and thus reduces the likelihood of failure and at the same time increases efficiency. We need an extra call to vsnprintf() if the buffer must be expanded, but vasprintf() will need to re-process the input internally as well after determining the required buffer size, therefore this probably won't hurt much. Add some more tests for print_strbuf() to make sure this works as intended. Signed-off-by: Martin Wilck --- libmpathutil/strbuf.c | 23 +++++++++++---- tests/strbuf.c | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) diff --git a/libmpathutil/strbuf.c b/libmpathutil/strbuf.c index e23b65e..6e53c3f 100644 --- a/libmpathutil/strbuf.c +++ b/libmpathutil/strbuf.c @@ -196,17 +196,30 @@ int print_strbuf(struct strbuf *buf, const char *fmt, ...) { va_list ap; int ret; - char *tail; + size_t space = buf->size - buf->offs; va_start(ap, fmt); - ret = vasprintf(&tail, fmt, ap); + ret = vsnprintf(buf->buf + buf->offs, space, fmt, ap); va_end(ap); if (ret < 0) - return -ENOMEM; + return ret; + else if ((size_t)ret < space) { + buf->offs += ret; + return ret; + } - ret = __append_strbuf_str(buf, tail, ret); + ret = expand_strbuf(buf, ret); + if (ret < 0) + return ret; + + space = buf->size - buf->offs; + va_start(ap, fmt); + ret = vsnprintf(buf->buf + buf->offs, space, fmt, ap); + va_end(ap); + + if (ret >= 0) + buf->offs += ret; - free(tail); return ret; } diff --git a/tests/strbuf.c b/tests/strbuf.c index f8554da..d7d4cd9 100644 --- a/tests/strbuf.c +++ b/tests/strbuf.c @@ -279,6 +279,71 @@ static void test_print_strbuf(void **state) assert_int_equal(print_strbuf(&buf, "%d%% of %d is %0.2f", 5, 100, 0.05), 17); assert_string_equal(get_strbuf_str(&buf), "5% of 100 is 0.05"); + +} + +/* length of string is not a divisor of chunk size */ +static void test_print_strbuf_2(void **state) +{ + STRBUF_ON_STACK(buf); + const char sentence[] = "This sentence has forty-seven (47) characters. "; + const char *s; + const int repeat = 100; + int i; + + for (i = 0; i < repeat; i++) + assert_int_equal(print_strbuf(&buf, "%s", sentence), + sizeof(sentence) - 1); + + s = get_strbuf_str(&buf); + condlog(3, "%s", s); + assert_int_equal(strlen(s), repeat * (sizeof(sentence) - 1)); + for (i = 0; i < repeat; i++) + assert_int_equal(strncmp(s + i * (sizeof(sentence) - 1), + sentence, sizeof(sentence) - 1), 0); +} + +/* length of string is divisor of chunk size */ +static void test_print_strbuf_3(void **state) +{ + STRBUF_ON_STACK(buf); + const char sentence[] = "This sentence has 32 characters."; + const char *s; + const int repeat = 100; + int i; + + for (i = 0; i < repeat; i++) + assert_int_equal(print_strbuf(&buf, "%s", sentence), + sizeof(sentence) - 1); + + s = get_strbuf_str(&buf); + condlog(3, "%s", s); + assert_int_equal(strlen(s), repeat * (sizeof(sentence) - 1)); + for (i = 0; i < repeat; i++) + assert_int_equal(strncmp(s + i * (sizeof(sentence) - 1), + sentence, sizeof(sentence) - 1), 0); +} + +static void test_print_strbuf_4(void **state) +{ + STRBUF_ON_STACK(buf); + const char sentence[] = "This sentence has a lot of characters, " + "which makes it hopefully longer than the chunk size given by " + "the constant \"BUF_CHUNK\" in libmpathutil/strbuf.c. "; + const char *s; + const int repeat = 100; + int i; + + for (i = 0; i < repeat; i++) + assert_int_equal(print_strbuf(&buf, "%s", sentence), + sizeof(sentence) - 1); + + s = get_strbuf_str(&buf); + condlog(3, "%s", s); + assert_int_equal(strlen(s), repeat * (sizeof(sentence) - 1)); + for (i = 0; i < repeat; i++) + assert_int_equal(strncmp(s + i * (sizeof(sentence) - 1), + sentence, sizeof(sentence) - 1), 0); } static void test_truncate_strbuf(void **state) @@ -394,6 +459,9 @@ static int test_strbuf(void) cmocka_unit_test(test_strbuf_quoted), cmocka_unit_test(test_strbuf_escaped), cmocka_unit_test(test_print_strbuf), + cmocka_unit_test(test_print_strbuf_2), + cmocka_unit_test(test_print_strbuf_3), + cmocka_unit_test(test_print_strbuf_4), cmocka_unit_test(test_truncate_strbuf), cmocka_unit_test(test_fill_strbuf), }; From patchwork Thu Aug 8 15:25:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757802 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE8918F2EE for ; Thu, 8 Aug 2024 15:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130801; cv=none; b=NOCeU5yNuQgP3xlDuXlJJVkbL3Hr2S36bsIhEtRkJuvWBweSopeQBKo2SV7QYSO7YGwEQKHwKwVD22Nwj2QO+dYOPJpthG0eoUq45nZFD5OTIJWcR117e1+IPpOBOc74XyihuZNl6k5+WdZPBQTYbDkqRqTpRHpr7U/HWBPxVVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130801; c=relaxed/simple; bh=h5HxFy5tNXsY6O2j8C3p+C/c9/uMC8wOQGCv8ZItPH0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HS5Ip2E7GsIwUAZOhUvd3Q7pKOWISnBxLFDknPuFMvMDcC1M3g9+9T2jfjwJQHVdem6RONAblQ9tXQzX9Owqh7CLKSvhk2ziSf0QwoMH5mRiuLt1teVE8L37xGnifgHC93mfGk+QGAKPUtrmXZI0mbvsKTqZYqtNDBUUN3R7MmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=MLxh41NM; arc=none smtp.client-ip=209.85.218.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="MLxh41NM" Received: by mail-ej1-f67.google.com with SMTP id a640c23a62f3a-a7a8e73b29cso114780666b.3 for ; Thu, 08 Aug 2024 08:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130797; x=1723735597; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+g2fgHo68V+z+6A3o8FNX+wO8CeXqUdvIDXO4qmZJnc=; b=MLxh41NMD7UPHAlLXJHz344B+8YZsb9QPDvR9m9AVgceAtWy1abJ1XQI26c9NSSKBN QlXKqd7UP7hgHkfvlUL7rJx0Lymp0zb6mJT6p0LLA+nFIeWFRMZak463A2DP+lsw9eUy KLGJzkmTa/QunxzbbQn2EErT01CRlm+fporK+1jH+kPI05lklJjyRdOUrIH4ODZOIwOO 7L5KhG6gMMdOpg+qwPJnpgQni3wsEwgdgD9F3LJ9DjiXDuClgz+cwW2xXTxzxZjgOGEh lZWIFy9I1zqvPUjs4NwtG95PX7kLHxwuTzmIinb0m2UexZqeswQ4WCgylGiGf6s7oZF2 d2Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130797; x=1723735597; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+g2fgHo68V+z+6A3o8FNX+wO8CeXqUdvIDXO4qmZJnc=; b=kbhQmUxbU04INN94TnNWMkNlbHBZBxvC1x4mb3X2TeJBzjVRmEd1dNCcW7ttI136Ar ds3dGVRp9/9w0DmYPbXkR5y1NdhWVvH+raGTc7q5OsOPnwE5Hp7oPBr96iUWnGpD38RW 4GAZzCTs48/XT1UW8T3CLut1/q5hAOOgHXgZVcZ7BOJY9jp20EMY4019JqvfNTv5V7/6 eyCgTa6vYjrkJ+QkTr1sHcGXX0LYzyg0k7WsG7DT6wr/HZxPVZM1BQbqcstBkxQV7u2a sLYwizZlGyp+jZHQcG112LBVLPVK3ppNrM9KLI414bF9gCSsfEopuBAnTkju/brku+Xp 2JYw== X-Gm-Message-State: AOJu0YxhUE4RBLF6HJ4c4VXt2TDe7hbW152CTje8WLaMExhxgNRLyIi/ 5CNwFVBwkXpmRS4mlqyXH/8xVRybzVKyn+SmdRp0nuxF5LvJY04QXTw46pdpFStwC7vropPDrCK wcaoFbA== X-Google-Smtp-Source: AGHT+IFmKjxsNk1qT49y69dIWpKHrHxPgdBGzKjg5XHSDVGy/rhuaystNpdSVi52F5ktOI+j5XTexA== X-Received: by 2002:a17:907:a08a:b0:a7a:387c:23f8 with SMTP id a640c23a62f3a-a8090c3256dmr176461366b.3.1723130796539; Thu, 08 Aug 2024 08:26:36 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9d89a9fsm746899266b.156.2024.08.08.08.26.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:36 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 03/41] libmpathutil: rename strlcat and strlcpy Date: Thu, 8 Aug 2024 17:25:42 +0200 Message-ID: <20240808152620.93965-4-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User programs are forbidden to use names of functions provided by the standard library [1]. Since glibc 2.38, strlcpy() and strlcat() are part of the system library. Rename our own functions to libmp_strlcpy() and libmp_strlcat(), respectively, and only use the short names if the C library doesn't have them. It turns out that msul libc has always had strlcat() and strlcpy(), so use the system library function with musl, too. [1] https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html --- libmpathutil/util.c | 4 ++-- libmpathutil/util.h | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libmpathutil/util.c b/libmpathutil/util.c index 9c422f1..136aa59 100644 --- a/libmpathutil/util.c +++ b/libmpathutil/util.c @@ -121,7 +121,7 @@ get_word (const char *sentence, char **word) return skip + len; } -size_t strlcpy(char * restrict dst, const char * restrict src, size_t size) +size_t libmp_strlcpy(char * restrict dst, const char * restrict src, size_t size) { size_t bytes = 0; char ch; @@ -138,7 +138,7 @@ size_t strlcpy(char * restrict dst, const char * restrict src, size_t size) return bytes; } -size_t strlcat(char * restrict dst, const char * restrict src, size_t size) +size_t libmp_strlcat(char * restrict dst, const char * restrict src, size_t size) { size_t bytes = 0; char ch; diff --git a/libmpathutil/util.h b/libmpathutil/util.h index c19f749..7bad855 100644 --- a/libmpathutil/util.h +++ b/libmpathutil/util.h @@ -12,6 +12,10 @@ #include #include +#ifndef __GLIBC_PREREQ +#define __GLIBC_PREREQ(x, y) 0 +#endif + size_t strchop(char *); const char *libmp_basename(const char *filename); @@ -22,8 +26,12 @@ int basenamecpy (const char *src, char *dst, size_t size); int filepresent (const char *run); char *get_next_string(char **temp, const char *split_char); int get_word (const char * sentence, char ** word); -size_t strlcpy(char * restrict dst, const char * restrict src, size_t size); -size_t strlcat(char * restrict dst, const char * restrict src, size_t size); +size_t libmp_strlcpy(char * restrict dst, const char * restrict src, size_t size); +size_t libmp_strlcat(char * restrict dst, const char * restrict src, size_t size); +#if defined(__GLIBC__) && ! (__GLIBC_PREREQ(2, 38)) +#define strlcpy(dst, src, size) libmp_strlcpy(dst, src, size) +#define strlcat(dst, src, size) libmp_strlcat(dst, src, size) +#endif dev_t parse_devt(const char *dev_t); char *convert_dev(char *dev, int is_path_device); void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached); @@ -62,9 +70,6 @@ struct scandir_result { }; void free_scandir_result(struct scandir_result *); -#ifndef __GLIBC_PREREQ -#define __GLIBC_PREREQ(x, y) 0 -#endif /* * ffsll() is also available on glibc < 2.27 if _GNU_SOURCE is defined. * But relying on that would require that every program using this header file From patchwork Thu Aug 8 15:25:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757803 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B80FF18F2FC for ; Thu, 8 Aug 2024 15:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130801; cv=none; b=umIW500DwT7c7PM+asdTs/sbssKRYN1hh9EOGYcJOZwVi1GGCk6/Qy9MpshoWlwBImh1Usxyn2pVXdIMaiiHpwrT61eZauJqtL9AFxO5iw1XojdK94/pOY19ZcIBXSnkGm5SvJHSNrJ+bEpWvjIldeR39tML++w1QfduRn8nsrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130801; c=relaxed/simple; bh=/ihWMef0SkxFAgSM3LCxgrSlFk7hwIRNdI4tGjaWkIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FKEwoJmrj09YfQDm89IzT6+aQ1W/MvLYfRG3XhBhnkqIXB1u5AWM5qlda7nhYRV2w7K59RD5R6303l5yREi39cnP1808VwYzRGmagAibG72ysxEz2JW6+xOsZf2V5v3GAP1ajLqny3MQVNUOiXH+Akzl0YqiVAF2YH9jpEO/dPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=DPKo7RJR; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DPKo7RJR" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a7ad02501c3so135725366b.2 for ; Thu, 08 Aug 2024 08:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130798; x=1723735598; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W6nKzm1IQqQOnq247XwltMY3Rwyes2u/zt89jnzbWE4=; b=DPKo7RJRhr0ZeAIlcgqSJ20wQSTNpvP3tD+2ElYTyMGRvvIWf9iNXFSRxIYH9LgLHo O/lYOFbstIOuHN9knDFTshIJpHrYkrJtRh5usMlAtO5C1BKhv6JxwLD261qv55HU76Np wPq8whEVDzMT9eS4jQUUbNG94TAfumaAQSHFAQu2X5uSIc3a+D2Z0OY7N8BqvMp/M1gn ToBh88mhLR8M2BqbcY9MwzE6xzvg3Vx1zSI3eCZp4Vs7VzdrO1rWYtWqSlvDByfOAWRv xzpZNHpJGMUGeFiWVqLstFimCViXhFlSuqSITy9H74S1XaZRaJxRefT/bdAXdiclF+P/ ttOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130798; x=1723735598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W6nKzm1IQqQOnq247XwltMY3Rwyes2u/zt89jnzbWE4=; b=vYXi4ndFOHhhxxt94tMT8XIEiHvUHPGordXh7UUuqU3FEUbGShhtxjheVrUvzMxFJ5 BMvnI8A3+noLHWr6q6rtgQt9jVTdm3EtWuudJdCzGXsd/wGS/wnCg7zuRuvgQQGSLerD 4064zoTrfZRG7PEbPw+bAoGr5Kd7uYhYYB5pYA88c9Ipr6HyswTFYKN9yJTb3fxh/+Nv H6px5sltnWjOaRz7hl8dJwXhrYB2Vhuw/ISKizJuQ+jsebLlYGTv202Aqnr/F6zAqTNR BpCknRAkt2t7WYKYNZlgUNBm2aRJ5+pTvnlGERb1k1nWiyJOLRitCsAmMBFwWsdBqF6+ lOpQ== X-Gm-Message-State: AOJu0Yxdjpvd8uqUuhrxsySehVDY9mi7O+jxv72o4oRoLum9x662DBh1 F+0us6dEF0Ti75bFXmo27JfkZy+2ByhwAvuAbzfZBLk+1rBAmZm8Ffn98P3KWSE= X-Google-Smtp-Source: AGHT+IFP/XoC7Hj6wxWImVdUv6iQqoIrB9tpn1s5gQ4f2t/VGk6/AZwA+BeMuZRCSRq/V2OAPgdpTw== X-Received: by 2002:a17:907:97d1:b0:a7a:b070:92d1 with SMTP id a640c23a62f3a-a8090e632eemr160876266b.46.1723130797562; Thu, 08 Aug 2024 08:26:37 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9bcadbesm751341266b.21.2024.08.08.08.26.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:37 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 04/41] libmpathutil.version: remove strlcpy and strlcat, and LIBMULTIPATH section Date: Thu, 8 Aug 2024 17:25:43 +0200 Message-ID: <20240808152620.93965-5-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With the removal of strlcpy from the "symbols referenced by multipath and multipathd" section, this part of the ABI (which is actually the part of LIBMULTIPATH_16.0.0 which was moved to libmpathutil and exported to multipath and/or multipathd) has now changed for the first time since the split between libmpathutil and libmultipath. It makes no sense to further track whether or not any symbols exported by libmpathutil are used by multipath or multipathd. It turns out that both executables were already using some symbols from the sections that were supposedly used by libmultipath only. Therefore, move all symbols to the new LIBMPATHUTIL_4.0 ABI. Signed-off-by: Martin Wilck --- libmpathutil/libmpathutil.version | 104 +++++++++++++----------------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version index cb05231..8393b91 100644 --- a/libmpathutil/libmpathutil.version +++ b/libmpathutil/libmpathutil.version @@ -43,98 +43,86 @@ LIBMPATHCOMMON_1.0.0 { put_multipath_config; }; -/* symbols referenced by multipath and multipathd */ -LIBMULTIPATH_16.0.0 { +LIBMPATHUTIL_4.0 { global: + alloc_bitfield; alloc_strvec; + __append_strbuf_str; append_strbuf_str; + append_strbuf_quoted; + basenamecpy; cleanup_charp; + cleanup_fclose; + cleanup_fd_ptr; + cleanup_free_ptr; cleanup_mutex; cleanup_ucharp; + cleanup_udev_device; + cleanup_vector; + cleanup_vector_free; convert_dev; dlog; + filepresent; fill_strbuf; + find_keyword; find_slot; + free_keywords; free_scandir_result; free_strvec; + get_linux_version_code; get_monotonic_time; + __get_strbuf_buf; get_next_string; get_strbuf_len; get_strbuf_str; - is_quote; - libmp_verbosity; - log_thread_reset; - log_thread_start; - log_thread_stop; - logsink; - normalize_timespec; - print_strbuf; - pthread_cond_init_mono; - recv_packet; - reset_strbuf; - send_packet; - set_max_fds; - setup_thread_attr; - strchop; - strlcpy; - timespeccmp; - timespecsub; - truncate_strbuf; - ux_socket_listen; - vector_alloc; - vector_alloc_slot; - vector_del_slot; - vector_free; - vector_reset; - vector_set_slot; - -local: - *; -}; - -/* symbols referenced internally by libmultipath */ -LIBMPATHUTIL_2.0 { - alloc_bitfield; - __append_strbuf_str; - append_strbuf_quoted; - basenamecpy; - cleanup_fd_ptr; - cleanup_free_ptr; - cleanup_vector_free; - cleanup_fclose; - filepresent; - find_keyword; - free_keywords; - get_linux_version_code; - __get_strbuf_buf; get_word; _install_keyword; install_sublevel; install_sublevel_end; + is_quote; keyword_alloc; _log_bitfield_overflow; + libmp_basename; + libmp_strlcat; + libmp_strlcpy; + libmp_verbosity; log_safe; + log_thread_reset; + log_thread_start; + log_thread_stop; + logsink; msort; + normalize_timespec; parse_devt; + print_strbuf; process_file; + pthread_cond_init_mono; + recv_packet; + reset_strbuf; safe_write; + send_packet; + set_max_fds; set_value; + setup_thread_attr; + strchop; should_exit; snprint_keyword; steal_strbuf_str; - strlcat; + timespeccmp; + timespecsub; + truncate_strbuf; validate_config_strvec; + ux_socket_listen; + vector_alloc; + vector_alloc_slot; + vector_del_slot; vector_find_or_add_slot; + vector_free; vector_insert_slot; vector_move_up; + vector_reset; + vector_set_slot; vector_sort; -}; - -LIBMPATHUTIL_2.1 { - libmp_basename; -}; - -LIBMPATHUTIL_2.2 { - cleanup_udev_device; - cleanup_vector; +local: + *; }; From patchwork Thu Aug 8 15:25:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757804 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C65918FC6F for ; Thu, 8 Aug 2024 15:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130802; cv=none; b=nCCRtEP3LsXO41lhh8tCKMayTGYf/ZmktVIEXZETQbX13NkwPUbJGuNVTFXyes+VtJKPGGfU7DIpzocpNPP1x8vLlTc2nBO8xMfav3E7jNOMdNWeq7DqfYfZC310j+jopqHZQ5qwJ3dvWRNv/TgYOw35/GwSl0OsCcnLp1SZB6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130802; c=relaxed/simple; bh=zxA+WHcAAzzaGsIwTernqIbopft2AIjK6JWUOg/J0F8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IiXKiNgtIXCf4YezkqJXfLIA1njqDi9tC7Jqj4ji4/PHMijqs4yaEiJk2Dx0raVjhG2V78OK8LDBAefS9MoH7JKKjYyKFsUuXF7jK6YXtUzxVuzWwyqhtDy4MVFSlalnKsjgfBL2fYeKhKktEvXXXdeVzOJpIfRyFHMyVXjcs8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Zpel1T0a; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Zpel1T0a" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a7aabb71bb2so121356966b.2 for ; Thu, 08 Aug 2024 08:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130799; x=1723735599; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8ftlhIu1XDGoNXVs49AS9O6VzVuEVWBScs1YE0hhGwQ=; b=Zpel1T0aREvVlcBYcE1HARtQo5CPSd04LHC/nEu+V9U+4FJX3PMPOjWtvNuCJ3TO6b OG5dbHMuhbplqwlBfSKdIUiF27l60QQQUU32DvT/deCUoZgF3MmFa6J45iDhvvVlrnPj Z/keWP9leHBTBSkUk3nGAWyfMZbNi7qXfGMS2iONbbNnib2lGEvTPBPa1x3k6SBvQZ+Q tf0nKqtUh+jwnfT4CMx2MCHS7aknGVoS+IV+FKvY4VpScC53CIPQ5g6WFiF3vruMufo9 XaE8WidNB7VryXZ+JjjAM7d9PQLQEVRf1of13dEa5Ejnt47WTies4F3wNTFKoBgP0a4e E7gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130799; x=1723735599; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ftlhIu1XDGoNXVs49AS9O6VzVuEVWBScs1YE0hhGwQ=; b=m8J+q6wD73RvN9RcSlGpEQiLEuDqC3AIQRIrjKMge9ERSf4OptSNPJ14hHn2WEC9ku GI8jiPcj6R6YOi0KH50TFQV2MibfF95QPmau7HBgGxEbJBJbs1CzS7NHbXyeWd9qQG5S DCbSa2px30oPuPqI16OGEnY2Tpn1s1w4sRdGQ/vCi8VlLY34ExeKj1qfHgR9RI26js0i iIG8L6TQsO7XiJXEDTd4zI/MR5VBvS3j9EIbNK7gpZgLTbSyCs3/I9x6eiq0ow06DlKW PEeJRIO4boQnodA09vSl8CUrXl/ATP4qT2q8Xi+88V2ftr2nOtaK4GiN1h0unXLYdu3k 8yMg== X-Gm-Message-State: AOJu0YxzRqpmmfaCurxFgHh91cNiEeuLKzL6wCXpZo7vVsq1U25tEefg 9kkxEyky3Npp4xgvUJ5aUrNYQ68ZdERkJmWYM6shbW2a2a3lv0JIzZ7bUhbttzM= X-Google-Smtp-Source: AGHT+IHwGzaWi3sT71e50kI7QBFNQ0NOBGt6E0WOvQbq5E5xqH+0abgjWgmZMR9PmJz7WW5tsl6/PA== X-Received: by 2002:a17:907:f1cc:b0:a7a:c812:36bb with SMTP id a640c23a62f3a-a8090c2303cmr165391066b.8.1723130798560; Thu, 08 Aug 2024 08:26:38 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9e80e5fsm750176466b.161.2024.08.08.08.26.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:38 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 05/41] libmpathutil: fix __attribute typo in log_pthread.c Date: Thu, 8 Aug 2024 17:25:44 +0200 Message-ID: <20240808152620.93965-6-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmpathutil/log_pthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpathutil/log_pthread.c b/libmpathutil/log_pthread.c index 69b441b..f30eb7e 100644 --- a/libmpathutil/log_pthread.c +++ b/libmpathutil/log_pthread.c @@ -60,7 +60,7 @@ static void flush_logqueue (void) } while (empty == 0); } -static void cleanup_log_thread(__attribute((unused)) void *arg) +static void cleanup_log_thread(__attribute__((unused)) void *arg) { logdbg(stderr, "log thread exiting"); pthread_mutex_lock(&logev_lock); From patchwork Thu Aug 8 15:25:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757805 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E4AC18FC8B for ; Thu, 8 Aug 2024 15:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130804; cv=none; b=BNlarb+/H4UPX9+akBphLoM8hdqqBKo3xGyO0suGf/zei6KDMB43zrb8YgeauFLlacWHmwEyruDVT7vw0QUywPN6Ww22AcZN2Rzk1s47DwFraFQdFTOtUdthy0ZArQWKF11oBsqeZtR1Kz9rC5Lf7iiEi5mYzheTTWBi1fx+EqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130804; c=relaxed/simple; bh=NOFk6e52Uc7MAjLOv9ZjNGotUPymEq6QB+RbEmle4lk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cpj8x7IGwuTUAjvnlPqpbiYMWfmSU6+Af3IZt6fVk4fOzQ3DqJgwAa+tuh17TcALNJXCUkEIgRktjJhsKXN51BKMXNEcS7ITOddbsWPAeJ01TeTF/l6+abX4ge/eyJNHlGLIpCP0UDJsaRfWoAQ0mU++5LXV+SxKsyRmRWvZG80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=PBHTAm2I; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="PBHTAm2I" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5af326eddb2so3573229a12.1 for ; Thu, 08 Aug 2024 08:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130800; x=1723735600; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ahsw4dy4eRtFoE83ZWIz+kosLp6YcHyTpHwz+qnszlo=; b=PBHTAm2IvTmP3fXkaAK5d1EOqF0xjjfoG6rEICOG9NmFAJMgq7UtIWZ41dmdPq2qiD F89u5Lzcq8JVIubhDzxZHZjugHw4dE8zyNb//G0xJl17I5JAQNRHeWkTsxqtpo6KdefJ nsWImhwqjtD4xNJ9noM2u/sbOB9gv6+gzl0O2zylvQkPG9bV871fSY2jpF5RNpUxoOkd eqCmJT6FxWyoFiYQH/o8Ue2yDc8SUP8S9qDcOuK498zbePc0BwqlcQQnmDL8oyQC6B5H pH4LDkyJSTyXcohGY1OvuraULT1vUkAHJtqDDfZU2YoeF5eb4pYjjDlIMBxbGptx73Lp BhvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130800; x=1723735600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ahsw4dy4eRtFoE83ZWIz+kosLp6YcHyTpHwz+qnszlo=; b=E7ssz7ozjqKen3Qwt7YX2lq7H0yhxGdoRkQNOGXU8FZOvJlJ+R7UZ7px4vqBrZjMoQ SjB3tqRt5uUHL5tgSAzzhoffPBSmz00VZv5jA4dpcVGpCdPat3ZARv3bMH0l0ZVs2FVr WIY6e1la8NYPuB8glcqoRVsGjE55jFELLSODwzaY7iITVashdJ/0aj6XVYK7L0z86/1d 1zEkrZ+8LQkE8t5kA5INfOgarr71iQRYkadPEYiJL69BNY93SEBnzIfmTR7BFF6FkUBQ FkA7BlrH5nDeoaMNHfBx+/lXVA8sxRxRfFDJAQb/iMV55x5MGpCde9z9jm65JR+KIzOa Kf+w== X-Gm-Message-State: AOJu0YzOhU2by56LhtZ2OFAcOgvFqS66ZsbW7RabVcFzHvwv16GfeJLk fu37AaYgpo6ZG0C7h9FHtxoKqSBOhkqYrCIivRrXK0Ry2XEHy2hGrd7r2idZiK9aL7TswMNKBlN g0pE= X-Google-Smtp-Source: AGHT+IH1e6CKHMNZEw2U7e8WS2fKoiRizfAIn4sy94fd6vQ8jHGy3SXVrJMPtqoz/BUDpQnNcgRmAA== X-Received: by 2002:a17:907:a0c:b0:a72:66d5:892c with SMTP id a640c23a62f3a-a8091f5aba8mr217347166b.18.1723130799586; Thu, 08 Aug 2024 08:26:39 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9bc3c9asm752437066b.37.2024.08.08.08.26.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:39 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 06/41] libmultipath: devmapper.c: rename __DR_UNUSED__, and fix __attribute typo Date: Thu, 8 Aug 2024 17:25:45 +0200 Message-ID: <20240808152620.93965-7-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 0347a17..fe604f1 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -45,9 +45,9 @@ static int dm_conf_verbosity; #ifdef LIBDM_API_DEFERRED static int dm_cancel_remove_partmaps(const char * mapname); -#define __DR_UNUSED__ /* empty */ +#define DR_UNUSED__ /* empty */ #else -#define __DR_UNUSED__ __attribute__((unused)) +#define DR_UNUSED__ __attribute__((unused)) #endif static int dm_remove_partmaps (const char *mapname, int flags); @@ -1041,7 +1041,7 @@ int _dm_flush_map (const char *mapname, int flags, int retries) } int -dm_flush_map_nopaths(const char *mapname, int deferred_remove __DR_UNUSED__) +dm_flush_map_nopaths(const char *mapname, int deferred_remove DR_UNUSED__) { int flags = DMFL_NEED_SYNC; @@ -1196,7 +1196,7 @@ dm_disablegroup(const char * mapname, int index) static int dm_get_multipath(const char *name, struct multipath **pmpp) { - struct multipath __attribute((cleanup(cleanup_multipath))) *mpp = NULL; + struct multipath __attribute__((cleanup(cleanup_multipath))) *mpp = NULL; char uuid[DM_UUID_LEN]; int rc; From patchwork Thu Aug 8 15:25:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757806 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C336918FC6F for ; Thu, 8 Aug 2024 15:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130804; cv=none; b=s+ARcG0NdOn+etFDiWrYvhpyGooQ/A9rnhGfvrMmDNUeh8tM8I2vHaOslERxIu4SmNeh3TMJfj7JTu68AzHKrmo7HMA6x6WMamm8BIwU8kb4e85/JkwkmZZ0zUvVZog06v7e3/NVj6plysbWLt8agF1EdB2CjwGUhC+KrcyuHQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130804; c=relaxed/simple; bh=q9kBFjKByCB/mjqRUNNKiJvqSTeohIvVljVkbkFfr0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yjp5yyDi7gp/NvpFgoUvT6L+Esz/YOXl3EhkXSuToyGK70BeQG0wkN8vgOz6Bo7vf/t2imAFgeExD4lVNgBu6xMJm0MeGdvjIl5B/vW/sW3b8coOEJswSI+fYXdgCbqVwgBntfLa4lFJxplrGQjsIyunIABdiRmMKLIQj9TPv1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=eoTOjiUc; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="eoTOjiUc" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52fc4388a64so1627296e87.1 for ; Thu, 08 Aug 2024 08:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130801; x=1723735601; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Z7h1VfWHYaeBymPCL8tEjZsT9A/O9rHXjoyaoe+hwI=; b=eoTOjiUccIAZNunyZ5rnbxCkr6tyvAU2ZDHYAZB5zahzhWXkz7WqgTbTs7g0nbzT9e Zsr+gv4yaDvLq0RgqUI1KVyzaK5rO6+A1VOpGqtIg++n3hwsRmYCilGX3weon6jFGnsA 5737IUgs93uvWps7VXXy7L4BXXCor6vEGyjE1igLwF8teELs4d/m744aZuc31+hrBDJe b5kDmIihit+2ns4NRf93AkB9RE1oY5JFUs4yaFdAfnYkDyFpnKvgCo6dhsVDX6G1R4ee XhabPtIjPWbPvRYKg8yf1/tGnVRAe96RVLXl+2ayWO5i+oPdLswZu2UI/dun2oQhUPuC TGrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130801; x=1723735601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Z7h1VfWHYaeBymPCL8tEjZsT9A/O9rHXjoyaoe+hwI=; b=CmVA3HK4G79lXqVdImvrdzyUyAjAfv4lLIBsMV1jYaE0ytjiYAdCj45e1I391dOKL7 cdPd469FTEQbeVxHCI90KjpEK/31C+PD6w1Z0Xo1XR58MwS/2bNaQBSOY5LCKsAOUta/ X+NrJ14rI8c7vLhFTeEvI5wz98Hf21w37necoqnY7Le3VB3EGVOeTPcbCSMNq9lOh3yd Tcry7RmXl7jc4i/O/kHdP51yxNU9+LicbTapOGVuaivoWto+s3EUPJWySNootpnJqkSX YCG4WAjq5RqSTWp7G97NQzaUzTiF3M2jmGi8670qbSPe8EH7NAwGraSGbjY+OUgWPIDm moKQ== X-Gm-Message-State: AOJu0Yy0+fC04C17y/1nu5JOrPxfVyLvcKZCypHq4vP8F7OLRh/zc+P3 NGUoNg8DDMpyQ4NuplNsTzEs65VfHaxbr94yGgCI2X2+R8A6V30luISmNGopgQu1cVHaD/k6l4N FfRg= X-Google-Smtp-Source: AGHT+IGKvjLpqBduUBySmMY2GMfPI2hw00Q+c63uUL/ZUeLbJTZyOiOPeAuKny+nxP9lqLCWyuuMsA== X-Received: by 2002:a05:6512:b85:b0:52c:d84b:eee6 with SMTP id 2adb3069b0e04-530e58761e8mr1971887e87.38.1723130800647; Thu, 08 Aug 2024 08:26:40 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2bf813bsm731706a12.20.2024.08.08.08.26.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:40 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 07/41] multipathd: fix __attribute typo Date: Thu, 8 Aug 2024 17:25:46 +0200 Message-ID: <20240808152620.93965-8-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index f43ff54..bb19c97 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1220,7 +1220,7 @@ int ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) { struct multipath * mpp; - char *params __attribute((cleanup(cleanup_charp))) = NULL; + char *params __attribute__((cleanup(cleanup_charp))) = NULL; int retries = 3; int start_waiter = 0; int ret; From patchwork Thu Aug 8 15:25:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757808 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B0CF18F2EE for ; Thu, 8 Aug 2024 15:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130807; cv=none; b=oks4mUQ4KBcyUnHXQmnUCUVrheIyWbASJrIDnirTE8LZn3cxnyudL8S3Fs56Zrh9PvqKL1raEbcHWvNnpf51OBErD/xw5fwa+dU9ZbNeUaKsTql5jmXJZ0GokPbm7Dz/lUS0B5VDVXFVVtPFeW/NgFR1RkZsa7scHS8bbvAL1wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130807; c=relaxed/simple; bh=n0LYQ7u0etUlsM1Dtyc/SwnwcpNnqgOjwMkVJeRtCDc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XH5HacY6fjvm7thCJfzvCRjnxOeeefkYLlp/kJ9Pkn6qAxHPky5iklOQ/SLF4g5EiQgwHITLIiaD41uV5lB32VDAwwBmhGJ0fd42cOMzYxELraxTGZf2fSGWBPmQTfLOcytPh8PxibhUaI4UGavKgx+YrHDyGyUm+v1lsrWY4f4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=K2F6zJUF; arc=none smtp.client-ip=209.85.218.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="K2F6zJUF" Received: by mail-ej1-f68.google.com with SMTP id a640c23a62f3a-a7ab5fc975dso101225066b.1 for ; Thu, 08 Aug 2024 08:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130802; x=1723735602; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8o6y4HkT4DJe/Aq+gjyWqmi7cyiIAlKGOBDZP+JC1Q0=; b=K2F6zJUFm4h0dj0F05NFXzvMHbkTjcRdb+6d1461d0LhidTxbPjzQVLsuE54bmGULt Q7/YJkShDXkXd3WJaeJWTjXz5MpFbE1wMHGpp6QqJKPIWhqXG9TMs81vhu7cQfDVzbon PGta4JvUChi8QHg3pf39VeOVbPcLOojC8EGwKdPHPQ2HlIdPt5h7G3cp1VNms94kigK6 v0Oe7IdbAQ+cbYR9dfvR/Rwjt8fwhm7YUIdxgNuEGwnU+9Jvw48ibahRaSeFKOWg4Occ 8nXrSrY5GouwSQP7v2wskix22Pl3/18kMfmQtM2mi7D07DTgShvUXNJySTyNrou6DKj+ qN4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130802; x=1723735602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8o6y4HkT4DJe/Aq+gjyWqmi7cyiIAlKGOBDZP+JC1Q0=; b=i/4gD6A3GLWFX8vKdpdle7pD7639v96TAkC7SCQpFk53dSyEhX/ninYxQa8HQ5H6Kv I2m6zDD3Qipv1/ZqigSGhkM+ycz0qeaP0vzVaKGnsp273kgkDVC3ZOJWus/nTi0vUmN1 Tsb7mx9BcZe1+nvYJWpWuQ7VoRnbGUPtmkKelC0nTOdiekuClYE+Lfm2PaQoaidCikNp zI5dlK8F18oh2bPGBm7ZRVwu4nE9wS8gQHY9k5wYCzCMgj0hC/TS2TfVSJlL4cixc8i2 inJEfAcR7PtkgFw/O6GWEBy8pF4KfWhbQ/JAyo0EDHNhB/ZMI28FC38d6n+Y8vqWx8XN gHiQ== X-Gm-Message-State: AOJu0Yxzmzm+UlptWXDvwnIJbSPgyCU9MQuuH1/huJfxSZ8de+to1RkG gdEB+KOSDfIK080EBR8FzA3Yrvr8VVRzBXOaC7ZDq007dMt5w37MX8FkECh5AmQ= X-Google-Smtp-Source: AGHT+IEomAyHFy55S1f4MhRT8cqEKKSTIoyE3doEMmx3M4KBHpJEIkGEQitpSxVa1dvp6uxCqSnPjw== X-Received: by 2002:a17:907:e61c:b0:a7a:9ece:ea5f with SMTP id a640c23a62f3a-a8090de7f18mr172363166b.41.1723130801863; Thu, 08 Aug 2024 08:26:41 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ec648dsm747404966b.192.2024.08.08.08.26.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:41 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 08/41] multipath-tools: use common convention for "header file included" macros Date: Thu, 8 Aug 2024 17:25:47 +0200 Message-ID: <20240808152620.93965-9-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User code shouldn't define any identifiers starting with 2 underscores, or underscore + capital letter [1]. Adopt this convention for all macros indicating that a certain header file is included. Moreover, use a common convention for constructing these macros: the macro is the base name of the header file, in capital letters, non-alphanumeric characters replaced by underscore, with "_INCLUDED" appended. This convention is well readable and was already used in a few files. The only exceptions to this rule are: - the header files under libmultipath/nvme and libmultipath/nvme/linux, where "NVME_" or "LINUX_" is prepended to the base name, respectively; - the files "byteorder.h" and "devmapper.h" under kpartx/, to avoid ambiguity with the files by the same name under libmultipath; - "main.h" for mpathpersist, to avoid ambiguity with multipathd's main.h. This commit also adds "already included" macros where they'd been missing so far. [1] https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html Signed-off-by: Martin Wilck --- create-config.mk | 4 ++-- kpartx/byteorder.h | 6 +++--- kpartx/crc32.h | 6 +++--- kpartx/dasd.h | 6 +++--- kpartx/devmapper.h | 6 +++--- kpartx/dos.h | 2 +- kpartx/efi.h | 6 +++--- kpartx/gpt.h | 4 ++-- kpartx/kpartx.h | 6 +++--- kpartx/lopart.h | 3 +++ kpartx/mac.h | 4 ++-- kpartx/xstrncpy.h | 3 +++ libdmmp/libdmmp/libdmmp.h | 6 +++--- libdmmp/libdmmp_private.h | 6 +++--- libmpathcmd/mpath_cmd.h | 6 +++--- libmpathpersist/mpath_persist.h | 6 +++--- libmpathpersist/mpath_persist_int.h | 6 +++--- libmpathpersist/mpath_pr_ioctl.h | 5 +++++ libmpathpersist/mpathpr.h | 4 ++-- libmpathutil/debug.h | 6 +++--- libmpathutil/globals.h | 4 ++-- libmpathutil/log.h | 6 +++--- libmpathutil/log_pthread.h | 6 +++--- libmpathutil/msort.h | 4 ++-- libmpathutil/parser.h | 4 ++-- libmpathutil/strbuf.h | 4 ++-- libmpathutil/time-util.h | 6 +++--- libmpathutil/util.h | 6 +++--- libmpathutil/uxsock.h | 5 ++++- libmpathutil/vector.h | 4 ++-- libmpathvalid/mpath_valid.h | 6 +++--- libmultipath/alias.h | 6 +++--- libmultipath/blacklist.h | 6 +++--- libmultipath/checkers.h | 6 +++--- libmultipath/checkers/cciss.h | 4 ++-- libmultipath/checkers/directio.h | 6 +++--- libmultipath/checkers/emc_clariion.h | 6 +++--- libmultipath/checkers/hp_sw.h | 6 +++--- libmultipath/checkers/rdac.h | 6 +++--- libmultipath/checkers/readsector0.h | 6 +++--- libmultipath/checkers/tur.h | 6 +++--- libmultipath/config.h | 4 ++-- libmultipath/configure.h | 4 ++++ libmultipath/defaults.h | 7 ++++--- libmultipath/devmapper.h | 7 ++++--- libmultipath/dict.h | 9 +++------ libmultipath/discovery.h | 6 +++--- libmultipath/dm-generic.h | 6 +++--- libmultipath/dmparser.h | 5 +++++ libmultipath/file.h | 6 +++--- libmultipath/foreign.h | 7 ++++--- libmultipath/generic.h | 6 +++--- libmultipath/hwtable.h | 6 +++--- libmultipath/io_err_stat.h | 6 +++--- libmultipath/libsg.h | 6 +++--- libmultipath/list.h | 6 +++--- libmultipath/lock.h | 6 +++--- libmultipath/nvme-lib.h | 6 +++--- libmultipath/nvme/argconfig.h | 4 ++-- libmultipath/nvme/json.h | 4 ++-- libmultipath/nvme/linux/nvme.h | 6 +++--- libmultipath/nvme/linux/nvme_ioctl.h | 6 +++--- libmultipath/nvme/nvme-ioctl.h | 6 +++--- libmultipath/nvme/nvme.h | 6 +++--- libmultipath/nvme/plugin.h | 4 ++-- libmultipath/pgpolicies.h | 4 ++-- libmultipath/print.h | 6 +++--- libmultipath/prio.h | 6 +++--- libmultipath/prioritizers/alua.h | 4 ++-- libmultipath/prioritizers/alua_rtpg.h | 6 +++--- libmultipath/prioritizers/alua_spc3.h | 6 +++--- libmultipath/prioritizers/weightedpath.h | 4 ++-- libmultipath/prkey.h | 6 +++--- libmultipath/propsel.h | 3 +++ libmultipath/sg_include.h | 3 +++ libmultipath/structs.h | 6 +++--- libmultipath/structs_vec.h | 6 +++--- libmultipath/switchgroup.h | 5 +++++ libmultipath/sysfs.h | 4 ++-- libmultipath/uevent.h | 6 +++--- libmultipath/unaligned.h | 6 +++--- libmultipath/valid.h | 6 +++--- libmultipath/version.h | 6 +++--- libmultipath/wwids.h | 6 +++--- mpathpersist/main.h | 4 ++++ multipathd/cli.h | 6 +++--- multipathd/cli_handlers.h | 4 ++-- multipathd/dmevents.h | 6 +++--- multipathd/fpin.h | 4 ++-- multipathd/init_unwinder.h | 4 ++-- multipathd/main.h | 6 +++--- multipathd/pidfile.h | 4 ++++ multipathd/uxclnt.h | 5 +++++ multipathd/uxlsnr.h | 4 ++-- multipathd/waiter.h | 6 +++--- tests/test-lib.h | 4 ++-- tests/test-log.h | 4 ++-- tests/wrap64.h | 4 ++-- 98 files changed, 282 insertions(+), 235 deletions(-) diff --git a/create-config.mk b/create-config.mk index 0abbb3a..8bd2c20 100644 --- a/create-config.mk +++ b/create-config.mk @@ -163,8 +163,8 @@ all: $(TOPDIR)/config.mk $(multipathdir)/autoconfig.h: @echo creating $@ - @echo '#ifndef _AUTOCONFIG_H' >$@ - @echo '#define _AUTOCONFIG_H' >>$@ + @echo '#ifndef AUTOCONFIG_H_INCLUDED' >$@ + @echo '#define AUTOCONFIG_H_INCLUDED' >>$@ @for x in $(DEFINES); do echo "#define $$x" >>$@; done @echo '#endif' >>$@ diff --git a/kpartx/byteorder.h b/kpartx/byteorder.h index 199c66b..75990a8 100644 --- a/kpartx/byteorder.h +++ b/kpartx/byteorder.h @@ -1,5 +1,5 @@ -#ifndef BYTEORDER_H_INCLUDED -#define BYTEORDER_H_INCLUDED +#ifndef KPARTX_BYTEORDER_H_INCLUDED +#define KPARTX_BYTEORDER_H_INCLUDED #ifdef __linux__ # include @@ -26,4 +26,4 @@ # error unsupported #endif -#endif /* BYTEORDER_H_INCLUDED */ +#endif /* KPARTX_BYTEORDER_H_INCLUDED */ diff --git a/kpartx/crc32.h b/kpartx/crc32.h index a4505b8..abbadbb 100644 --- a/kpartx/crc32.h +++ b/kpartx/crc32.h @@ -1,8 +1,8 @@ /* * crc32.h */ -#ifndef _CRC32_H -#define _CRC32_H +#ifndef CRC32_H_INCLUDED +#define CRC32_H_INCLUDED #include #include @@ -16,4 +16,4 @@ extern uint32_t crc32_be(uint32_t crc, unsigned char const *p, size_t len); #define ether_crc_le(length, data) crc32_le(~0, data, length) #define ether_crc(length, data) crc32_be(~0, data, length) -#endif /* _CRC32_H */ +#endif /* CRC32_H_INCLUDED */ diff --git a/kpartx/dasd.h b/kpartx/dasd.h index 8ad5d62..481ad79 100644 --- a/kpartx/dasd.h +++ b/kpartx/dasd.h @@ -22,8 +22,8 @@ * along with this program. If not, see . */ -#ifndef _DASD_H -#define _DASD_H +#ifndef DASD_H_INCLUDED +#define DASD_H_INCLUDED typedef struct ttr { @@ -289,4 +289,4 @@ cchhb2blk (cchhb_t *ptr, struct hd_geometry *geo) ptr->b; } -#endif /* _DASD_H */ +#endif /* DASD_H_INCLUDED */ diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h index 701bdf6..e4db862 100644 --- a/kpartx/devmapper.h +++ b/kpartx/devmapper.h @@ -1,5 +1,5 @@ -#ifndef _KPARTX_DEVMAPPER_H -#define _KPARTX_DEVMAPPER_H +#ifndef KPARTX_DEVMAPPER_H_INCLUDED +#define KPARTX_DEVMAPPER_H_INCLUDED #ifdef DM_SUBSYSTEM_UDEV_FLAG0 #define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0 @@ -36,4 +36,4 @@ int dm_find_part(const char *parent, const char *delim, int part, char *nondm_create_uuid(dev_t devt); int nondm_parse_uuid(const char *uuid, unsigned int *major, unsigned int *minor); -#endif /* _KPARTX_DEVMAPPER_H */ +#endif /* KPARTX_DEVMAPPER_H_INCLUDED */ diff --git a/kpartx/dos.h b/kpartx/dos.h index f45e7f6..678cddc 100644 --- a/kpartx/dos.h +++ b/kpartx/dos.h @@ -10,4 +10,4 @@ struct partition { unsigned int nr_sects; } __attribute__((packed)); -#endif /* DOS_H_INCLUDED */ +#endif /* DOS_H_INCLUDED */ diff --git a/kpartx/efi.h b/kpartx/efi.h index af5660a..10af0e7 100644 --- a/kpartx/efi.h +++ b/kpartx/efi.h @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#ifndef EFI_H -#define EFI_H +#ifndef EFI_H_INCLUDED +#define EFI_H_INCLUDED /* * Extensible Firmware Interface @@ -54,4 +54,4 @@ efi_guidcmp(efi_guid_t left, efi_guid_t right) typedef uint16_t efi_char16_t; /* UNICODE character */ -#endif /* EFI_H */ +#endif /* EFI_H_INCLUDED */ diff --git a/kpartx/gpt.h b/kpartx/gpt.h index 4e1b49a..b35320f 100644 --- a/kpartx/gpt.h +++ b/kpartx/gpt.h @@ -21,8 +21,8 @@ along with this program. If not, see . */ -#ifndef _GPT_H -#define _GPT_H +#ifndef GPT_H_INCLUDED +#define GPT_H_INCLUDED #include diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h index 727632c..8a21030 100644 --- a/kpartx/kpartx.h +++ b/kpartx/kpartx.h @@ -1,5 +1,5 @@ -#ifndef _KPARTX_H -#define _KPARTX_H +#ifndef KPARTX_H_INCLUDED +#define KPARTX_H_INCLUDED #include #include @@ -70,4 +70,4 @@ four2int(unsigned char *p) { return p[0] + (p[1]<<8) + (p[2]<<16) + (p[3]<<24); } -#endif /* _KPARTX_H */ +#endif /* KPARTX_H_INCLUDED */ diff --git a/kpartx/lopart.h b/kpartx/lopart.h index c73ab23..7cdcfe7 100644 --- a/kpartx/lopart.h +++ b/kpartx/lopart.h @@ -1,4 +1,7 @@ +#ifndef LOPART_H_INCLUDED +#define LOPART_H_INCLUDED extern int verbose; extern int set_loop (char **, const char *, int, int *); extern int del_loop (const char *); extern char * find_loop_by_file (const char *); +#endif diff --git a/kpartx/mac.h b/kpartx/mac.h index 55c3ec9..253fd0d 100644 --- a/kpartx/mac.h +++ b/kpartx/mac.h @@ -1,5 +1,5 @@ -#ifndef MAC_H -#define MAC_H +#ifndef MAC_H_INCLUDED +#define MAC_H_INCLUDED #include diff --git a/kpartx/xstrncpy.h b/kpartx/xstrncpy.h index 05c8fa2..cb87aaa 100644 --- a/kpartx/xstrncpy.h +++ b/kpartx/xstrncpy.h @@ -1 +1,4 @@ +#ifndef XSTRNCPY_H_INCLUDED +#define XSTRNCPY_H_INCLUDED extern void xstrncpy(char *dest, const char *src, size_t n); +#endif diff --git a/libdmmp/libdmmp/libdmmp.h b/libdmmp/libdmmp/libdmmp.h index 6e6610d..25cd42e 100644 --- a/libdmmp/libdmmp/libdmmp.h +++ b/libdmmp/libdmmp/libdmmp.h @@ -19,8 +19,8 @@ */ -#ifndef _LIB_DMMP_H_ -#define _LIB_DMMP_H_ +#ifndef LIBDMMP_H_INCLUDED +#define LIBDMMP_H_INCLUDED #include #include @@ -732,4 +732,4 @@ DMMP_DLL_EXPORT const char *dmmp_last_error_msg(struct dmmp_context *ctx); } /* End of extern "C" */ #endif -#endif /* End of _LIB_DMMP_H_ */ +#endif /* End of LIBDMMP_H_INCLUDED */ diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h index b1a6dde..9606fb3 100644 --- a/libdmmp/libdmmp_private.h +++ b/libdmmp/libdmmp_private.h @@ -18,8 +18,8 @@ * Todd Gill */ -#ifndef _LIB_DMMP_PRIVATE_H_ -#define _LIB_DMMP_PRIVATE_H_ +#ifndef LIBDMMP_PRIVATE_H_INCLUDED +#define LIBDMMP_PRIVATE_H_INCLUDED /* * Notes: @@ -209,4 +209,4 @@ DMMP_DLL_LOCAL void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, } /* End of extern "C" */ #endif -#endif /* End of _LIB_DMMP_PRIVATE_H_ */ +#endif /* End of LIBDMMP_PRIVATE_H_INCLUDED */ diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h index 0c293c7..b58aaac 100644 --- a/libmpathcmd/mpath_cmd.h +++ b/libmpathcmd/mpath_cmd.h @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#ifndef LIB_MPATH_CMD_H -#define LIB_MPATH_CMD_H +#ifndef MPATH_CMD_H_INCLUDED +#define MPATH_CMD_H_INCLUDED /* * This should be sufficient for json output for >10000 maps, @@ -141,4 +141,4 @@ int mpath_recv_reply_data(int fd, char *reply, size_t len, #ifdef __cplusplus } #endif -#endif /* LIB_MPATH_CMD_H */ +#endif /* MPATH_CMD_H_INCLUDED */ diff --git a/libmpathpersist/mpath_persist.h b/libmpathpersist/mpath_persist.h index 0046f12..9c88e15 100644 --- a/libmpathpersist/mpath_persist.h +++ b/libmpathpersist/mpath_persist.h @@ -1,7 +1,7 @@ /* version - 1.0 */ -#ifndef MPATH_PERSIST_LIB_H -#define MPATH_PERSIST_LIB_H +#ifndef MPATH_PERSIST_H_INCLUDED +#define MPATH_PERSIST_H_INCLUDED #ifdef __cplusplus @@ -326,4 +326,4 @@ void mpath_persistent_reserve_free_vecs(void); } #endif -#endif /*MPATH_PERSIST_LIB_H*/ +#endif /* MPATH_PERSIST_H_INCLUDED */ diff --git a/libmpathpersist/mpath_persist_int.h b/libmpathpersist/mpath_persist_int.h index 3145753..7819823 100644 --- a/libmpathpersist/mpath_persist_int.h +++ b/libmpathpersist/mpath_persist_int.h @@ -1,5 +1,5 @@ -#ifndef _MPATH_PERSIST_INT_H -#define _MPATH_PERSIST_INT_H +#ifndef MPATH_PERSIST_INT_H_INCLUDED +#define MPATH_PERSIST_INT_H_INCLUDED /* * This header file contains symbols that are used by multipath-tools @@ -22,4 +22,4 @@ int prout_do_scsi_ioctl( char * dev, int rq_servact, int rq_scope, void dumpHex(const char* , int len, int no_ascii); int update_map_pr(struct multipath *mpp); -#endif /* _MPATH_PERSIST_INT_H */ +#endif /* MPATH_PERSIST_INT_H_INCLUDED */ diff --git a/libmpathpersist/mpath_pr_ioctl.h b/libmpathpersist/mpath_pr_ioctl.h index 625490f..b1d9be1 100644 --- a/libmpathpersist/mpath_pr_ioctl.h +++ b/libmpathpersist/mpath_pr_ioctl.h @@ -1,3 +1,6 @@ +#ifndef MPATH_PR_IOCTL_H_INCLUDED +#define MPATH_PR_IOCTL_H_INCLUDED + #define MPATH_XFER_HOST_DEV 0 /*data transfer from initiator to target */ #define MPATH_XFER_DEV_HOST 1 /*data transfer from target to initiator */ #define MPATH_XFER_NONE 2 /*no data transfer */ @@ -107,3 +110,5 @@ typedef struct SenseData /* Driver status */ #define DRIVER_OK 0x00 + +#endif diff --git a/libmpathpersist/mpathpr.h b/libmpathpersist/mpathpr.h index 39a7d8e..cc1a567 100644 --- a/libmpathpersist/mpathpr.h +++ b/libmpathpersist/mpathpr.h @@ -1,5 +1,5 @@ -#ifndef MPATHPR_H -#define MPATHPR_H +#ifndef MPATHPR_H_INCLUDED +#define MPATHPR_H_INCLUDED /* * This header file contains symbols that are only used by diff --git a/libmpathutil/debug.h b/libmpathutil/debug.h index 705a5d7..c2a2f6e 100644 --- a/libmpathutil/debug.h +++ b/libmpathutil/debug.h @@ -1,5 +1,5 @@ -#ifndef _DEBUG_H -#define _DEBUG_H +#ifndef DEBUG_H_INCLUDED +#define DEBUG_H_INCLUDED void dlog (int prio, const char *fmt, ...) __attribute__((format(printf, 2, 3))); @@ -29,4 +29,4 @@ enum { if (__p <= MAX_VERBOSITY && __p <= libmp_verbosity) \ dlog(__p, fmt "\n", ##args); \ } while (0) -#endif /* _DEBUG_H */ +#endif /* DEBUG_H_INCLUDED */ diff --git a/libmpathutil/globals.h b/libmpathutil/globals.h index a4d4d4e..fbb1401 100644 --- a/libmpathutil/globals.h +++ b/libmpathutil/globals.h @@ -1,5 +1,5 @@ -#ifndef _GLOBALS_H -#define _GLOBALS_H +#ifndef GLOBALS_H_INCLUDED +#define GLOBALS_H_INCLUDED struct config; diff --git a/libmpathutil/log.h b/libmpathutil/log.h index fa224e4..e3d269c 100644 --- a/libmpathutil/log.h +++ b/libmpathutil/log.h @@ -1,5 +1,5 @@ -#ifndef LOG_H -#define LOG_H +#ifndef LOG_H_INCLUDED +#define LOG_H_INCLUDED #define DEFAULT_AREA_SIZE 16384 #define MAX_MSG_SIZE 256 @@ -40,4 +40,4 @@ int log_dequeue (void *); void log_syslog (void *); void dump_logmsg (void *); -#endif /* LOG_H */ +#endif /* LOG_H_INCLUDED */ diff --git a/libmpathutil/log_pthread.h b/libmpathutil/log_pthread.h index 810ac92..dea57b8 100644 --- a/libmpathutil/log_pthread.h +++ b/libmpathutil/log_pthread.h @@ -1,5 +1,5 @@ -#ifndef _LOG_PTHREAD_H -#define _LOG_PTHREAD_H +#ifndef LOG_PTHREAD_H_INCLUDED +#define LOG_PTHREAD_H_INCLUDED #include @@ -9,4 +9,4 @@ void log_thread_start(pthread_attr_t *attr); void log_thread_reset (void); void log_thread_stop(void); -#endif /* _LOG_PTHREAD_H */ +#endif /* LOG_PTHREAD_H_INCLUDED */ diff --git a/libmpathutil/msort.h b/libmpathutil/msort.h index caef9b6..edfa438 100644 --- a/libmpathutil/msort.h +++ b/libmpathutil/msort.h @@ -1,5 +1,5 @@ -#ifndef __MSORT_H -#define __MSORT_H +#ifndef MSORT_H_INCLUDED +#define MSORT_H_INCLUDED typedef int(*__compar_fn_t)(const void *, const void *); void msort (void *b, size_t n, size_t s, __compar_fn_t cmp); diff --git a/libmpathutil/parser.h b/libmpathutil/parser.h index 9d9d948..baa9c55 100644 --- a/libmpathutil/parser.h +++ b/libmpathutil/parser.h @@ -20,8 +20,8 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef _PARSER_H -#define _PARSER_H +#ifndef PARSER_H_INCLUDED +#define PARSER_H_INCLUDED /* system includes */ #include diff --git a/libmpathutil/strbuf.h b/libmpathutil/strbuf.h index ae86341..68f21de 100644 --- a/libmpathutil/strbuf.h +++ b/libmpathutil/strbuf.h @@ -2,8 +2,8 @@ * Copyright (c) 2021 SUSE LLC * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef _STRBUF_H -#define _STRBUF_H +#ifndef STRBUF_H_INCLUDED +#define STRBUF_H_INCLUDED #include #include diff --git a/libmpathutil/time-util.h b/libmpathutil/time-util.h index 4a80ebd..dfffe4b 100644 --- a/libmpathutil/time-util.h +++ b/libmpathutil/time-util.h @@ -1,5 +1,5 @@ -#ifndef _TIME_UTIL_H_ -#define _TIME_UTIL_H_ +#ifndef TIME_UTIL_H_INCLUDED +#define TIME_UTIL_H_INCLUDED #include @@ -12,4 +12,4 @@ void timespecsub(const struct timespec *a, const struct timespec *b, struct timespec *res); int timespeccmp(const struct timespec *a, const struct timespec *b); -#endif /* _TIME_UTIL_H_ */ +#endif /* TIME_UTIL_H_INCLUDED */ diff --git a/libmpathutil/util.h b/libmpathutil/util.h index 7bad855..110b2f6 100644 --- a/libmpathutil/util.h +++ b/libmpathutil/util.h @@ -1,5 +1,5 @@ -#ifndef _UTIL_H -#define _UTIL_H +#ifndef UTIL_H_INCLUDED +#define UTIL_H_INCLUDED #include #include @@ -147,4 +147,4 @@ void cleanup_charp(char **p); void cleanup_ucharp(unsigned char **p); void cleanup_udev_device(struct udev_device **udd); -#endif /* _UTIL_H */ +#endif /* UTIL_H_INCLUDED */ diff --git a/libmpathutil/uxsock.h b/libmpathutil/uxsock.h index e3d28cf..8157060 100644 --- a/libmpathutil/uxsock.h +++ b/libmpathutil/uxsock.h @@ -1,7 +1,10 @@ /* some prototypes */ +#ifndef UXSOCK_H_INCLUDED +#define UXSOCK_H_INCLUDED + int ux_socket_listen(const char *name); int send_packet(int fd, const char *buf); int recv_packet(int fd, char **buf, unsigned int timeout); #define _MAX_CMD_LEN 512 - +#endif diff --git a/libmpathutil/vector.h b/libmpathutil/vector.h index a41f157..2df1505 100644 --- a/libmpathutil/vector.h +++ b/libmpathutil/vector.h @@ -20,8 +20,8 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef _VECTOR_H -#define _VECTOR_H +#ifndef VECTOR_H_INCLUDED +#define VECTOR_H_INCLUDED #include diff --git a/libmpathvalid/mpath_valid.h b/libmpathvalid/mpath_valid.h index 636f163..de165a2 100644 --- a/libmpathvalid/mpath_valid.h +++ b/libmpathvalid/mpath_valid.h @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#ifndef LIB_MPATH_VALID_H -#define LIB_MPATH_VALID_H +#ifndef MPATH_VALID_H_INCLUDED +#define MPATH_VALID_H_INCLUDED #ifdef __cplusplus extern "C" { @@ -152,4 +152,4 @@ int mpathvalid_is_path(const char *name, unsigned int mode, char **wwid, #ifdef __cplusplus } #endif -#endif /* LIB_PATH_VALID_H */ +#endif /* MPATH_VALID_H_INCLUDED */ diff --git a/libmultipath/alias.h b/libmultipath/alias.h index 629e8d5..eb3c15b 100644 --- a/libmultipath/alias.h +++ b/libmultipath/alias.h @@ -1,5 +1,5 @@ -#ifndef _ALIAS_H -#define _ALIAS_H +#ifndef ALIAS_H_INCLUDED +#define ALIAS_H_INCLUDED int valid_alias(const char *alias); int get_user_friendly_wwid(const char *alias, char *buff); @@ -11,4 +11,4 @@ int check_alias_settings(const struct config *); void cleanup_bindings(void); struct inotify_event; void handle_bindings_file_inotify(const struct inotify_event *event); -#endif /* _ALIAS_H */ +#endif /* ALIAS_H_INCLUDED */ diff --git a/libmultipath/blacklist.h b/libmultipath/blacklist.h index dde5cea..244c59d 100644 --- a/libmultipath/blacklist.h +++ b/libmultipath/blacklist.h @@ -1,5 +1,5 @@ -#ifndef _BLACKLIST_H -#define _BLACKLIST_H +#ifndef BLACKLIST_H_INCLUDED +#define BLACKLIST_H_INCLUDED #include #include @@ -54,4 +54,4 @@ void free_blacklist_device (vector); void merge_blacklist(vector); void merge_blacklist_device(vector); -#endif /* _BLACKLIST_H */ +#endif /* BLACKLIST_H_INCLUDED */ diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h index ea1e8af..51ceea0 100644 --- a/libmultipath/checkers.h +++ b/libmultipath/checkers.h @@ -1,5 +1,5 @@ -#ifndef _CHECKERS_H -#define _CHECKERS_H +#ifndef CHECKERS_H_INCLUDED +#define CHECKERS_H_INCLUDED #include #include "list.h" @@ -199,4 +199,4 @@ void *libcheck_thread(struct checker_context *ctx); */ extern const char *libcheck_msgtable[]; -#endif /* _CHECKERS_H */ +#endif /* CHECKERS_H_INCLUDED */ diff --git a/libmultipath/checkers/cciss.h b/libmultipath/checkers/cciss.h index cf20946..bdb1184 100644 --- a/libmultipath/checkers/cciss.h +++ b/libmultipath/checkers/cciss.h @@ -1,5 +1,5 @@ -#ifndef CCISS_H -#define CCISS_H +#ifndef CCISS_H_INCLUDED +#define CCISS_H_INCLUDED #include #include diff --git a/libmultipath/checkers/directio.h b/libmultipath/checkers/directio.h index 1865b1f..15b3da4 100644 --- a/libmultipath/checkers/directio.h +++ b/libmultipath/checkers/directio.h @@ -1,8 +1,8 @@ -#ifndef _DIRECTIO_H -#define _DIRECTIO_H +#ifndef DIRECTIO_H_INCLUDED +#define DIRECTIO_H_INCLUDED int directio (struct checker *); int directio_init (struct checker *); void directio_free (struct checker *); -#endif /* _DIRECTIO_H */ +#endif /* DIRECTIO_H_INCLUDED */ diff --git a/libmultipath/checkers/emc_clariion.h b/libmultipath/checkers/emc_clariion.h index a1018a6..ee85dd5 100644 --- a/libmultipath/checkers/emc_clariion.h +++ b/libmultipath/checkers/emc_clariion.h @@ -1,8 +1,8 @@ -#ifndef _EMC_CLARIION_H -#define _EMC_CLARIION_H +#ifndef EMC_CLARIION_H_INCLUDED +#define EMC_CLARIION_H_INCLUDED int emc_clariion (struct checker *); int emc_clariion_init (struct checker *); void emc_clariion_free (struct checker *); -#endif /* _EMC_CLARIION_H */ +#endif /* EMC_CLARIION_H_INCLUDED */ diff --git a/libmultipath/checkers/hp_sw.h b/libmultipath/checkers/hp_sw.h index 3be0d8e..0589351 100644 --- a/libmultipath/checkers/hp_sw.h +++ b/libmultipath/checkers/hp_sw.h @@ -1,8 +1,8 @@ -#ifndef _HP_SW_H -#define _HP_SW_H +#ifndef HP_SW_H_INCLUDED +#define HP_SW_H_INCLUDED int hp_sw (struct checker *); int hp_sw_init (struct checker *); void hp_sw_free (struct checker *); -#endif /* _HP_SW_H */ +#endif /* HP_SW_H_INCLUDED */ diff --git a/libmultipath/checkers/rdac.h b/libmultipath/checkers/rdac.h index d7bf812..5a92b28 100644 --- a/libmultipath/checkers/rdac.h +++ b/libmultipath/checkers/rdac.h @@ -1,8 +1,8 @@ -#ifndef _RDAC_H -#define _RDAC_H +#ifndef RDAC_H_INCLUDED +#define RDAC_H_INCLUDED int rdac(struct checker *); int rdac_init(struct checker *); void rdac_free(struct checker *); -#endif /* _RDAC_H */ +#endif /* RDAC_H_INCLUDED */ diff --git a/libmultipath/checkers/readsector0.h b/libmultipath/checkers/readsector0.h index 0f5d654..486613d 100644 --- a/libmultipath/checkers/readsector0.h +++ b/libmultipath/checkers/readsector0.h @@ -1,8 +1,8 @@ -#ifndef _READSECTOR0_H -#define _READSECTOR0_H +#ifndef READSECTOR0_H_INCLUDED +#define READSECTOR0_H_INCLUDED int readsector0 (struct checker *); int readsector0_init (struct checker *); void readsector0_free (struct checker *); -#endif /* _READSECTOR0_H */ +#endif /* READSECTOR0_H_INCLUDED */ diff --git a/libmultipath/checkers/tur.h b/libmultipath/checkers/tur.h index a2e8c88..62a47d1 100644 --- a/libmultipath/checkers/tur.h +++ b/libmultipath/checkers/tur.h @@ -1,8 +1,8 @@ -#ifndef _TUR_H -#define _TUR_H +#ifndef TUR_H_INCLUDED +#define TUR_H_INCLUDED int tur (struct checker *); int tur_init (struct checker *); void tur_free (struct checker *); -#endif /* _TUR_H */ +#endif /* TUR_H_INCLUDED */ diff --git a/libmultipath/config.h b/libmultipath/config.h index 800c0ca..181b78a 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -1,5 +1,5 @@ -#ifndef _CONFIG_H -#define _CONFIG_H +#ifndef CONFIG_H_INCLUDED +#define CONFIG_H_INCLUDED #include #include diff --git a/libmultipath/configure.h b/libmultipath/configure.h index 9d935db..ca34442 100644 --- a/libmultipath/configure.h +++ b/libmultipath/configure.h @@ -1,3 +1,6 @@ +#ifndef CONFIGURE_H_INCLUDED +#define CONFIGURE_H_INCLUDED + /* * configurator actions */ @@ -63,3 +66,4 @@ void trigger_paths_udev_change(struct multipath *mpp, bool is_mpath); void trigger_partitions_udev_change(struct udev_device *dev, const char *action, int len); int check_daemon(void); +#endif diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h index ed08c25..02f7e57 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -1,5 +1,6 @@ -#ifndef _DEFAULTS_H -#define _DEFAULTS_H +#ifndef DEFAULTS_H_INCLUDED +#define DEFAULTS_H_INCLUDED + #include #include @@ -78,4 +79,4 @@ static inline char *set_default(char *str) return strdup(str); } extern const char *const default_partition_delim; -#endif /* _DEFAULTS_H */ +#endif /* DEFAULTS_H_INCLUDED */ diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index a26dc1e..b5330ab 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -1,5 +1,6 @@ -#ifndef _DEVMAPPER_H -#define _DEVMAPPER_H +#ifndef DEVMAPPER_H_INCLUDED +#define DEVMAPPER_H_INCLUDED + #include #include #include "autoconfig.h" @@ -210,4 +211,4 @@ int libmp_dm_task_run(struct dm_task *dmt); condlog(lvl, "%s: libdm task=%d error: %s", __func__, \ cmd, strerror(dm_task_get_errno(dmt))) \ -#endif /* _DEVMAPPER_H */ +#endif /* DEVMAPPER_H_INCLUDED */ diff --git a/libmultipath/dict.h b/libmultipath/dict.h index e179453..97c91c8 100644 --- a/libmultipath/dict.h +++ b/libmultipath/dict.h @@ -1,10 +1,7 @@ -#ifndef _DICT_H -#define _DICT_H +#ifndef DICT_H_INCLUDED +#define DICT_H_INCLUDED -#ifndef _VECTOR_H #include "vector.h" -#endif - #include "byteorder.h" struct strbuf; @@ -19,4 +16,4 @@ int print_dev_loss(struct strbuf *buff, unsigned long v); int print_off_int_undef(struct strbuf *buff, long v); int print_auto_resize(struct strbuf *buff, long v); int print_flush_on_last_del(struct strbuf *buff, long v); -#endif /* _DICT_H */ +#endif /* DICT_H_INCLUDED */ diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index acd5179..5bd35ca 100644 --- a/libmultipath/discovery.h +++ b/libmultipath/discovery.h @@ -1,5 +1,5 @@ -#ifndef DISCOVERY_H -#define DISCOVERY_H +#ifndef DISCOVERY_H_INCLUDED +#define DISCOVERY_H_INCLUDED #define SYSFS_PATH_SIZE 255 #define INQUIRY_CMDLEN 6 @@ -84,4 +84,4 @@ enum discovery_mode { #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \ DI_WWID) -#endif /* DISCOVERY_H */ +#endif /* DISCOVERY_H_INCLUDED */ diff --git a/libmultipath/dm-generic.h b/libmultipath/dm-generic.h index 986429f..9055ce1 100644 --- a/libmultipath/dm-generic.h +++ b/libmultipath/dm-generic.h @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _DM_GENERIC_H -#define _DM_GENERIC_H +#ifndef DM_GENERIC_H_INCLUDED +#define DM_GENERIC_H_INCLUDED #include "generic.h" #include "list.h" /* for container_of */ #include "structs.h" @@ -36,4 +36,4 @@ extern const struct gen_multipath_ops dm_gen_multipath_ops; extern const struct gen_pathgroup_ops dm_gen_pathgroup_ops; extern const struct gen_path_ops dm_gen_path_ops; -#endif /* _DM_GENERIC_H */ +#endif /* DM_GENERIC_H_INCLUDED */ diff --git a/libmultipath/dmparser.h b/libmultipath/dmparser.h index 666ae74..43454c3 100644 --- a/libmultipath/dmparser.h +++ b/libmultipath/dmparser.h @@ -1,3 +1,8 @@ +#ifndef DMPARSER_H_INCLUDED +#define DMPARSER_H_INCLUDED + int assemble_map (struct multipath *, char **); int disassemble_map (const struct _vector *, const char *, struct multipath *); int disassemble_status (const char *, struct multipath *); + +#endif diff --git a/libmultipath/file.h b/libmultipath/file.h index 3c75c90..57b517f 100644 --- a/libmultipath/file.h +++ b/libmultipath/file.h @@ -2,8 +2,8 @@ * Copyright (c) 2010 Benjamin Marzinski, Redhat */ -#ifndef _FILE_H -#define _FILE_H +#ifndef FILE_H_INCLUDED +#define FILE_H_INCLUDED #include @@ -11,4 +11,4 @@ int ensure_directories_exist(const char *str, mode_t dir_mode); int open_file(const char *file, int *can_write, const char *header); -#endif /* _FILE_H */ +#endif /* FILE_H_INCLUDED */ diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h index b9cdb36..db1592c 100644 --- a/libmultipath/foreign.h +++ b/libmultipath/foreign.h @@ -14,8 +14,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _FOREIGN_H -#define _FOREIGN_H +#ifndef FOREIGN_H_INCLUDED +#define FOREIGN_H_INCLUDED + #include #include #define LIBMP_FOREIGN_API ((1 << 8) | 2) @@ -320,4 +321,4 @@ is_claimed_by_foreign(struct udev_device *ud) return (rc == FOREIGN_CLAIMED || rc == FOREIGN_OK); } -#endif /* _FOREIGN_H */ +#endif /* FOREIGN_H_INCLUDED */ diff --git a/libmultipath/generic.h b/libmultipath/generic.h index e89848f..c8fe31c 100644 --- a/libmultipath/generic.h +++ b/libmultipath/generic.h @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _GENERIC_H -#define _GENERIC_H +#ifndef GENERIC_H_INCLUDED +#define GENERIC_H_INCLUDED #include "vector.h" /* @@ -138,4 +138,4 @@ struct gen_path { int generic_style(const struct gen_multipath*, struct strbuf *buf, int verbosity); -#endif /* _GENERIC_H */ +#endif /* GENERIC_H_INCLUDED */ diff --git a/libmultipath/hwtable.h b/libmultipath/hwtable.h index 13c5701..737e821 100644 --- a/libmultipath/hwtable.h +++ b/libmultipath/hwtable.h @@ -1,6 +1,6 @@ -#ifndef _HWTABLE_H -#define _HWTABLE_H +#ifndef HWTABLE_H_INCLUDED +#define HWTABLE_H_INCLUDED int setup_default_hwtable (vector hw); -#endif /* _HWTABLE_H */ +#endif /* HWTABLE_H_INCLUDED */ diff --git a/libmultipath/io_err_stat.h b/libmultipath/io_err_stat.h index 53d6d7d..8dc298b 100644 --- a/libmultipath/io_err_stat.h +++ b/libmultipath/io_err_stat.h @@ -1,5 +1,5 @@ -#ifndef _IO_ERR_STAT_H -#define _IO_ERR_STAT_H +#ifndef IO_ERR_STAT_H_INCLUDED +#define IO_ERR_STAT_H_INCLUDED #include "vector.h" #include "lock.h" @@ -12,4 +12,4 @@ void stop_io_err_stat_thread(void); int io_err_stat_handle_pathfail(struct path *path); int need_io_err_check(struct path *pp); -#endif /* _IO_ERR_STAT_H */ +#endif /* IO_ERR_STAT_H_INCLUDED */ diff --git a/libmultipath/libsg.h b/libmultipath/libsg.h index 3994f45..76eb30d 100644 --- a/libmultipath/libsg.h +++ b/libmultipath/libsg.h @@ -1,9 +1,9 @@ -#ifndef _LIBSG_H -#define _LIBSG_H +#ifndef LIBSG_H_INCLUDED +#define LIBSG_H_INCLUDED #define SENSE_BUFF_LEN 32 int sg_read (int sg_fd, unsigned char * buff, int buff_len, unsigned char * sense, int sense_len, unsigned int timeout); -#endif /* _LIBSG_H */ +#endif /* LIBSG_H_INCLUDED */ diff --git a/libmultipath/list.h b/libmultipath/list.h index 248f72b..8f48520 100644 --- a/libmultipath/list.h +++ b/libmultipath/list.h @@ -5,8 +5,8 @@ * */ -#ifndef _LIST_H -#define _LIST_H +#ifndef LIST_H_INCLUDED +#define LIST_H_INCLUDED #include @@ -415,4 +415,4 @@ static inline struct list_head *list_pop(struct list_head *head) &pos->member != (to); \ pos = n, n = list_entry(n->member.prev, typeof(*n), member)) -#endif /* _LIST_H */ +#endif /* LIST_H_INCLUDED */ diff --git a/libmultipath/lock.h b/libmultipath/lock.h index ac80d1d..1c05a77 100644 --- a/libmultipath/lock.h +++ b/libmultipath/lock.h @@ -1,5 +1,5 @@ -#ifndef _LOCK_H -#define _LOCK_H +#ifndef LOCK_H_INCLUDED +#define LOCK_H_INCLUDED #include #include @@ -65,4 +65,4 @@ static inline bool lock_has_waiters(struct mutex_lock *a) void cleanup_lock (void * data); void set_wakeup_fn(struct mutex_lock *lock, wakeup_fn *fn); -#endif /* _LOCK_H */ +#endif /* LOCK_H_INCLUDED */ diff --git a/libmultipath/nvme-lib.h b/libmultipath/nvme-lib.h index 448dd99..059dca8 100644 --- a/libmultipath/nvme-lib.h +++ b/libmultipath/nvme-lib.h @@ -1,5 +1,5 @@ -#ifndef NVME_LIB_H -#define NVME_LIB_H +#ifndef NVME_LIB_H_INCLUDED +#define NVME_LIB_H_INCLUDED #include "nvme.h" @@ -36,4 +36,4 @@ int nvme_id_ctrl_ana(int fd, struct nvme_id_ctrl *ctrl); #undef le64_to_cpu #endif -#endif /* NVME_LIB_H */ +#endif /* NVME_LIB_H_INCLUDED */ diff --git a/libmultipath/nvme/argconfig.h b/libmultipath/nvme/argconfig.h index adb192b..e6c5445 100644 --- a/libmultipath/nvme/argconfig.h +++ b/libmultipath/nvme/argconfig.h @@ -30,8 +30,8 @@ // //////////////////////////////////////////////////////////////////////// -#ifndef argconfig_H -#define argconfig_H +#ifndef NVME_ARGCONFIG_H_INCLUDED +#define NVME_ARGCONFIG_H_INCLUDED #include #include diff --git a/libmultipath/nvme/json.h b/libmultipath/nvme/json.h index c4ea531..70df528 100644 --- a/libmultipath/nvme/json.h +++ b/libmultipath/nvme/json.h @@ -1,5 +1,5 @@ -#ifndef __JSON__H -#define __JSON__H +#ifndef NVME_JSON_H_INCLUDED +#define NVME_JSON_H_INCLUDED struct json_object; struct json_array; diff --git a/libmultipath/nvme/linux/nvme.h b/libmultipath/nvme/linux/nvme.h index 9fc2ae7..f0cb290 100644 --- a/libmultipath/nvme/linux/nvme.h +++ b/libmultipath/nvme/linux/nvme.h @@ -12,8 +12,8 @@ * more details. */ -#ifndef _LINUX_NVME_H -#define _LINUX_NVME_H +#ifndef LINUX_NVME_H_INCLUDED +#define LINUX_NVME_H_INCLUDED #include #include @@ -1525,4 +1525,4 @@ struct nvme_completion { #define NVME_MINOR(ver) (((ver) >> 8) & 0xff) #define NVME_TERTIARY(ver) ((ver) & 0xff) -#endif /* _LINUX_NVME_H */ +#endif /* LINUX_NVME_H_INCLUDED */ diff --git a/libmultipath/nvme/linux/nvme_ioctl.h b/libmultipath/nvme/linux/nvme_ioctl.h index d25a532..3f6623c 100644 --- a/libmultipath/nvme/linux/nvme_ioctl.h +++ b/libmultipath/nvme/linux/nvme_ioctl.h @@ -12,8 +12,8 @@ * more details. */ -#ifndef _UAPI_LINUX_NVME_IOCTL_H -#define _UAPI_LINUX_NVME_IOCTL_H +#ifndef LINUX_NVME_IOCTL_H_INCLUDED +#define LINUX_NVME_IOCTL_H_INCLUDED #include #include @@ -64,4 +64,4 @@ struct nvme_passthru_cmd { #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45) #define NVME_IOCTL_RESCAN _IO('N', 0x46) -#endif /* _UAPI_LINUX_NVME_IOCTL_H */ +#endif /* LINUX_NVME_IOCTL_H_INCLUDED */ diff --git a/libmultipath/nvme/nvme-ioctl.h b/libmultipath/nvme/nvme-ioctl.h index 565f764..246f02e 100644 --- a/libmultipath/nvme/nvme-ioctl.h +++ b/libmultipath/nvme/nvme-ioctl.h @@ -1,5 +1,5 @@ -#ifndef _NVME_LIB_H -#define _NVME_LIB_H +#ifndef NVME_NVME_IOCTL_H_INCLUDED +#define NVME_NVME_IOCTL_H_INCLUDED #include #include @@ -155,4 +155,4 @@ int nvme_sanitize(int fd, __u8 sanact, __u8 ause, __u8 owpass, __u8 oipbp, int nvme_self_test_start(int fd, __u32 nsid, __u32 cdw10); int nvme_self_test_log(int fd, struct nvme_self_test_log *self_test_log); int nvme_virtual_mgmt(int fd, __u32 cdw10, __u32 cdw11, __u32 *result); -#endif /* _NVME_LIB_H */ +#endif /* NVME_NVME_IOCTL_H_INCLUDED */ diff --git a/libmultipath/nvme/nvme.h b/libmultipath/nvme/nvme.h index 57f82a3..019bce1 100644 --- a/libmultipath/nvme/nvme.h +++ b/libmultipath/nvme/nvme.h @@ -12,8 +12,8 @@ * more details. */ -#ifndef _NVME_H -#define _NVME_H +#ifndef NVME_NVME_H_INCLUDED +#define NVME_NVME_H_INCLUDED #include #include @@ -237,4 +237,4 @@ static inline bool is_64bit_reg(__u32 offset) return false; } -#endif /* _NVME_H */ +#endif /* NVME_NVME_H_INCLUDED */ diff --git a/libmultipath/nvme/plugin.h b/libmultipath/nvme/plugin.h index 91079fb..6f12946 100644 --- a/libmultipath/nvme/plugin.h +++ b/libmultipath/nvme/plugin.h @@ -1,5 +1,5 @@ -#ifndef PLUGIN_H -#define PLUGIN_H +#ifndef NVME_PLUGIN_H_INCLUDED +#define NVME_PLUGIN_H_INCLUDED #include diff --git a/libmultipath/pgpolicies.h b/libmultipath/pgpolicies.h index 9e4ddda..4469f8b 100644 --- a/libmultipath/pgpolicies.h +++ b/libmultipath/pgpolicies.h @@ -1,5 +1,5 @@ -#ifndef _PGPOLICIES_H -#define _PGPOLICIES_H +#ifndef PGPOLICIES_H_INCLUDED +#define PGPOLICIES_H_INCLUDED #if 0 #ifndef _MAIN_H diff --git a/libmultipath/print.h b/libmultipath/print.h index 52f5b25..eb4cbc2 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -1,5 +1,5 @@ -#ifndef _PRINT_H -#define _PRINT_H +#ifndef PRINT_H_INCLUDED +#define PRINT_H_INCLUDED #include "dm-generic.h" #define PRINT_PATH_CHECKER "%i %d %D %p %t %T %o %C" @@ -73,4 +73,4 @@ int snprint_multipath_attr(const struct gen_multipath* gm, struct strbuf *buf, char wildcard); int snprint_multipath_style(const struct gen_multipath *gmp, struct strbuf *style, int verbosity); -#endif /* _PRINT_H */ +#endif /* PRINT_H_INCLUDED */ diff --git a/libmultipath/prio.h b/libmultipath/prio.h index 318d260..119b75f 100644 --- a/libmultipath/prio.h +++ b/libmultipath/prio.h @@ -1,5 +1,5 @@ -#ifndef _PRIO_H -#define _PRIO_H +#ifndef PRIO_H_INCLUDED +#define PRIO_H_INCLUDED /* * knowing about path struct gives flexibility to prioritizers @@ -67,4 +67,4 @@ int prio_set_args (struct prio *, const char *); /* The only function exported by prioritizer dynamic libraries (.so) */ int getprio(struct path *, char *); -#endif /* _PRIO_H */ +#endif /* PRIO_H_INCLUDED */ diff --git a/libmultipath/prioritizers/alua.h b/libmultipath/prioritizers/alua.h index 78a3d15..88fd6af 100644 --- a/libmultipath/prioritizers/alua.h +++ b/libmultipath/prioritizers/alua.h @@ -1,5 +1,5 @@ -#ifndef _ALUA_H -#define _ALUA_H +#ifndef ALUA_H_INCLUDED +#define ALUA_H_INCLUDED #include "alua_rtpg.h" diff --git a/libmultipath/prioritizers/alua_rtpg.h b/libmultipath/prioritizers/alua_rtpg.h index c5f9a8f..ff6ec0e 100644 --- a/libmultipath/prioritizers/alua_rtpg.h +++ b/libmultipath/prioritizers/alua_rtpg.h @@ -12,8 +12,8 @@ * * This file is released under the GPL. */ -#ifndef __RTPG_H__ -#define __RTPG_H__ +#ifndef ALUA_RTPG_H_INCLUDED +#define ALUA_RTPG_H_INCLUDED #include "alua_spc3.h" #define RTPG_SUCCESS 0 @@ -26,4 +26,4 @@ int get_target_port_group_support(const struct path *pp); int get_target_port_group(const struct path *pp); int get_asymmetric_access_state(const struct path *pp, unsigned int tpg); -#endif /* __RTPG_H__ */ +#endif /* ALUA_RTPG_H_INCLUDED */ diff --git a/libmultipath/prioritizers/alua_spc3.h b/libmultipath/prioritizers/alua_spc3.h index e1a6c07..6011c4d 100644 --- a/libmultipath/prioritizers/alua_spc3.h +++ b/libmultipath/prioritizers/alua_spc3.h @@ -12,8 +12,8 @@ * * This file is released under the GPL. */ -#ifndef __SPC3_H__ -#define __SPC3_H__ +#ifndef ALUA_SPC3_H_INCLUDED +#define ALUA_SPC3_H_INCLUDED #include "../unaligned.h" /*============================================================================= @@ -323,4 +323,4 @@ struct rtpg_data { ) \ ) -#endif /* __SPC3_H__ */ +#endif /* ALUA_SPC3_H_INCLUDED */ diff --git a/libmultipath/prioritizers/weightedpath.h b/libmultipath/prioritizers/weightedpath.h index a1b268f..a8030fd 100644 --- a/libmultipath/prioritizers/weightedpath.h +++ b/libmultipath/prioritizers/weightedpath.h @@ -1,5 +1,5 @@ -#ifndef _WEIGHTED_PATH_H -#define _WEIGHTED_PATH_H +#ifndef WEIGHTEDPATH_H_INCLUDED +#define WEIGHTEDPATH_H_INCLUDED #define PRIO_WEIGHTED_PATH "weightedpath" #define HBTL "hbtl" diff --git a/libmultipath/prkey.h b/libmultipath/prkey.h index 43afd5e..a89a617 100644 --- a/libmultipath/prkey.h +++ b/libmultipath/prkey.h @@ -1,5 +1,5 @@ -#ifndef _PRKEY_H -#define _PRKEY_H +#ifndef PRKEY_H_INCLUDED +#define PRKEY_H_INCLUDED #include "structs.h" #include @@ -20,4 +20,4 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey, uint8_t sa_flags); int get_prkey(struct multipath *mpp, uint64_t *prkey, uint8_t *sa_flags); -#endif /* _PRKEY_H */ +#endif /* PRKEY_H_INCLUDED */ diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h index 73615c2..5593005 100644 --- a/libmultipath/propsel.h +++ b/libmultipath/propsel.h @@ -1,3 +1,5 @@ +#ifndef PROPSEL_H_INCLUDED +#define PROPSEL_H_INCLUDED int select_rr_weight (struct config *conf, struct multipath * mp); int select_pgfailback (struct config *conf, struct multipath * mp); int select_detect_pgpolicy (struct config *conf, struct multipath * mp); @@ -42,3 +44,4 @@ void reconcile_features_with_options(const char *id, char **features, int *retain_hwhandler); int select_all_tg_pt (struct config *conf, struct multipath * mp); int select_vpd_vendor_id (struct path *pp); +#endif diff --git a/libmultipath/sg_include.h b/libmultipath/sg_include.h index 750a13a..43bff2d 100644 --- a/libmultipath/sg_include.h +++ b/libmultipath/sg_include.h @@ -1,3 +1,5 @@ +#ifndef SG_INCLUDE_H_INCLUDED +#define SG_INCLUDE_H_INCLUDED #define __user #include @@ -23,3 +25,4 @@ * retry or fail IO */ #define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */ #endif +#endif diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 9150988..6b5de7a 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -1,5 +1,5 @@ -#ifndef _STRUCTS_H -#define _STRUCTS_H +#ifndef STRUCTS_H_INCLUDED +#define STRUCTS_H_INCLUDED #include #include @@ -584,4 +584,4 @@ int pathcmp (const struct pathgroup *, const struct pathgroup *); int add_feature (char **, const char *); int remove_feature (char **, const char *); -#endif /* _STRUCTS_H */ +#endif /* STRUCTS_H_INCLUDED */ diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h index 01f5dc4..541327d 100644 --- a/libmultipath/structs_vec.h +++ b/libmultipath/structs_vec.h @@ -1,5 +1,5 @@ -#ifndef _STRUCTS_VEC_H -#define _STRUCTS_VEC_H +#ifndef STRUCTS_VEC_H_INCLUDED +#define STRUCTS_VEC_H_INCLUDED #include "vector.h" #include "config.h" @@ -39,4 +39,4 @@ int update_multipath_table (struct multipath *mpp, vector pathvec, int flags); int update_multipath_status (struct multipath *mpp); vector get_used_hwes(const struct _vector *pathvec); -#endif /* _STRUCTS_VEC_H */ +#endif /* STRUCTS_VEC_H_INCLUDED */ diff --git a/libmultipath/switchgroup.h b/libmultipath/switchgroup.h index 9365e2e..e499b92 100644 --- a/libmultipath/switchgroup.h +++ b/libmultipath/switchgroup.h @@ -1,2 +1,7 @@ +#ifndef SWITCHGROUP_H_INCLUDED +#define SWITCHGROUP_H_INCLUDED + void path_group_prio_update (struct pathgroup * pgp); int select_path_group (struct multipath * mpp); + +#endif diff --git a/libmultipath/sysfs.h b/libmultipath/sysfs.h index 3be3f66..45f24c3 100644 --- a/libmultipath/sysfs.h +++ b/libmultipath/sysfs.h @@ -2,8 +2,8 @@ * sysfs.h */ -#ifndef _LIBMULTIPATH_SYSFS_H -#define _LIBMULTIPATH_SYSFS_H +#ifndef SYSFS_H_INCLUDED +#define SYSFS_H_INCLUDED #include #include "strbuf.h" diff --git a/libmultipath/uevent.h b/libmultipath/uevent.h index 53a7ca2..6929678 100644 --- a/libmultipath/uevent.h +++ b/libmultipath/uevent.h @@ -1,5 +1,5 @@ -#ifndef _UEVENT_H -#define _UEVENT_H +#ifndef UEVENT_H_INCLUDED +#define UEVENT_H_INCLUDED /* * buffer for environment variables, the kernel's size in @@ -69,4 +69,4 @@ static inline char *uevent_get_dm_action(const struct uevent *uev) return uevent_get_dm_str(uev, "DM_ACTION"); } -#endif /* _UEVENT_H */ +#endif /* UEVENT_H_INCLUDED */ diff --git a/libmultipath/unaligned.h b/libmultipath/unaligned.h index b9eaa7c..ea8b4a9 100644 --- a/libmultipath/unaligned.h +++ b/libmultipath/unaligned.h @@ -1,5 +1,5 @@ -#ifndef _UNALIGNED_H_ -#define _UNALIGNED_H_ +#ifndef UNALIGNED_H_INCLUDED +#define UNALIGNED_H_INCLUDED #include @@ -51,4 +51,4 @@ static inline void put_unaligned_be64(uint64_t val, void *ptr) put_unaligned_be32(val, p + 4); } -#endif /* _UNALIGNED_H_ */ +#endif /* UNALIGNED_H_INCLUDED */ diff --git a/libmultipath/valid.h b/libmultipath/valid.h index 731e6ef..96ba554 100644 --- a/libmultipath/valid.h +++ b/libmultipath/valid.h @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _VALID_H -#define _VALID_H +#ifndef VALID_H_INCLUDED +#define VALID_H_INCLUDED /* * PATH_IS_VALID_NO_CHECK is returned when multipath should claim @@ -39,4 +39,4 @@ enum is_path_valid_result { int is_path_valid(const char *name, struct config *conf, struct path *pp, bool check_multipathd); -#endif /* _VALID_D */ +#endif /* VALID_H_INCLUDED */ diff --git a/libmultipath/version.h b/libmultipath/version.h index 271d8e7..5dae233 100644 --- a/libmultipath/version.h +++ b/libmultipath/version.h @@ -17,8 +17,8 @@ * * Copyright (c) 2006 Christophe Varoqui */ -#ifndef _VERSION_H -#define _VERSION_H +#ifndef VERSION_H_INCLUDED +#define VERSION_H_INCLUDED #define VERSION_CODE 0x000909 /* MMDDYY, in hex */ @@ -35,4 +35,4 @@ MULTIPATH_VERSION(VERSION_CODE), \ MULTIPATH_VERSION(DATE_CODE) -#endif /* _VERSION_H */ +#endif /* VERSION_H_INCLUDED */ diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h index 0c6ee54..ee47ad9 100644 --- a/libmultipath/wwids.h +++ b/libmultipath/wwids.h @@ -2,8 +2,8 @@ * Copyright (c) 2010 Benjamin Marzinski, Redhat */ -#ifndef _WWIDS_H -#define _WWIDS_H +#ifndef WWIDS_H_INCLUDED +#define WWIDS_H_INCLUDED #define WWIDS_FILE_HEADER \ "# Multipath wwids, Version : 1.0\n" \ @@ -29,4 +29,4 @@ enum { int is_failed_wwid(const char *wwid); int mark_failed_wwid(const char *wwid); int unmark_failed_wwid(const char *wwid); -#endif /* _WWIDS_H */ +#endif /* WWIDS_H_INCLUDED */ diff --git a/mpathpersist/main.h b/mpathpersist/main.h index bfbb82e..fc0bb26 100644 --- a/mpathpersist/main.h +++ b/mpathpersist/main.h @@ -1,3 +1,6 @@ +#ifndef MPATHPERSIST_MAIN_H_INCLUDED +#define MPATHPERSIST_MAIN_H_INCLUDED + static struct option long_options[] = { {"verbose", 1, NULL, 'v'}, {"clear", 0, NULL, 'C'}, @@ -28,3 +31,4 @@ static struct option long_options[] = { }; static void usage(void); +#endif diff --git a/multipathd/cli.h b/multipathd/cli.h index c6b79c9..2940832 100644 --- a/multipathd/cli.h +++ b/multipathd/cli.h @@ -1,5 +1,5 @@ -#ifndef _CLI_H_ -#define _CLI_H_ +#ifndef CLI_H_INCLUDED +#define CLI_H_INCLUDED #include @@ -157,4 +157,4 @@ vector get_keys(void); vector get_handlers(void); struct key *find_key (const char * str); -#endif /* _CLI_H_ */ +#endif /* CLI_H_INCLUDED */ diff --git a/multipathd/cli_handlers.h b/multipathd/cli_handlers.h index 7eaf847..2303d8a 100644 --- a/multipathd/cli_handlers.h +++ b/multipathd/cli_handlers.h @@ -1,5 +1,5 @@ -#ifndef _CLI_HANDLERS_H -#define _CLI_HANDLERS_H +#ifndef CLI_HANDLERS_H_INCLUDED +#define CLI_HANDLERS_H_INCLUDED void init_handler_callbacks(void); diff --git a/multipathd/dmevents.h b/multipathd/dmevents.h index 012fbad..debb3da 100644 --- a/multipathd/dmevents.h +++ b/multipathd/dmevents.h @@ -1,5 +1,5 @@ -#ifndef _DMEVENTS_H -#define _DMEVENTS_H +#ifndef DMEVENTS_H_INCLUDED +#define DMEVENTS_H_INCLUDED #include "structs_vec.h" @@ -10,4 +10,4 @@ int watch_dmevents(char *name); void unwatch_all_dmevents(void); void *wait_dmevents (void *unused); -#endif /* _DMEVENTS_H */ +#endif /* DMEVENTS_H_INCLUDED */ diff --git a/multipathd/fpin.h b/multipathd/fpin.h index 3c37444..981140a 100644 --- a/multipathd/fpin.h +++ b/multipathd/fpin.h @@ -1,5 +1,5 @@ -#ifndef __FPIN_H__ -#define __FPIN_H__ +#ifndef FPIN_H_INCLUDED +#define FPIN_H_INCLUDED #include "autoconfig.h" #ifdef FPIN_EVENT_HANDLER diff --git a/multipathd/init_unwinder.h b/multipathd/init_unwinder.h index ada09f8..edaa8be 100644 --- a/multipathd/init_unwinder.h +++ b/multipathd/init_unwinder.h @@ -1,5 +1,5 @@ -#ifndef _INIT_UNWINDER_H -#define _INIT_UNWINDER_H 1 +#ifndef INIT_UNWINDER_H_INCLUDED +#define INIT_UNWINDER_H_INCLUDED /* * init_unwinder(): make sure unwinder symbols are loaded diff --git a/multipathd/main.h b/multipathd/main.h index ef838a0..c94362e 100644 --- a/multipathd/main.h +++ b/multipathd/main.h @@ -1,5 +1,5 @@ -#ifndef MAIN_H -#define MAIN_H +#ifndef MAIN_H_INCLUDED +#define MAIN_H_INCLUDED #define MAPGCINT 5 @@ -52,4 +52,4 @@ bool check_path_wwid_change(struct path *pp); int finish_path_init(struct path *pp, struct vectors * vecs); int resize_map(struct multipath *mpp, unsigned long long size, struct vectors *vecs); -#endif /* MAIN_H */ +#endif /* MAIN_H_INCLUDED */ diff --git a/multipathd/pidfile.h b/multipathd/pidfile.h index d308892..fae5774 100644 --- a/multipathd/pidfile.h +++ b/multipathd/pidfile.h @@ -1 +1,5 @@ +#ifndef PIDFILE_H_INCLUDED +#define PIDFILE_H_INCLUDED int pidfile_create(const char *pidFile, pid_t pid); +#endif + diff --git a/multipathd/uxclnt.h b/multipathd/uxclnt.h index 8e2cdce..dd66c52 100644 --- a/multipathd/uxclnt.h +++ b/multipathd/uxclnt.h @@ -1 +1,6 @@ +#ifndef UXCLNT_H_INCLUDED +#define UXCLNT_H_INCLUDED + int uxclnt(char * inbuf, unsigned int timeout); + +#endif diff --git a/multipathd/uxlsnr.h b/multipathd/uxlsnr.h index 3e45930..a14a667 100644 --- a/multipathd/uxlsnr.h +++ b/multipathd/uxlsnr.h @@ -1,5 +1,5 @@ -#ifndef _UXLSNR_H -#define _UXLSNR_H +#ifndef UXLSNR_H_INCLUDED +#define UXLSNR_H_INCLUDED #include diff --git a/multipathd/waiter.h b/multipathd/waiter.h index 28e0f6d..7b02272 100644 --- a/multipathd/waiter.h +++ b/multipathd/waiter.h @@ -1,5 +1,5 @@ -#ifndef _WAITER_H -#define _WAITER_H +#ifndef WAITER_H_INCLUDED +#define WAITER_H_INCLUDED extern pthread_attr_t waiter_attr; @@ -14,4 +14,4 @@ struct event_thread { void stop_waiter_thread (struct multipath *mpp); int start_waiter_thread (struct multipath *mpp, struct vectors *vecs); -#endif /* _WAITER_H */ +#endif /* WAITER_H_INCLUDED */ diff --git a/tests/test-lib.h b/tests/test-lib.h index efd03a7..61e67b2 100644 --- a/tests/test-lib.h +++ b/tests/test-lib.h @@ -1,5 +1,5 @@ -#ifndef __LIB_H -#define __LIB_H +#ifndef TEST_LIB_H_INCLUDED +#define TEST_LIB_H_INCLUDED extern const int default_mask; extern const char default_devnode[]; diff --git a/tests/test-log.h b/tests/test-log.h index 6d22cd2..48c0c17 100644 --- a/tests/test-log.h +++ b/tests/test-log.h @@ -1,5 +1,5 @@ -#ifndef _TEST_LOG_H -#define _TEST_LOG_H +#ifndef TEST_LOG_H_INCLUDED +#define TEST_LOG_H_INCLUDED __attribute__((format(printf, 2, 0))) void __wrap_dlog (int prio, const char * fmt, ...); diff --git a/tests/wrap64.h b/tests/wrap64.h index af6cc2b..fe985a7 100644 --- a/tests/wrap64.h +++ b/tests/wrap64.h @@ -1,5 +1,5 @@ -#ifndef _WRAP64_H -#define _WRAP64_H 1 +#ifndef WRAP64_H_INCLUDED +#define WRAP64_H_INCLUDED #include #include /* The following include is required for LIBAIO_REDIRECT */ From patchwork Thu Aug 8 15:25:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757807 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FE0318FDA7 for ; Thu, 8 Aug 2024 15:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130807; cv=none; b=fK3Xtj2gH1BIB48tQjla3ofm+gai3+wgcfxtjA7vk+/Y4EAJDc+oWWvjCVGWYazUegs3bAgjV9ZfcxkNZj6NHScluqlPMPa3fLkyfBhqqYlJcCHjrYB4rYjoFr9gPW08i4s/BxO94jk9SU1spseUZnPEFokturq98n/z8quAdDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130807; c=relaxed/simple; bh=yM2+5wR+3WVLxjnw7clxkHPOHar/4GrQi6Do75u6M5A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cU1FwJIo8nmM7s9ThMuhLg4/2UWX3A23GQa72TcOappL8qB6B1N27RP4z5aqVV7IsDCogWNSr8/fnp1ssbEEVGKctqK++1Z3dRE5BlxLZzpKoO1LTsL+jZ2axLPkAbXPO7zbH1e+7JD9vhLwvENH0oXnJ4iwRg3xcHUa3avwwxs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Cs3FNqvi; arc=none smtp.client-ip=209.85.167.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Cs3FNqvi" Received: by mail-lf1-f67.google.com with SMTP id 2adb3069b0e04-530ae4ef29dso1894998e87.3 for ; Thu, 08 Aug 2024 08:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130803; x=1723735603; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/HQx1WRB9i3UBAol/93utIq2Iv/NseeH17cmgl+HyAM=; b=Cs3FNqviWH9LqTnr9CgCsMGw6qJ/0VM49yNrKEyp/aXFBIH9nXQlWiKgDcxAA33VOD fwywLM8JX4dSTKRZ6ImMLBRA5SQs5cAYAEeK/m876b9P+WiPsRJkDAOQ1H9sg4D9AxV0 MR4lZ4Uq9xWKXh2XSwK/lsPeidyfelGOjlVtUurZXvwxdbcFuWiaxdhO5SksmqUvExTB yAPBD9aYsAxa9rugiDORFaw1GA6hYdAJTbcHDJQGJPFFmM7EYfwgeGk31qs0LRJ7Pprz GEUIIPLklCWpX+9/S2ZFE/N8VrnPh8uR1gH6UFj6KdgZ5yTkd3qKDmsGvPISsZcQrMkR bh1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130803; x=1723735603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/HQx1WRB9i3UBAol/93utIq2Iv/NseeH17cmgl+HyAM=; b=ZiWO1BqHpRlz3cZDylLGRQSnnPd6k1/oY8HOd3f+vQsT/1yHmKczTcr1p/JHPiSiig vDyc5n00YAGAFjJrlxU0zONO9ae8wCV+9JlbGJ+/NUGRC0K1OMVLtPgOB9STeUKK1SOI 6SnPb0+gSmMeb9H2yheH1dGYT32jis484oMLiUyLbSq3KVbeNrM/53Z7i+qEKJZZ6cA0 tRomKdnsp34TdJWLh0D7ECUrFBTxKnruMxCwbI5cJHVQSoX5xuK247TnVSIhBRVvSW/v X3qwAWeJ93VHoA2JC61DOXOG4B5k/o1FYQfa9kzaiIkuCLgn7xEXLS67q/CGxrfJVhpn uxZg== X-Gm-Message-State: AOJu0YwJ4egd8x2YF/Id3th4PuSNt1dCU5815yq3MqUzUrICrN+gLXIZ RWZRxDS0uAMbacftVjYuyD2SdoYuJCzmzQRPRQMj5pf4KdkVL7bKyGYKNTydyxI= X-Google-Smtp-Source: AGHT+IHhoFeEYCiLnMq0fbuwyV13P9Dg6AJt8xKyCxtjCnZl4+wY1FBAeUcAoUogeU4WrKqNN6usrQ== X-Received: by 2002:a05:6512:3e1d:b0:52c:deb9:904b with SMTP id 2adb3069b0e04-530e58769c5mr2320756e87.38.1723130802930; Thu, 08 Aug 2024 08:26:42 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ecad25sm755491966b.221.2024.08.08.08.26.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:42 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 09/41] libmpathcmd: rename __mpath_connect() to mpath_connect__() Date: Thu, 8 Aug 2024 17:25:48 +0200 Message-ID: <20240808152620.93965-10-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Identifiers starting with double underscore are forbidden, see https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html Signed-off-by: Martin Wilck --- libmpathcmd/libmpathcmd.version | 4 ++-- libmpathcmd/mpath_cmd.c | 4 ++-- libmpathcmd/mpath_cmd.h | 2 +- libmultipath/valid.c | 2 +- tests/valid.c | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libmpathcmd/libmpathcmd.version b/libmpathcmd/libmpathcmd.version index f100628..a786c25 100644 --- a/libmpathcmd/libmpathcmd.version +++ b/libmpathcmd/libmpathcmd.version @@ -10,10 +10,10 @@ * * See libmultipath.version for general policy about version numbers. */ -LIBMPATHCMD_1.0.0 { +LIBMPATHCMD_2.0.0 { global: - __mpath_connect; mpath_connect; + mpath_connect__; mpath_disconnect; mpath_process_cmd; mpath_recv_reply; diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c index d7c3371..1fa036c 100644 --- a/libmpathcmd/mpath_cmd.c +++ b/libmpathcmd/mpath_cmd.c @@ -94,7 +94,7 @@ static size_t write_all(int fd, const void *buf, size_t len) /* * connect to a unix domain socket */ -int __mpath_connect(int nonblocking) +int mpath_connect__(int nonblocking) { int fd; size_t len; @@ -138,7 +138,7 @@ int __mpath_connect(int nonblocking) */ int mpath_connect(void) { - return __mpath_connect(0); + return mpath_connect__(0); } int mpath_disconnect(int fd) diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h index b58aaac..bf30c1e 100644 --- a/libmpathcmd/mpath_cmd.h +++ b/libmpathcmd/mpath_cmd.h @@ -47,7 +47,7 @@ extern "C" { * RETURNS: * A file descriptor on success. -1 on failure (with errno set). */ -int __mpath_connect(int nonblocking); +int mpath_connect__(int nonblocking); /* * DESCRIPTION: diff --git a/libmultipath/valid.c b/libmultipath/valid.c index b7e0cc9..d751780 100644 --- a/libmultipath/valid.c +++ b/libmultipath/valid.c @@ -315,7 +315,7 @@ is_path_valid(const char *name, struct config *conf, struct path *pp, } if (check_multipathd) { - fd = __mpath_connect(1); + fd = mpath_connect__(1); if (fd < 0) { if (errno != EAGAIN) { condlog(3, "multipathd not running"); diff --git a/tests/valid.c b/tests/valid.c index ecaeb46..cb56734 100644 --- a/tests/valid.c +++ b/tests/valid.c @@ -52,7 +52,7 @@ bool __wrap_sysfs_is_multipathed(struct path *pp, bool set_wwid) return is_multipathed; } -int __wrap___mpath_connect(int nonblocking) +int __wrap_mpath_connect__(int nonblocking) { bool connected = mock_type(bool); assert_int_equal(nonblocking, 1); @@ -223,10 +223,10 @@ static void setup_passing(char *name, char *wwid, unsigned int check_multipathd, if (stage == STAGE_IS_MULTIPATHED) return; if (check_multipathd == CHECK_MPATHD_RUNNING) - will_return(__wrap___mpath_connect, true); + will_return(__wrap_mpath_connect__, true); else if (check_multipathd == CHECK_MPATHD_EAGAIN) { - will_return(__wrap___mpath_connect, false); - will_return(__wrap___mpath_connect, EAGAIN); + will_return(__wrap_mpath_connect__, false); + will_return(__wrap_mpath_connect__, EAGAIN); } /* nothing for CHECK_MPATHD_SKIP */ @@ -332,8 +332,8 @@ static void test_check_multipathd(void **state) conf.find_multipaths = FIND_MULTIPATHS_STRICT; /* test failed check to see if multipathd is active */ will_return(__wrap_sysfs_is_multipathed, false); - will_return(__wrap___mpath_connect, false); - will_return(__wrap___mpath_connect, ECONNREFUSED); + will_return(__wrap_mpath_connect__, false); + will_return(__wrap_mpath_connect__, ECONNREFUSED); assert_int_equal(is_path_valid(name, &conf, &pp, true), PATH_IS_NOT_VALID); From patchwork Thu Aug 8 15:25:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757809 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49F7D18FC6F for ; Thu, 8 Aug 2024 15:26:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130808; cv=none; b=RbFiUDWuEgEYHRqiehn6JbPGA4MJqIhyjs8l3+MmslPSYCco81LsoU9i5u0GVjZ+YGF2EfvCtnD8zNmNfQJOJ+InZn8raOY5jBmd+CprNx6/GzQnCBH06Y4m4H+YPX/KtvSMsBxOvBifQMfb9IQlJUUbHCsccAV1+104tlGS6MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130808; c=relaxed/simple; bh=DAtJEXT1ojAh3hFDQXQtASaKqCJi4njDa+4jclXZDeA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WQauWXFxVYTyybZhzy2pnDAonNmVGGbEudnoXo8hPYI3Sk1hvQ/+5z2E4rSzZuraP+h9g5C43+P567fb846nlHTASj5KRnP7emLvlhDv9eDHcwXseEKeZSfenQaRCpMo3AUeB+DRNxTi9dvySoYFGjH3FCxj7n8r/8UHGSvg3r4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=VKJ8Frnk; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="VKJ8Frnk" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5b3fff87e6bso1186224a12.0 for ; Thu, 08 Aug 2024 08:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130804; x=1723735604; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6EmmZyOAsa+s5ItxmejNGsvmjsNNyByWDgiAAI0e2I0=; b=VKJ8FrnkfbNihJnxEW14KWBG9z9tsIqkG5N7H9H2h3Ib1GKn8JVjct1AZObuCxfbmm JV3jFWQ/0UqLwjsjIw/iFfvXIrqqHWUsRR98MrVTFQHsH/gzllfYP2OoRxLROoFETJRA gmWIF2I2S+bUb3U58bdzkn4spTuwT9vAJiA1R8DJiP/WYVEMQ915ghQ5MC3ceQa74wja f1eMWVL+iCPNOZxjkzxJ8euZfOl+GAUWzbDIY/K68wU42Aqf//p3tkcX4nMHKbiHRa+6 +oES5vE/jzLnqLqt34Z8bgRQAPcMJnESNqvbrL6tRB669n2GV1qrsY5eEQvzaBjT2qT8 vK4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130804; x=1723735604; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6EmmZyOAsa+s5ItxmejNGsvmjsNNyByWDgiAAI0e2I0=; b=I0fQHG6EWCBMCo+DEkCG1zfrQNbJK4ZYEfT3WK+wSFGDaBvAW+09d/0jQyWt9ZCgFB OrxtJz1vrb5AmboYkmAy24wX3Jtz2QbTXg/XynyT2NcNawpqP0z8S9IZHqj5rtGfWdv5 msdC/QmlMSW0+JBJgF/lKE9iehQaZvoVYw5sbXFI1KSrey7dyftO8JT7j2w74DFsdy9V IV3FSiasOOT7PovzzY5MNDoWkbG/ue7yGkXvSDbG8y4TPWmvX/7Gt61Vlu5614dp8NPB lNrZQ6qNM66rHQfr+4rV6vYkuEQvurGMZoEUEKcYhr5XzIq+QM2OBSHzeysheS/34TIN aFmg== X-Gm-Message-State: AOJu0Yz+SIKo2LqL9MWEe3/1t7NNb871q+3B47HT5QPeRf5T1N58TG72 9nFyDKnDis2qo5aMTW45tYwP9XLlpg2mOYZcpgxC1ob7CrM1TbFVUbYlA1/3kBM= X-Google-Smtp-Source: AGHT+IGNWcNxadhXIsme1tPaqrNK6DC3H48EZiqVJig6G/dDzJ64brwtRxlF9trXuMsav4UQQ1TRVg== X-Received: by 2002:a05:6402:909:b0:5a1:61a7:56ce with SMTP id 4fb4d7f45d1cf-5bbb2356e1emr1909151a12.35.1723130804277; Thu, 08 Aug 2024 08:26:44 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2d35704sm729954a12.66.2024.08.08.08.26.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:44 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 10/41] libmpathutil: rename _MAX_CMD_LEN Date: Thu, 8 Aug 2024 17:25:49 +0200 Message-ID: <20240808152620.93965-11-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libdmmp/libdmmp.c | 2 +- libmpathutil/uxsock.h | 2 +- multipathd/uxlsnr.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libdmmp/libdmmp.c b/libdmmp/libdmmp.c index fcfba06..1bfdbed 100644 --- a/libdmmp/libdmmp.c +++ b/libdmmp/libdmmp.c @@ -46,7 +46,7 @@ #define _DMMP_JSON_MAPS_KEY "maps" #define _ERRNO_STR_BUFF_SIZE 256 #define _IPC_MAX_CMD_LEN 512 -/* ^ Was _MAX_CMD_LEN in ./libmultipath/uxsock.h */ +/* ^ Was MAX_CMD_LEN in ./libmultipath/uxsock.h */ #define _LAST_ERR_MSG_BUFF_SIZE 1024 struct dmmp_context { diff --git a/libmpathutil/uxsock.h b/libmpathutil/uxsock.h index 8157060..1726a96 100644 --- a/libmpathutil/uxsock.h +++ b/libmpathutil/uxsock.h @@ -6,5 +6,5 @@ int ux_socket_listen(const char *name); int send_packet(int fd, const char *buf); int recv_packet(int fd, char **buf, unsigned int timeout); -#define _MAX_CMD_LEN 512 +#define MAX_CMD_LEN 512 #endif diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c index 185e0a0..198f382 100644 --- a/multipathd/uxlsnr.c +++ b/multipathd/uxlsnr.c @@ -59,7 +59,7 @@ struct client { int fd; vector cmdvec; /* NUL byte at end */ - char cmd[_MAX_CMD_LEN + 1]; + char cmd[MAX_CMD_LEN + 1]; struct strbuf reply; struct handler *handler; size_t cmd_len, len; @@ -477,7 +477,7 @@ static int client_state_machine(struct client *c, struct vectors *vecs, condlog(1, "%s: cli[%d]: failed to receive reply len: %zd", __func__, c->fd, n); c->error = -ECONNRESET; - } else if (len <= 0 || len > _MAX_CMD_LEN) { + } else if (len <= 0 || len > MAX_CMD_LEN) { condlog(1, "%s: cli[%d]: invalid command length (%zu bytes)", __func__, c->fd, len); c->error = -ECONNRESET; From patchwork Thu Aug 8 15:25:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757810 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5699718FDB0 for ; Thu, 8 Aug 2024 15:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130809; cv=none; b=IvDi45a12OpVZfqA7UWRMMJoaEvB30k7cox1jH62BDDuFn0tSz2ipuwE5uwpf9ZIcqDDeQfWTQngzWuyGiREquGMWRva9iRyoNArK5h19yUUX4/SwfLfcUrH+VtWhpBONp7nMWmPh7sIjQhdKe50O1wUQK05MDHk4WrczwgF0T8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130809; c=relaxed/simple; bh=NEJWv1pFsKcFE53Ydr8hrgTvgVA7rjYwF8Z6wEEuJ3s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jWwW/2U5FBI/hc1ZR/qhh6GE5FuAt4NNnn54FMMqiTstEM3W1lLw1lrBAWWISnDCb1qQUKV1gbl9RJ5YkT8DpXFWFA7dtltFJ7mYBzmxXsW6Qp6LRzZURbk1/nqAUnnmAJ/MmW8MixSOsRG2jVAsk6HDj03i7acU/seDxGent48= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=g7R4fkzr; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="g7R4fkzr" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5bb8e62570fso1333292a12.1 for ; Thu, 08 Aug 2024 08:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130806; x=1723735606; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9PcjxzbInZeqEADv0Gt24M9Oy6TIVnsEVIUktXEE4wE=; b=g7R4fkzrAeWDTrScTwqL3zogsVAwm3Js9FwPZYg6/jKxG7VHMkC92NAYXdrhlQQbVu cnURZ7P2L0BOKiC2bgf1vEeI7m2T6VhAijz0blnu1f4+UotlwfyBEJiEJv2Zk6x+oQy6 q/XRyO/KrddXVPsq9/retbMJkPQJX5cB+DhiiJLyvSAcHJBsjewpOWo4T0lPQtNDLaPG VRCsvDrQf5bt4e+UmoDKIyhnrTvDLQNHcnw/zU3CHiyk6PUirK0jurDYfr9RebiQ35up qr3gfDafLLoj5SW6bXE7NAx0iTjIgc+03/+BiBosjzwF8srJKpntFCRf4Uo08+qMG1kA 8++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130806; x=1723735606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9PcjxzbInZeqEADv0Gt24M9Oy6TIVnsEVIUktXEE4wE=; b=w5fQ/krDDAw9C+2r5Sw7HuwtJ8P8MUUejRHzQz1nRET6aa65YUh+h9alTyPwi4ajij +M4gJvJyD8QlY04mYhb8hN0vftNUELXN4U1WS9lI6yUbCsIHE4q2N65xv2ilYPbqSCB4 aV/t2Vwh82mdwxbvDgu1iwUlipc0YAMWOtFU4u63ES+rsatbqfCFZPDyrh+wLrDaR7bn vliz3qCDYLI6jalggXdqvmB29oanNICVqYlBtsLIaIGtx66mn1wlQS0ABYirCn2orc1f u31pzrSVpD1PS+IAunpGIrclRvswOXEYtX0MTo5IjAy6GDnRx/TbJML41YRuktI3EAl8 hy4g== X-Gm-Message-State: AOJu0Yx1rJVFM8J4xwJHF6Y2geVEzUu7LboBKhZ7s0TKdPB+FeIaNdKv ujbf9j4MJNssBmXELw2KtZDAfgkRktLTifnvn+ZHkvWOpRtOqSEeDHC/saQaDxQ= X-Google-Smtp-Source: AGHT+IEhWEp8H92ZDiIsoeYBUqJpRRvATt9gfkYK3gIXyxOk7xJ9xUD6sc9M+/M8LSBF0grf5eZUFA== X-Received: by 2002:a17:907:d84b:b0:a77:dd1c:627a with SMTP id a640c23a62f3a-a8090beb84bmr158634066b.8.1723130805239; Thu, 08 Aug 2024 08:26:45 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9bc3cf3sm768781666b.13.2024.08.08.08.26.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:45 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 11/41] libmpathutil: rename __append_strbuf_str() and __get_strbuf_buf() Date: Thu, 8 Aug 2024 17:25:50 +0200 Message-ID: <20240808152620.93965-12-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmpathutil/libmpathutil.version | 4 ++-- libmpathutil/parser.c | 4 ++-- libmpathutil/strbuf.c | 6 +++--- libmpathutil/strbuf.h | 6 +++--- libmultipath/alias.c | 2 +- libmultipath/discovery.c | 8 ++++---- libmultipath/print.c | 10 +++++----- tests/strbuf.c | 12 ++++++------ 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version index 8393b91..270dcd8 100644 --- a/libmpathutil/libmpathutil.version +++ b/libmpathutil/libmpathutil.version @@ -47,8 +47,8 @@ LIBMPATHUTIL_4.0 { global: alloc_bitfield; alloc_strvec; - __append_strbuf_str; append_strbuf_str; + append_strbuf_str__; append_strbuf_quoted; basenamecpy; cleanup_charp; @@ -71,7 +71,7 @@ global: free_strvec; get_linux_version_code; get_monotonic_time; - __get_strbuf_buf; + get_strbuf_buf__; get_next_string; get_strbuf_len; get_strbuf_str; diff --git a/libmpathutil/parser.c b/libmpathutil/parser.c index 29b212c..ab7d1aa 100644 --- a/libmpathutil/parser.c +++ b/libmpathutil/parser.c @@ -167,7 +167,7 @@ snprint_keyword(struct strbuf *buff, const char *fmt, struct keyword *kw, goto out; } if (f != fmt && - (r = __append_strbuf_str(&sbuf, fmt, f - fmt)) < 0) + (r = append_strbuf_str__(&sbuf, fmt, f - fmt)) < 0) goto out; fmt = f + 1; switch(*fmt) { @@ -191,7 +191,7 @@ snprint_keyword(struct strbuf *buff, const char *fmt, struct keyword *kw, } while (*fmt++); out: if (r >= 0) - r = __append_strbuf_str(buff, get_strbuf_str(&sbuf), + r = append_strbuf_str__(buff, get_strbuf_str(&sbuf), get_strbuf_len(&sbuf)); return r; } diff --git a/libmpathutil/strbuf.c b/libmpathutil/strbuf.c index 6e53c3f..491a343 100644 --- a/libmpathutil/strbuf.c +++ b/libmpathutil/strbuf.c @@ -15,7 +15,7 @@ static const char empty_str[] = ""; -char *__get_strbuf_buf(struct strbuf *buf) +char *get_strbuf_buf__(struct strbuf *buf) { return buf->buf; } @@ -110,7 +110,7 @@ static int expand_strbuf(struct strbuf *buf, int addsz) return 0; } -int __append_strbuf_str(struct strbuf *buf, const char *str, int slen) +int append_strbuf_str__(struct strbuf *buf, const char *str, int slen) { int ret; @@ -135,7 +135,7 @@ int append_strbuf_str(struct strbuf *buf, const char *str) if (slen > INT_MAX) return -ERANGE; - return __append_strbuf_str(buf, str, slen); + return append_strbuf_str__(buf, str, slen); } int fill_strbuf(struct strbuf *buf, char c, int slen) diff --git a/libmpathutil/strbuf.h b/libmpathutil/strbuf.h index 68f21de..790dc23 100644 --- a/libmpathutil/strbuf.h +++ b/libmpathutil/strbuf.h @@ -66,7 +66,7 @@ struct strbuf *new_strbuf(void); * If @strbuf was never written to, the function returns NULL. * The return value of this function must not be free()d. */ -char *__get_strbuf_buf(struct strbuf *buf); +char *get_strbuf_buf__(struct strbuf *buf); /** * get_strbuf_str(): retrieve string from strbuf @@ -112,7 +112,7 @@ size_t get_strbuf_len(const struct strbuf *buf); int truncate_strbuf(struct strbuf *buf, size_t offs); /** - * __append_strbuf_str(): append string of known length + * append_strbuf_str__(): append string of known length * @param buf: the struct strbuf to write to * @param str: the string to append, not necessarily 0-terminated * @param slen: max number of characters to append, must be non-negative @@ -123,7 +123,7 @@ int truncate_strbuf(struct strbuf *buf, size_t offs); * 0-bytes possibly contained in the first @slen characters are copied into * the output. If the function returns an error, @strbuf is unchanged. */ -int __append_strbuf_str(struct strbuf *buf, const char *str, int slen); +int append_strbuf_str__(struct strbuf *buf, const char *str, int slen); /** * append_strbuf_str(): append string diff --git a/libmultipath/alias.c b/libmultipath/alias.c index c4eb5d8..5c8ac93 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -242,7 +242,7 @@ static int write_bindings_file(const Bindings *bindings, int fd, int i; size_t len; - if (__append_strbuf_str(&content, BINDINGS_FILE_HEADER, + if (append_strbuf_str__(&content, BINDINGS_FILE_HEADER, sizeof(BINDINGS_FILE_HEADER) - 1) == -1) return -1; diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 380e0e9..f130a5c 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1336,14 +1336,14 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, vpd += 4; len = vpd_len - 4; - if ((err = __append_strbuf_str(&buf, (const char *)vpd, len)) < 0) + if ((err = append_strbuf_str__(&buf, (const char *)vpd, len)) < 0) return err; /* The input is 0-padded, make sure the length is correct */ truncate_strbuf(&buf, strlen(get_strbuf_str(&buf))); len = get_strbuf_len(&buf); if (type != '8') { - char *buffer = __get_strbuf_buf(&buf); + char *buffer = get_strbuf_buf__(&buf); for (i = 0; i < len; ++i) buffer[i] = tolower(buffer[i]); @@ -1357,7 +1357,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, return err; while (vpd && (p = memchr(vpd, ' ', vpd_len))) { p_len = p - vpd; - if ((err = __append_strbuf_str(&buf, (const char *)vpd, + if ((err = append_strbuf_str__(&buf, (const char *)vpd, p_len)) < 0) return err; vpd = p; @@ -1370,7 +1370,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, return err; } if (vpd_len > 0) { - if ((err = __append_strbuf_str(&buf, (const char *)vpd, + if ((err = append_strbuf_str__(&buf, (const char *)vpd, vpd_len)) < 0) return err; } diff --git a/libmultipath/print.c b/libmultipath/print.c index b7af913..db0aa35 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -1090,7 +1090,7 @@ int snprint_multipath_header(struct strbuf *line, const char *format, for (f = strchr(format, '%'); f; f = strchr(++format, '%')) { int iwc; - if ((rc = __append_strbuf_str(line, format, f - format)) < 0) + if ((rc = append_strbuf_str__(line, format, f - format)) < 0) return rc; format = f + 1; @@ -1121,7 +1121,7 @@ int _snprint_multipath(const struct gen_multipath *gmp, for (f = strchr(format, '%'); f; f = strchr(++format, '%')) { int iwc; - if ((rc = __append_strbuf_str(line, format, f - format)) < 0) + if ((rc = append_strbuf_str__(line, format, f - format)) < 0) return rc; format = f + 1; @@ -1151,7 +1151,7 @@ int snprint_path_header(struct strbuf *line, const char *format, for (f = strchr(format, '%'); f; f = strchr(++format, '%')) { int iwc; - if ((rc = __append_strbuf_str(line, format, f - format)) < 0) + if ((rc = append_strbuf_str__(line, format, f - format)) < 0) return rc; format = f + 1; @@ -1181,7 +1181,7 @@ int _snprint_path(const struct gen_path *gp, struct strbuf *line, for (f = strchr(format, '%'); f; f = strchr(++format, '%')) { int iwc; - if ((rc = __append_strbuf_str(line, format, f - format)) < 0) + if ((rc = append_strbuf_str__(line, format, f - format)) < 0) return rc; format = f + 1; @@ -1208,7 +1208,7 @@ int _snprint_pathgroup(const struct gen_pathgroup *ggp, struct strbuf *line, int rc; for (f = strchr(format, '%'); f; f = strchr(++format, '%')) { - if ((rc = __append_strbuf_str(line, format, f - format)) < 0) + if ((rc = append_strbuf_str__(line, format, f - format)) < 0) return rc; format = f + 1; diff --git a/tests/strbuf.c b/tests/strbuf.c index d7d4cd9..1cc1618 100644 --- a/tests/strbuf.c +++ b/tests/strbuf.c @@ -78,7 +78,7 @@ static void test_strbuf_00(void **state) assert_string_equal(p, ""); free(p); - assert_int_equal(__append_strbuf_str(&buf, "x", 0), 0); + assert_int_equal(append_strbuf_str__(&buf, "x", 0), 0); /* appending a 0-length string allocates memory */ assert_in_range(buf.size, 1, SIZE_MAX); assert_int_equal(buf.offs, 0); @@ -181,9 +181,9 @@ static void test_strbuf_nul(void **state) STRBUF_ON_STACK(buf); char greet[] = "hello, sir!"; - assert_int_equal(__append_strbuf_str(&buf, greet, 6), 6); + assert_int_equal(append_strbuf_str__(&buf, greet, 6), 6); assert_string_equal(get_strbuf_str(&buf), "hello,"); - assert_int_equal(__append_strbuf_str(&buf, greet, 6), 6); + assert_int_equal(append_strbuf_str__(&buf, greet, 6), 6); assert_string_equal(get_strbuf_str(&buf), "hello,hello,"); /* overwrite comma with NUL; append_strbuf_str() stops at NUL byte */ @@ -196,14 +196,14 @@ static void test_strbuf_nul(void **state) assert_int_equal(get_strbuf_len(&buf), 10); assert_string_equal(get_strbuf_str(&buf), "hellohello"); - /* __append_strbuf_str() appends full memory, including NUL bytes */ + /* append_strbuf_str__() appends full memory, including NUL bytes */ reset_strbuf(&buf); - assert_int_equal(__append_strbuf_str(&buf, greet, sizeof(greet) - 1), + assert_int_equal(append_strbuf_str__(&buf, greet, sizeof(greet) - 1), sizeof(greet) - 1); assert_int_equal(get_strbuf_len(&buf), sizeof(greet) - 1); assert_string_equal(get_strbuf_str(&buf), "hello"); assert_string_equal(get_strbuf_str(&buf) + get_strbuf_len(&buf) - 5, " sir!"); - assert_int_equal(__append_strbuf_str(&buf, greet, sizeof(greet) - 1), + assert_int_equal(append_strbuf_str__(&buf, greet, sizeof(greet) - 1), sizeof(greet) - 1); assert_string_equal(get_strbuf_str(&buf), "hello"); assert_int_equal(get_strbuf_len(&buf), 2 * (sizeof(greet) - 1)); From patchwork Thu Aug 8 15:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757811 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2396818FDB4 for ; Thu, 8 Aug 2024 15:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130810; cv=none; b=pyKDcTQZ1LFLXGcNEjrEnRgHTR9H/TqcRAX4cYgQhF/KYm5P8teNsR2eoMCz8RAqHlI7HRmQERMn+CkQQ29wKUW8gB/a9izU6J9/37gzojk1PHJ5L28E+S8NKBAXW/vObzeOQ77Okpwd15dtYls83x71zjQvHOMxlDxFI62SXAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130810; c=relaxed/simple; bh=SzngsXWTmHhqfRFfJojGpKimSb0ISsm0uhZnp2uu558=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sTXWWZWXWjOdRzct/SEubDLXu9kawBZYmhz79LYbSWLtNJqPCrX09jIDv08sJvoHAMZ5N2onQzed7KsO3KJ3P1tT5eaU0pGmYrGrdicAtZB9WJPMdJG52W8x/heKkKJ0qIiWdrZxEaKTZ4TZRTH7YQOEdwSucjeGadjzTZJLZys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Z6O2czYx; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Z6O2czYx" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5b9d48d1456so1759234a12.1 for ; Thu, 08 Aug 2024 08:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130806; x=1723735606; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EUdAiEP++X+MqJhCvUrNj8MBB4UYPLrwY5dzAMf4WZE=; b=Z6O2czYxxydRec2rhlX6sl0fGbKfQpNIIy9xp1cFzCxQ56ZAVDgRmRN0FeSCvx5HZJ Sx0fyu/J1EIhsRhVnNzR8y/La1Q2bAQrt/UkDBMnUrRH4ME6CefJbkFAq/XOesdhZ4mj iyfZ0qQZ1nm1gG07BEdZ+NGgEU4cdL5hZjTgk8A2gAt6A424uz7RUN3gA9HvGAqqTUZX ni+u8u5SFVzw0TwAAfFC0FNtytfuGKxIrxpUfuufBna2eUtw+0zkwGBETO3cxPDwFhl4 fJidNhJ5xhNyvDi2EeH/1fqfl193mBMs7JgjmAz4P6G9JVK5bUyfxubvnbuab3v8c61Y 7jVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130806; x=1723735606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EUdAiEP++X+MqJhCvUrNj8MBB4UYPLrwY5dzAMf4WZE=; b=n2jdB06aILMw7o5mU/7f8Vk13jTZr+1QOhAjSmKOq3ySYYR/XKh2g5hRgx6ELN6vhm 2BzlZjmj96ri9pbHvJ4CD+89dyNgEdolj1yhNw+apprMCwT2u8EJl110G4YB98d7D57b pIuhJZI56/MgcOKmEiDCrnReFgfSul89f9RauzqdUx4FfrlU3U1HI+eLAw9620dWtF1a wkh0UbsRvgc9EViH3jcen6lNrQU3Tiup0xMc3ohCUshiDEVC3XbMgGzJN7ReVfMNc/YG dQaOVAniijiHfsthCrDGFnFuRT0+dqYw/khUkFJ0w1zJDA4XGBYeLVIGJZKMRj3L9bFg UiaA== X-Gm-Message-State: AOJu0YzDPts2TiC3bjnv5fX7KZR6R7AqW5LFwCbFtsMy+1DML2OPYtLf 97R0dlQKvORKrBqFsJUZ558bYJevP8VpqlqoMnvOAZCX6fQDAYnPuRnCqBpCMNqYYxDp3cgDw+3 GM/0= X-Google-Smtp-Source: AGHT+IHEfaGcMPM8K76do0akTpwzlC8K03UXYboM1Y9OzE6stzxaqXoCfjpBavEO9T7VLCQs6+z4KQ== X-Received: by 2002:a05:6402:2809:b0:5bb:8fc3:eb7d with SMTP id 4fb4d7f45d1cf-5bbb3d3ef3emr2015454a12.16.1723130806177; Thu, 08 Aug 2024 08:26:46 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2bf90c5sm733109a12.2.2024.08.08.08.26.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:45 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 12/41] libmpathutil: rename _log_bitfield_overflow() Date: Thu, 8 Aug 2024 17:25:51 +0200 Message-ID: <20240808152620.93965-13-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmpathutil/libmpathutil.version | 2 +- libmpathutil/util.c | 2 +- libmpathutil/util.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version index 270dcd8..2dcaa35 100644 --- a/libmpathutil/libmpathutil.version +++ b/libmpathutil/libmpathutil.version @@ -81,7 +81,7 @@ global: install_sublevel_end; is_quote; keyword_alloc; - _log_bitfield_overflow; + log_bitfield_overflow__; libmp_basename; libmp_strlcat; libmp_strlcpy; diff --git a/libmpathutil/util.c b/libmpathutil/util.c index 136aa59..1255974 100644 --- a/libmpathutil/util.c +++ b/libmpathutil/util.c @@ -354,7 +354,7 @@ struct bitfield *alloc_bitfield(unsigned int maxbit) return bf; } -void _log_bitfield_overflow(const char *f, unsigned int bit, unsigned int len) +void log_bitfield_overflow__(const char *f, unsigned int bit, unsigned int len) { condlog(0, "%s: bitfield overflow: %u >= %u", f, bit, len); } diff --git a/libmpathutil/util.h b/libmpathutil/util.h index 110b2f6..b1772e3 100644 --- a/libmpathutil/util.h +++ b/libmpathutil/util.h @@ -103,9 +103,9 @@ struct bitfield { struct bitfield *alloc_bitfield(unsigned int maxbit); -void _log_bitfield_overflow(const char *f, unsigned int bit, unsigned int len); +void log_bitfield_overflow__(const char *f, unsigned int bit, unsigned int len); #define log_bitfield_overflow(bit, len) \ - _log_bitfield_overflow(__func__, bit, len) + log_bitfield_overflow__(__func__, bit, len) static inline bool is_bit_set_in_bitfield(unsigned int bit, const struct bitfield *bf) From patchwork Thu Aug 8 15:25:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757812 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F14518FC6F for ; Thu, 8 Aug 2024 15:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130811; cv=none; b=p8T5aw1dR5Wwv22tQ549CmjMPMfwmAMe9J1ePbEvAKCvZqxlyu1KMKB7gX3w/SbP/Cukw+Qxw59PZLzoL1mqCbbX+i8aN83gmc6UbpGChfjPciitF85+fX2naj0VAYBZqSgdioYC+fhy2q/1na+eFx2rxFh+FKGNAi/Nd6TBTuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130811; c=relaxed/simple; bh=B7wxa5VAA64K0YpQx20Vd4jGmopW5mxCZkbRI2VVeD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lapmo+yL+zlxJHsb9Z2LV9YKWcUQT43acFdpkTLLBvGXYnOufQOFNehkaDKdMVOqRS3R9QpvTSe9VxK81xdFWstbo+f8/AfDKIxxbBYUCw8p06HCye9fmw+ltGiZqBqMBPZCd0nJB5yvXWTqzIlF5bDc198xhngpyflyGT87Qeg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Ov415A4c; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Ov415A4c" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5a79df5af51so3318995a12.0 for ; Thu, 08 Aug 2024 08:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130807; x=1723735607; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CgJHEUA99Sx0/Yi7Y9dOa4xvmTc1yGwR6cPnqVMTx2s=; b=Ov415A4cIgzX7v93cfThXOmj9eTdr6WIod00cNY0Qn3Befm5ncHlp/Bhli9TnIJ3Fc 9TSFZuPLpcHQ9mdMU5Zqm9FYYl+B3AwXFdsusoGGvupnz2/hpo/RdggI3j2sjfsmId9e r8UdKC9NHvGzxCapZWbJmhfczPborFPeuIteSZdn5wFri447Se5DDNw231YuRCd471pC xlSwg9iaxAZCspyvjN+ie8aaS94sSxvwT4E4NFY19esMBl5RGMgQ6Rnz0UuQ828LT0N0 /3h87TvtB6bOZXwyFIflEFi0pmpp/v7r2wnjngycTea0rfoVCSxtc+fimK2qkWyoDzkW DIrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130807; x=1723735607; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CgJHEUA99Sx0/Yi7Y9dOa4xvmTc1yGwR6cPnqVMTx2s=; b=Rykku7mmXn2RQet6xQ19Q2/83+LPvSGbj9wKkPXy4yNqkJmR4qoGfLKwU2TAWi5BKo P3a9JwYAkF+p6h/ZZ47R1EJbj6e0FJuNp+bR0E//Rb9Un6dI532z1g6CHw3Gy0xET5cd 8YPj3LJ1yPoRhRRdQujICjoCScy/mBRopgiFTpXtfz2wNfekkA/rrDr3DaDA15je/BmE biYDgMYIZh50Clzh8S9x/0nZC8ifm1Cr9JQiyd3FWYprCUSdc8tn2XNlAyuOlSjlWiIm P9Y0rFSm2KrdIpfXJCEe5Gp2kvNHsaGUk4wHjneijTNW+JDJqR4yyzNJ69RYUeH1RXlf N6hw== X-Gm-Message-State: AOJu0YwrkLthzmxVXceFW1q0XF+yyCqsUuLaJjyeoT2Q5EU1CRCknJpD g0XqP3eRwuHD+4iCPPpLyWfhpf2CouWHZwfMBd5F2k+3i3teiKfwUs2mR5XBJIs= X-Google-Smtp-Source: AGHT+IGzWVxDyag2G6LBueRxMsTJQA2a/SfzFaBZWD4Y3LSZXlVApC7nhLB+rDcjGLAUIVgAmlcHWQ== X-Received: by 2002:a17:906:478d:b0:a7a:1c7b:dc17 with SMTP id a640c23a62f3a-a8092016e3emr176634666b.22.1723130807125; Thu, 08 Aug 2024 08:26:47 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9e83ec1sm752036666b.182.2024.08.08.08.26.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:46 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 13/41] libmpathutil: rename _install_keyword() to install_keyword__() Date: Thu, 8 Aug 2024 17:25:52 +0200 Message-ID: <20240808152620.93965-14-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Also, remove some superfluous extern declarations in parser.h. Signed-off-by: Martin Wilck --- libmpathutil/libmpathutil.version | 2 +- libmpathutil/parser.c | 2 +- libmpathutil/parser.h | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libmpathutil/libmpathutil.version b/libmpathutil/libmpathutil.version index 2dcaa35..fb92f72 100644 --- a/libmpathutil/libmpathutil.version +++ b/libmpathutil/libmpathutil.version @@ -76,7 +76,7 @@ global: get_strbuf_len; get_strbuf_str; get_word; - _install_keyword; + install_keyword__; install_sublevel; install_sublevel_end; is_quote; diff --git a/libmpathutil/parser.c b/libmpathutil/parser.c index ab7d1aa..217a877 100644 --- a/libmpathutil/parser.c +++ b/libmpathutil/parser.c @@ -70,7 +70,7 @@ install_sublevel_end(void) } int -_install_keyword(vector keywords, char *string, +install_keyword__(vector keywords, char *string, handler_fn *handler, print_fn *print, int unique) diff --git a/libmpathutil/parser.h b/libmpathutil/parser.h index baa9c55..179aeca 100644 --- a/libmpathutil/parser.h +++ b/libmpathutil/parser.h @@ -63,22 +63,22 @@ struct keyword { for (i = 0; i < (k)->sub->allocated && ((p) = (k)->sub->slot[i]); i++) /* Prototypes */ -extern int keyword_alloc(vector keywords, char *string, handler_fn *handler, - print_fn *print, int unique); +int keyword_alloc(vector keywords, char *string, handler_fn *handler, + print_fn *print, int unique); #define install_keyword_root(str, h) keyword_alloc(keywords, str, h, NULL, 1) -extern void install_sublevel(void); -extern void install_sublevel_end(void); +void install_sublevel(void); +void install_sublevel_end(void); -extern int _install_keyword(vector keywords, char *string, handler_fn *handler, - print_fn *print, int unique); -#define install_keyword(str, vec, pri) _install_keyword(keywords, str, vec, pri, 1) -#define install_keyword_multi(str, vec, pri) _install_keyword(keywords, str, vec, pri, 0) -extern void dump_keywords(vector keydump, int level); -extern void free_keywords(vector keywords); -extern vector alloc_strvec(char *string); -extern void *set_value(vector strvec); -extern int process_file(struct config *conf, const char *conf_file); -extern struct keyword * find_keyword(vector keywords, vector v, char * name); +int install_keyword__(vector keywords, char *string, handler_fn *handler, + print_fn *print, int unique); +#define install_keyword(str, vec, pri) install_keyword__(keywords, str, vec, pri, 1) +#define install_keyword_multi(str, vec, pri) install_keyword__(keywords, str, vec, pri, 0) +void dump_keywords(vector keydump, int level); +void free_keywords(vector keywords); +vector alloc_strvec(char *string); +void *set_value(vector strvec); +int process_file(struct config *conf, const char *conf_file); +struct keyword * find_keyword(vector keywords, vector v, char * name); int snprint_keyword(struct strbuf *buff, const char *fmt, struct keyword *kw, const void *data); bool is_quote(const char* token); From patchwork Thu Aug 8 15:25:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757813 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEA7418FDDB for ; Thu, 8 Aug 2024 15:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130811; cv=none; b=cmxD5HWWA95dPpaNL/6I/eHODwclcI8pBUx3GnPL6zMjHDAHv43y9NJIWDIKOfyfg/Bxc1ZpKe5v5hUnqLZG+m7EQfxKnXh++RpYncPOIw12evPCQOwQ7hWTqZbrYcwejEuRUsBJ4LnoxsV6qEAiRGvec21CL6BRJCOtaftKyn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130811; c=relaxed/simple; bh=pFkA9n8z+3S2anTb9UuuJEIalZ4kJkP2QyC8DRFGKP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hF9kEAXS5brNpE1qsWnKipVhoTO/oae6EptsjnsvXi1vy+20lblUPFgUThoeQIGx0zJIe1nQ0qpwQf9xoImb9zb9GNHuutm7MKI+RnT86ZjN6H5B/5TPBruV2V+XdbudLYTA64JNCsEMKclo+PTNDmRlkHgEWIizQ/iBuGtmaxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=dQ9xWJGb; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="dQ9xWJGb" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5a3b866ebc9so1262273a12.3 for ; Thu, 08 Aug 2024 08:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130808; x=1723735608; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QziZkA2s4fb9S6w/uSt5qvNjZl3XGXOwewRbaetDqKE=; b=dQ9xWJGb3HIyLXQt1TJ8Amc8oKmHyYLC0H3QhG0ZOHAE7Mfk+wEEVimOaQLpEt43ts uYT6kCdNAtV6qUSA79QeN6sfTt3ZF1k8OpxVFQdx/X7dgnCeshod8VUDXrUsrAHnuOwt rW2fqPrW37pVjA25A7Dp2EaN8aM4Rai5fKYqJUSoTvzJisSTL322ubLog4pQIJccu4tp UO5M44pr9fC01MUyuSlnNCK0r1IAz8TbIyJDoAa9u9YN4/mtv4i91vn5AC44N3Z7+6KW Zwh2kPlVx3jXCGNgrkTeIkXUQc+IoxKrR1HVT+xgr8h15q12XJ6dMf3biHHucy+4ZlRE yG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130808; x=1723735608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QziZkA2s4fb9S6w/uSt5qvNjZl3XGXOwewRbaetDqKE=; b=nA9s1TfOA9VbgT0rSsEdFyGNM0bEuk6cHO9Z68T2jCfhmqNeJKoiip9B95OzXidHvU 9kHkmSxSrDZfouDJAv4YOS2Vox4RuQ3FakuFuXgDC4ZwqWKT95EPa1L16AaTY4ck5Oxq QrX1Z6ZkWyXbrimfnkBw1aiIdlK37c9tuiiAbhBSI+lAg7NAxmkXsaqRgZ02c2+OPOIM nrkfUyhS5+WG5M5dxtZ2IQqREf8iV3U8ijeEAESJO/n7Rbt8ehtussvbXzIBJKdxSBbP cE12I+ZCv6f3F7b2YCSK0+XnuvNCYpRrfU9PYVnOPh7eyLtvb9kWudtDpAopOfghUUzn 1+jA== X-Gm-Message-State: AOJu0YyYqtngAUsuDYDAtBy48i+Hh8Qm9vNUQ7jgpCrZnjAz0MeTu7bF Q/N7PFJrKShVAABamnDylDpiGodS5kUqHCadAiY3R3WF7Jpr0tAu6++z0jJy3mOLRGDTp9r2jeG JsYY= X-Google-Smtp-Source: AGHT+IG+vigWrCWroeqqTS0ulqk5Ds8tdFEZLRHpr7Ch2BbJB2L6zMO+Slj+pzigWYHRbQb+RZfK0w== X-Received: by 2002:a17:907:845:b0:a77:e55a:9e8c with SMTP id a640c23a62f3a-a8090e9e24dmr184455466b.47.1723130808031; Thu, 08 Aug 2024 08:26:48 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ec4875sm748437866b.191.2024.08.08.08.26.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:47 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 14/41] libmultipath: rename _NVME_LIB_C Date: Thu, 8 Aug 2024 17:25:53 +0200 Message-ID: <20240808152620.93965-15-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/nvme-lib.c | 2 +- libmultipath/nvme-lib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/nvme-lib.c b/libmultipath/nvme-lib.c index f30e769..0c2be4f 100644 --- a/libmultipath/nvme-lib.c +++ b/libmultipath/nvme-lib.c @@ -1,6 +1,6 @@ #include /* avoid inclusion of standard API */ -#define _NVME_LIB_C 1 +#define NVME_LIB_C 1 #include "nvme-lib.h" #include "nvme-ioctl.c" #include "debug.h" diff --git a/libmultipath/nvme-lib.h b/libmultipath/nvme-lib.h index 059dca8..6aa9bd2 100644 --- a/libmultipath/nvme-lib.h +++ b/libmultipath/nvme-lib.h @@ -16,7 +16,7 @@ int libmp_nvme_ana_log(int fd, void *ana_log, size_t ana_log_len, int rgo); */ int nvme_id_ctrl_ana(int fd, struct nvme_id_ctrl *ctrl); -#ifndef _NVME_LIB_C +#ifndef NVME_LIB_C /* * In all files except nvme-lib.c, the nvme functions can be called * by their usual name. From patchwork Thu Aug 8 15:25:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757814 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B37A18FDD2 for ; Thu, 8 Aug 2024 15:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130813; cv=none; b=nAHGZhSVrLY+0yIGBf0fZul7AYiDkXAspnB7ySS4qs7EUC4AOFb1ofElDmUAxQpKFkjT4k2jTowKVNl/EyCmYEJbrRWH6m7APJTYgAZNtBpH1iR0r8gzCkgJ5xi6nxn0vB4nHwXOPOPwEiiSDR2k57aNfAjEw+sV1OmkEQq7ijw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130813; c=relaxed/simple; bh=ZGIC2vwdsAKD3LK+rVf/UFpikWuKUI6/SFIXkX62DiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YKN12lr+ERuDGhNwYQdCwSYa/f6axjtvDpBLyFUkqGIotLP3cNd6iA6rIgLseBMpebeGqBZTjhmnD547vzaPADRLy3HWgB5UTK0/jMZFpG/zSMqgJ2cO3jk3+xHZRt3nIR/lzJxCn1gUV0pHGlIyur2V/cOSwkTrhpv5jpWc0h8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=DbONJxe8; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DbONJxe8" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52efdf02d13so2116321e87.2 for ; Thu, 08 Aug 2024 08:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130809; x=1723735609; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6YS2D2F9Pdcdo+1QmDkzHTo31YPudmWuRyCmu8HhRVU=; b=DbONJxe8n5SEukV+LdG8/9PECfgcbpzbYRE/+lmDm1J/90txbHJr2+b5KSpnRcIXUW QDEeXQXIowT0xviqql48RKa9seo5GPBDtb7FeUiLrBj2etID6R55uzM4UyZ47E/xPuo/ ndPiPycFolbwCGG6K25kE+y8rEHAFvo7VogwboGOur6Z2jCeikxPgl8/L0tacVqksxbQ WEAhykvs92I/PPUIEny2s+Awf8qtY2JZJfCDjeNuvyCGB/0hBpuNrVy6pAt+00iWocf9 +KzWicVXrP9DNMtcJd2L1GXQT32k/xwUMLx66mbjbGANHFw17rlU9BgXfLvQLD5fAXVP PDAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130809; x=1723735609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6YS2D2F9Pdcdo+1QmDkzHTo31YPudmWuRyCmu8HhRVU=; b=Bx3MwLavJcWW8plhh1Iisge0aB+7T3bcUFd7NjUT340UkAqV8YveskksGiWcArC//+ 96s8vlqYa0RtOpO3SO6lVrY+pP93YQMPjuMAsKUsxjy/cWZQYvJWms0hA6DOJqNuTHw9 mMpmmha7IaJNSrM9wYuBCZkA1aqTzhf+EcuL7JpCH7TH3GvUryXjVwMF52lWktRi4QPQ WRM/DptSdquhevH3r9De35lD6suy26TVgitcVp8HwieI6LyvLciIOiMgWDm7jun8buoa Bz43P3KMgtDsfaVWoiY1pWKGfLkxBP8r/vy7KnU7wZ3NWVVSKn/fFYv7fw6QBjdiWHQS gihw== X-Gm-Message-State: AOJu0Yytakuqf4k12vVr12G/qYjmRzY6aaDV9fsO8noCrpFUbV3A/Z7c mqY7eiKQ9kMKwhIsLhC6dWVFvEJkabjK81EQcjJtKaH3All2xAbqNlhaa438Ur0= X-Google-Smtp-Source: AGHT+IE8w8t50ZhuVnk4q/q2rI+06Ywh7098DTUsMMjcIZdUP2AoIm76oSA06Q5rdpxl7sepTMNSDw== X-Received: by 2002:a05:6512:318d:b0:52e:d0f8:2d43 with SMTP id 2adb3069b0e04-530e58207d0mr1774045e87.17.1723130809070; Thu, 08 Aug 2024 08:26:49 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ec8879sm754726866b.211.2024.08.08.08.26.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:48 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 15/41] libmultipath: checkers.h: fix __CHECKER_FIRST_MSG in comment Date: Thu, 8 Aug 2024 17:25:54 +0200 Message-ID: <20240808152620.93965-16-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/checkers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h index 51ceea0..102351f 100644 --- a/libmultipath/checkers.h +++ b/libmultipath/checkers.h @@ -194,7 +194,7 @@ void *libcheck_thread(struct checker_context *ctx); * message IDs. * Message IDs available to checkers start at CHECKER_FIRST_MSG. * The msgtable array is 0-based, i.e. msgtable[0] is the message - * for msgid == __CHECKER_FIRST_MSG. + * for msgid == CHECKER_FIRST_MSG. * The table ends with a NULL element. */ extern const char *libcheck_msgtable[]; From patchwork Thu Aug 8 15:25:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757815 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12C81190052 for ; Thu, 8 Aug 2024 15:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130814; cv=none; b=CrFxBeiBWdIj1ZHLlB9AJWsbEiULJX2wSWD94p140FKCOt0nTSe2tOfKQJ1+JsUabNse+zU6ImSJUH4OmgOK3rsh2dkVMwjYNmiLuOzZXduEa3YBuS9a6N5z6gOjecQJYLG1m44DFF51PhQQNBAB0ZNggsscQVQgi9uTqSFMpnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130814; c=relaxed/simple; bh=YldyASmHQR6yBsZtvwE1UTiXJc5S3SoQKOO/hgkj35U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LMysTUk+dHtTuM/mcfZCU41d3OPbCWF0IfqDz773JcVPLH3PHfInmxpsKIBqGG2XprgEh1b+w3aUwKERtEynca0kIXF7scKnSNplX97K++O2MypPUBCiUWz/xgaFecHiVkFnnjIFon4vK8VpLD5dl1a0Y4ievEVnZChiRk/+0jI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ERYCytZk; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ERYCytZk" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a611adso1477110a12.1 for ; Thu, 08 Aug 2024 08:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130810; x=1723735610; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iBExBQRh3j/9Rh2atBVlds4Oyhd4/qDgaeQVZMCb2Qc=; b=ERYCytZkCZDl7WkLIXpBIMkWT/cjSTSRh9fTrcPqe3BFk/9Ex/heO8Zme8ymS1Da9y A0rkvcH39RGuMygXAwNuTro6wL6QI4kdMDOS804G8HFAFDC9N8oCPC9OcH1lTZzEC5bN b2Zb2yrg8Bxwv4oIkK0eREE/vOOxmih8EsrQdPk48PTME0b+NcI5jrPulGVV3FjO5y3i iAq/EcROS/yyvWtLs2FcHk0QzniL558ZnCsDDXHq8BxrtvDcDCpdUBhjBfLdk3jJonbu 20vEZMshZFqG857UCeAAEC07X5kFiScvd3fYQ8hi86+FL4dOxxmiO5mPCd9IzKKhMOaE y0uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130810; x=1723735610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iBExBQRh3j/9Rh2atBVlds4Oyhd4/qDgaeQVZMCb2Qc=; b=okfNCLCBnK8fUS6V571eUqV14J+nVv5Bw+v4lHPoqH6UuaMU+U1QhTQyy73k8A7IfQ KbgVte0+T/LqD8oKRlYNJ9zrte9T2RqmZqO/K+03IzRrzeitcgi0cUo3SQ39chK+w5mZ dygRVGTUHEWdlcvjuJilb2ryKq3q8JqdNEPK2vgszDYr2EBXBmM4GKN+xfGR4dkPXZA7 trT9JSBpMorKmvrIBdppyfroJcq5uXPHX8XPfnMy3sT5zZaDQMCU4SmwcHbIYm6KRLJK cRQltG5if4oCLBvqS9AWDLI8QEunNZwrZs1ItWtOwVH4+WqMUGWKsrMfsO6VzCNTnJHE 1Oag== X-Gm-Message-State: AOJu0YwLtToat4eUFNDtDw/vY5xJyV4nXa8LzWmdp1VbYZ4GKHr2Cvpt bUYVJXiVNnN5GcmaeGyyHzA/0LtFom5mh7QlSLf5C5d6iXgFbVbOFVlPAXaFDJg= X-Google-Smtp-Source: AGHT+IEkp5NsFgC3IHHuA7P+NEUKEREIzAgCE61ywFY4cqmWefjS4/j0JtCE67IS349vB/fEhYRVcg== X-Received: by 2002:a17:907:f71d:b0:a7a:9144:e242 with SMTP id a640c23a62f3a-a8090c6eb5fmr169446766b.27.1723130810094; Thu, 08 Aug 2024 08:26:50 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ecb129sm751177366b.222.2024.08.08.08.26.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:49 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 16/41] libmultipath: rename identifiers with leading underscores in devmapper.h Date: Thu, 8 Aug 2024 17:25:55 +0200 Message-ID: <20240808152620.93965-17-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 16 ++++++++-------- libmultipath/devmapper.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index fe604f1..0a4b586 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -86,10 +86,10 @@ const char *dmp_errstr(int rc) [DMP_OK] = "success", [DMP_NOT_FOUND] = "not found", [DMP_NO_MATCH] = "target type mismatch", - [__DMP_LAST__] = "**invalid**", + [DMP_LAST__] = "**invalid**", }; - if (rc < 0 || rc > __DMP_LAST__) - rc = __DMP_LAST__; + if (rc < 0 || rc > DMP_LAST__) + rc = DMP_LAST__; return str[rc]; } @@ -624,7 +624,7 @@ has_dm_info(const struct multipath *mpp) static int libmp_set_map_identifier(int flags, mapid_t id, struct dm_task *dmt) { - switch (flags & __DM_MAP_BY_MASK) { + switch (flags & DM_MAP_BY_MASK__) { case DM_MAP_BY_UUID: if (!id.str || !(*id.str)) return 0; @@ -682,7 +682,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma */ if (info.target && !info.status) ioctl_nr = DM_DEVICE_TABLE; - else if (info.status || info.size || flags & __MAPINFO_TGT_TYPE) + else if (info.status || info.size || flags & MAPINFO_TGT_TYPE__) ioctl_nr = DM_DEVICE_STATUS; else ioctl_nr = DM_DEVICE_INFO; @@ -715,7 +715,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma return DMP_NOT_FOUND; } - if (info.target || info.status || info.size || flags & __MAPINFO_TGT_TYPE) { + if (info.target || info.status || info.size || flags & MAPINFO_TGT_TYPE__) { if (dm_get_next_target(dmt, NULL, &start, &length, &target_type, ¶ms) != NULL) { condlog(2, "%s: map %s has multiple targets", fname__, map_id); @@ -725,7 +725,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma condlog(2, "%s: map %s has no targets", fname__, map_id); return DMP_NOT_FOUND; } - if (flags & __MAPINFO_TGT_TYPE) { + if (flags & MAPINFO_TGT_TYPE__) { const char *tgt_type = flags & MAPINFO_MPATH_ONLY ? TGT_MPATH : TGT_PART; if (strcmp(target_type, tgt_type)) { @@ -797,7 +797,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma /* Helper: format a string describing the map for log messages */ static const char* libmp_map_identifier(int flags, mapid_t id, char buf[BLK_DEV_SIZE]) { - switch (flags & __DM_MAP_BY_MASK) { + switch (flags & DM_MAP_BY_MASK__) { case DM_MAP_BY_NAME: case DM_MAP_BY_UUID: return id.str; diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index b5330ab..d9c08fd 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -35,15 +35,15 @@ enum { DMP_OK, DMP_NOT_FOUND, DMP_NO_MATCH, - __DMP_LAST__, + DMP_LAST__, }; const char* dmp_errstr(int rc); /** - * enum mapinfo_flags: input flags for libmp_mapinfo() + * input flags for libmp_mapinfo() */ -enum __mapinfo_flags { +enum { /** DM_MAP_BY_NAME: identify map by device-mapper name from @name */ DM_MAP_BY_NAME = 0, /** DM_MAP_BY_UUID: identify map by device-mapper UUID from @uuid */ @@ -52,12 +52,12 @@ enum __mapinfo_flags { DM_MAP_BY_DEV, /** DM_MAP_BY_DEVT: identify map by a dev_t */ DM_MAP_BY_DEVT, - __DM_MAP_BY_MASK = (1 << 8) - 1, + DM_MAP_BY_MASK__ = (1 << 8) - 1, /* Fail if target type is not multipath */ MAPINFO_MPATH_ONLY = (1 << 8), /* Fail if target type is not "partition" (linear) */ MAPINFO_PART_ONLY = (1 << 9), - __MAPINFO_TGT_TYPE = (MAPINFO_MPATH_ONLY | MAPINFO_PART_ONLY), + MAPINFO_TGT_TYPE__ = (MAPINFO_MPATH_ONLY | MAPINFO_PART_ONLY), /* Fail if the UUID doesn't match the multipath UUID format */ MAPINFO_CHECK_UUID = (1 << 10), }; @@ -92,7 +92,7 @@ typedef struct libmp_map_info { /** * libmp_mapinfo(): obtain information about a map from the kernel - * @param flags: see __mapinfo_flags above. + * @param flags: see enum values above. * Exactly one of DM_MAP_BY_NAME, DM_MAP_BY_UUID, and DM_MAP_BY_DEV must be set. * @param id: string or major/minor to identify the map to query * @param info: output parameters, see above. Non-NULL elements will be filled in. From patchwork Thu Aug 8 15:25:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757816 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2356190041 for ; Thu, 8 Aug 2024 15:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130814; cv=none; b=d79lFwOv2bqQzBv/yhgWWe9+hzcrJAKhphRxg3O32Qddqu0I8fSCHJIIOmWNLpr11ev4tUDgNurX2ZOuy29adsfw5P6sqhJhMWzw/8XzQ/6V2eVNfJUHA29rMSlLNWcwFnI8FAVkz2fODh5NtvKDM9MUnndbjkl5kylNBut1Alk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130814; c=relaxed/simple; bh=jVNMjNYh8DIX8/zMlpgMWQMvFlWG7FKqJG2hSM66f9A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=etdjdkW3mLsDMkm5dgwsJA/aaLvcfJ5rGyEKT65el0hLBmG0TheTKfio+RxmqtqnWIhkiWfrIte1xwFlguUIqt6KKXAxzFWwa19lMlFdI+s3wUjJSZTv6/y+uYSsrvZpkIM+8Y8HkQxTPpyTbvBTVLG9OdZB4xlg1/xzPdiBnAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=IvQ53vA2; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="IvQ53vA2" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5b3fff87e6bso1186378a12.0 for ; Thu, 08 Aug 2024 08:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130811; x=1723735611; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lQ8Io4PZNzNemtV4/C7X6xf4DKOlGmmFVM4qJyKEro8=; b=IvQ53vA23NqYISlXLwXWjiCdID2HFGxDC8gv6147HibHl9Bh2lvVittuvIxmqn4yWi 6GRtK+n3d02D1kVG73EMO2JaiC1i4dDkOSqSAsQlFq+AQ4seW+v6TfyuIEIV8mwqoxOG RGhtu6ZLCsZmJoewAxS//V5QlCDKbpsaunU3PbNXlGBjlmCvLfEBFOBhV/tZnN9dgfM7 3x73Uek+upt8332QHeGunYPNoUzwW60XEQkiT3mu6r2kiZZGp53104C781po019TRIaG PFrgsYh7o9oEu4UwK+sJCbczkDKQ6UrL4I7KkdVJ8iCrj0eeA8EfT8oBJqfrDIeP4wG+ JePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130811; x=1723735611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lQ8Io4PZNzNemtV4/C7X6xf4DKOlGmmFVM4qJyKEro8=; b=RqWRZBSYDfUQJl9qRGmRsQQlZ3QXnyCMG2Jk9hLw04P78Ywi8k3yiCVrOjrJqNst5d ueKgSUAr1/9qJPSjKSKb+btnAVyjuto6lgNdK/lPbmylygDfpDNEm3SzjFg1LrJcv24Z IexNFmStxNSec27JhBwSv8w3f/gMiGWht27oUi0MfoQJI3zXXvU+7ymkxqrMRW0bpoyE C9AqO9W6Ip9eiyxBdbSdDSM/rBpMtLv2kkE90if6l016vu3nzHjLXCvad00Iunj2SoyS dMr63YNmzyY8EOi/SoPC7Rznr76F5NWqJ6IViyx+L3bE+spmMWj2sg98drfBgO1po5zC Lqcw== X-Gm-Message-State: AOJu0Yyhyu6ir94DYqDLUa61vduh+lfkc//XE+2WEQRNfngDEjBGLkUC TePnopnOG58aEc9hPZSf6NFrafFHQ09w4qa05ORR8K/xgAweix6sjDq7WpC6Jsg= X-Google-Smtp-Source: AGHT+IERl3n3QWHDgGlvhs8TcSZiZt0ytZE2e1U70cQ+8bHljjVPv35/IndBNC/Nb3HSsZDycKuBNQ== X-Received: by 2002:a05:6402:2114:b0:5a2:84e2:c88a with SMTP id 4fb4d7f45d1cf-5bbb21acbdbmr1783462a12.12.1723130811076; Thu, 08 Aug 2024 08:26:51 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2c41ec9sm767502a12.42.2024.08.08.08.26.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:50 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 17/41] libmultipath: rename identifiers with leading underscores in discovery.h Date: Thu, 8 Aug 2024 17:25:56 +0200 Message-ID: <20240808152620.93965-18-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/discovery.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index 5bd35ca..c93abf1 100644 --- a/libmultipath/discovery.h +++ b/libmultipath/discovery.h @@ -62,24 +62,24 @@ bool is_vpd_page_supported(int fd, int pg); * discovery bitmask */ enum discovery_mode { - __DI_SYSFS, - __DI_SERIAL, - __DI_CHECKER, - __DI_PRIO, - __DI_WWID, - __DI_BLACKLIST, - __DI_NOIO, - __DI_NOFALLBACK, + DI_SYSFS__, + DI_SERIAL__, + DI_CHECKER__, + DI_PRIO__, + DI_WWID__, + DI_BLACKLIST__, + DI_NOIO__, + DI_NOFALLBACK__, }; -#define DI_SYSFS (1 << __DI_SYSFS) -#define DI_SERIAL (1 << __DI_SERIAL) -#define DI_CHECKER (1 << __DI_CHECKER) -#define DI_PRIO (1 << __DI_PRIO) -#define DI_WWID (1 << __DI_WWID) -#define DI_BLACKLIST (1 << __DI_BLACKLIST) -#define DI_NOIO (1 << __DI_NOIO) /* Avoid IO on the device */ -#define DI_NOFALLBACK (1 << __DI_NOFALLBACK) /* do not allow wwid fallback */ +#define DI_SYSFS (1 << DI_SYSFS__) +#define DI_SERIAL (1 << DI_SERIAL__) +#define DI_CHECKER (1 << DI_CHECKER__) +#define DI_PRIO (1 << DI_PRIO__) +#define DI_WWID (1 << DI_WWID__) +#define DI_BLACKLIST (1 << DI_BLACKLIST__) +#define DI_NOIO (1 << DI_NOIO__) /* Avoid IO on the device */ +#define DI_NOFALLBACK (1 << DI_NOFALLBACK__) /* do not allow wwid fallback */ #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \ DI_WWID) From patchwork Thu Aug 8 15:25:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757817 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A3A519005B for ; Thu, 8 Aug 2024 15:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130816; cv=none; b=rODNnbsP1PvwxjyAc2Iy4pZBQgVWR0g5X2431P9IQhLByRWyTxfmTtRiyVbwFfXf9/OEBALHRplw0ZhoVyxQlxntXLsFy4BJMQT+6rLSAGqqIH/hBWxAP4mHfDPxzN3FHZ7tk4KkUgQyqzuk1PPLwaWAG6X8ePARu/Fq/eNNdEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130816; c=relaxed/simple; bh=mkGScmdJynrBKwx3JmeN0py9dV31iwO32WMNAfUFQqA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WTvs58/GCTO9Vme1yatU7wlmPR73yQbDhEU/1ad0BXc9wcnegpCWxOaWKTtPYbiojgrX7kzwKFPo7lmaKJy9fiUphc/gwYYZNkoAhBlqiHnV1a5bE/Ox7HTcmQfg4f6e5iujnLtBj6InawYt8TUs8qEnXRD78Uh405f+FPmbnME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=aEvB/mHg; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="aEvB/mHg" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52efba36802so1451510e87.2 for ; Thu, 08 Aug 2024 08:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130812; x=1723735612; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XzHM0hHl1e9L8dGMQraoB4i51ObhifWg1qysQO0cEC8=; b=aEvB/mHgAgrRPjCKnPFz1+YcJ8QBA3zghKp60NZDncEb/g/BPagFUwBKXnt03MD+j7 3EmFK/7PTqgIQ989y+9D3GG1RrPSa3I5Cy8ZOA2BVMuLijU17TwZJ0CsTzNXJWMIELA+ JEO3t10D4LRPw+Jy9E8TOBtynKyhRn4JQsTlphpWGI3D6lbndgN3lsex8k167tVL6h5G +U67ySEoGcy4J5RE+a74YkH58yVlsMCzUyi+9dO3fcBdshgEDY0ob5VXBm84cx+0QBih cBPjoUyq4vCvkparwEZKqFnJzGvXnh2HSR5kJTLXAiVgHJzuzqwpulxOZc3lFuGWSRHE kB1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130812; x=1723735612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XzHM0hHl1e9L8dGMQraoB4i51ObhifWg1qysQO0cEC8=; b=hHCCr9kVeDlaaVKMIHHXIkkTTRP84tTdIQSqgG7Ni5GrAPkLnpiu7BxmFphfIqk8vg 9g1dft2nvqGKGJRaJNv4WWLdfN3nxA97eWF8qJLeVFunZYpx0tUjF1r9Kb5w/L+y/7rT p3Dioj6IQhxcCh44PQZZcwe1eOPcdKRQpvF0XiJGvHnaVScwCEhrsk3KxDT9OoKQcnW9 5bv3X9+erjQwqMN+nh9e4Nr3PnDry2EjAnRVU5hQa6khKB8b0TkLGn3rlViZr3AgUbpf +Kdf3yIJ/Tb5D4zM1mEnuHvp/N+z4153PGiPyuwFjaWflhiV1rpOPeOGVe1J5QfbnWEx D3gg== X-Gm-Message-State: AOJu0YwcVXtxpS2ovrMNXbMGVFbJpqb0mpvIIvDZHF7sVJOrSoyTo5am ggCqHOZmFChSijIdtcnvidqP01OYTPPP03o6H/30/p38aBYvo8obT4Qb0yc27RktjXTaL4DRH6p 7jVI= X-Google-Smtp-Source: AGHT+IHGiVHczHB4LjHqyIIa0kmElgHn6+MmJCwbI2h7pVutHyEv2Wxyx010KljEFfScNLmXO4PgRA== X-Received: by 2002:a05:6512:1391:b0:530:ad7d:8957 with SMTP id 2adb3069b0e04-530e588b63amr1617998e87.49.1723130812104; Thu, 08 Aug 2024 08:26:52 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9d43913sm746741466b.105.2024.08.08.08.26.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:51 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 18/41] libmultipath: rename __snprint_config() Date: Thu, 8 Aug 2024 17:25:57 +0200 Message-ID: <20240808152620.93965-19-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/libmultipath.version | 10 +++------- libmultipath/print.c | 4 ++-- libmultipath/print.h | 2 +- multipathd/cli_handlers.c | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version index 0ec4527..e6c6daf 100644 --- a/libmultipath/libmultipath.version +++ b/libmultipath/libmultipath.version @@ -43,7 +43,7 @@ LIBMPATHCOMMON_1.0.0 { put_multipath_config; }; -LIBMULTIPATH_25.0.0 { +LIBMULTIPATH_26.0.0 { global: /* symbols referenced by multipath and multipathd */ add_foreign; @@ -74,6 +74,7 @@ global: dm_cancel_deferred_remove; dm_enablegroup; dm_fail_path; + dm_find_map_by_wwid; _dm_flush_map; dm_flush_map_nopaths; dm_flush_maps; @@ -172,7 +173,7 @@ global: should_multipath; skip_libmp_dm_init; snprint_blacklist_report; - __snprint_config; + snprint_config__; snprint_config; snprint_devices; snprint_foreign_multipaths; @@ -241,8 +242,3 @@ global: local: *; }; - -LIBMULTIPATH_25.1.0 { -global: - dm_find_map_by_wwid; -} LIBMULTIPATH_25.0.0; diff --git a/libmultipath/print.c b/libmultipath/print.c index db0aa35..b911802 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -1908,7 +1908,7 @@ static int snprint_blacklist_except(const struct config *conf, return get_strbuf_len(buff) - initial_len; } -int __snprint_config(const struct config *conf, struct strbuf *buff, +int snprint_config__(const struct config *conf, struct strbuf *buff, const struct _vector *hwtable, const struct _vector *mpvec) { int rc; @@ -1934,7 +1934,7 @@ char *snprint_config(const struct config *conf, int *len, { STRBUF_ON_STACK(buff); char *reply; - int rc = __snprint_config(conf, &buff, hwtable, mpvec); + int rc = snprint_config__(conf, &buff, hwtable, mpvec); if (rc < 0) return NULL; diff --git a/libmultipath/print.h b/libmultipath/print.h index eb4cbc2..4dd2ef2 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -40,7 +40,7 @@ int _snprint_multipath_topology (const struct gen_multipath *, struct strbuf *, #define snprint_multipath_topology(buf, mpp, v, w) \ _snprint_multipath_topology (dm_multipath_to_gen(mpp), buf, v, w) int snprint_multipath_topology_json(struct strbuf *, const struct vectors *vecs); -int __snprint_config(const struct config *conf, struct strbuf *buff, +int snprint_config__(const struct config *conf, struct strbuf *buff, const struct _vector *hwtable, const struct _vector *mpvec); char *snprint_config(const struct config *conf, int *len, const struct _vector *hwtable, diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index ef5f53e..2efe23f 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -165,7 +165,7 @@ show_config (struct strbuf *reply, const struct _vector *hwtable, conf = get_multipath_config(); pthread_cleanup_push(put_multipath_config, conf); - rc = __snprint_config(conf, reply, hwtable, mpvec); + rc = snprint_config__(conf, reply, hwtable, mpvec); pthread_cleanup_pop(1); if (rc < 0) return 1; From patchwork Thu Aug 8 15:25:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757818 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6DC19005A for ; Thu, 8 Aug 2024 15:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130816; cv=none; b=TryemRnqTIJZ4J0zakf6EWkdzSmdAkDW413v1jRLlCcnNSF/UQFEpgaOOLThzbqUtFZ7Vtw8CF/FQU+aVkylWLbLuYcUFo2GqUSSPhh0vD+e8OE4WEt0qvoLxO3+mbcdnhTN/+x7DwYIHgHdjv9RrjfAZX1MGuKPSPSKFeJ1hkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130816; c=relaxed/simple; bh=pVXZWXSrQua8n611Zt8EOmtsCxSztxQLTwrSRRnANXc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n17rjRqMjNKRGF/oInS16Y1We+vaIErdyAuONY32JuZzOMckU4J8m7xfqvsM+jbCzlstzvzKJp4M5xDVlzTgkWggj1AxFmFnPQe+Gyh/gnNcQMCWn3NadFvA7ZJgbR3eYobL8SKy9LtdSuRvglOrFup+uJsF8z/vsIvBfUZboVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=BbvV7tsk; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="BbvV7tsk" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a7aa086b077so112660566b.0 for ; Thu, 08 Aug 2024 08:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130813; x=1723735613; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n5VGwngPIXWYCglSqN/1VkCUDMpbzk6R3QJTBWgXJtg=; b=BbvV7tsk4CobnEem2CF/WXX+vRSxN8MkyUGdUzw5m7bNGOTxc5yeNW1jHfmwGl4Y0b kVC3WMJZjyebHvPOIjyuNG6QhQSwVvRzqh7l/NZ10vBz4VY++cx58/yguggHLaIxxagX I3pek8lDUQt4LtbgOtReiYgDmoGY3OqdpdFqWdE3SmNFiw8OLxKNNziEySc2x6yigD4B rbibrcPpMo2oaFvKOcNi3gmTo02sGTDZo4KVkAwUBpB9Lzoz7DlD6ltF8VCcM7ETUQbt lc6C64WfBNP12g9ZURBMWdWrvb8uo/lp8Oe+OJSfr1uU1I9+wP4P3MLPR2IAvkC4NZI1 QlDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130813; x=1723735613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n5VGwngPIXWYCglSqN/1VkCUDMpbzk6R3QJTBWgXJtg=; b=ZrK2HAvBxrbFd5Mp/ll7VgGcmvg4hcdqP1DwuEubqLIxErgxVAKFcjq6p7bGL1GYvB cnch2dfRDRZ6J0d0lrbQ5CKf+8pUQPgi/tYYeRDCyQSPa0Z+NGqajeKBj1QRwQr9aH/v X5YyAaOtTUzeswJvpC0HwvFxiLFnV6H2v0W4O/R64122nA48sIa7JdecLn4XQsQs9c3X ZKrzeczlRQCHxASvW09lrQVT+Yo6oq4+q1qERFQ43uFTQ/uJvJWMfP7wWkaXnD8AQDBg SnDYLeYpKvTXjaVCz93cJosVdmmFfv+KCDvoJmw0HIFMVHWDZ0N8Pt6csegK/KjG5bAG N2Jg== X-Gm-Message-State: AOJu0YxVu29as+oT4YXFA9peBEZloz52xVgkKbZIXdcddyNtCo/f16Mw E89NN5/E/F0jvIAWmRJzTOPzyT+/Dsttx16CxMF9Pb3M4w48k++Gf/Zb+kqN6MOYvAYnXNg7W14 FrCM= X-Google-Smtp-Source: AGHT+IFPZ9KOEaC4plyLBKjOGzdPJKq8rsTxj8L4+lHmphPFNNPoaPl1xfWWhsZfqSEpu9g7s2I2XQ== X-Received: by 2002:a17:907:d59a:b0:a7a:c812:36c8 with SMTP id a640c23a62f3a-a8090c6b841mr169195266b.18.1723130813098; Thu, 08 Aug 2024 08:26:53 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7de8afba6asm606988466b.66.2024.08.08.08.26.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:52 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 19/41] libmultipath: rename __unlock() Date: Thu, 8 Aug 2024 17:25:58 +0200 Message-ID: <20240808152620.93965-20-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/lock.c | 4 ++-- libmultipath/lock.h | 2 +- multipathd/uxlsnr.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/lock.c b/libmultipath/lock.c index 93b48db..4d18d82 100644 --- a/libmultipath/lock.c +++ b/libmultipath/lock.c @@ -5,7 +5,7 @@ void cleanup_lock (void * data) struct mutex_lock *lock = data; wakeup_fn *fn = lock->wakeup; - __unlock(lock); + unlock__(lock); if (fn) fn(); } @@ -14,5 +14,5 @@ void set_wakeup_fn(struct mutex_lock *lck, wakeup_fn *fn) { lock(lck); lck->wakeup = fn; - __unlock(lck); + unlock__(lck); } diff --git a/libmultipath/lock.h b/libmultipath/lock.h index 1c05a77..38473a8 100644 --- a/libmultipath/lock.h +++ b/libmultipath/lock.h @@ -50,7 +50,7 @@ static inline int timedlock(struct mutex_lock *a, struct timespec *tmo) return pthread_mutex_timedlock(&a->mutex, tmo); } -static inline void __unlock(struct mutex_lock *a) +static inline void unlock__(struct mutex_lock *a) { pthread_mutex_unlock(&a->mutex); } diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c index 198f382..d74bb35 100644 --- a/multipathd/uxlsnr.c +++ b/multipathd/uxlsnr.c @@ -527,7 +527,7 @@ static int client_state_machine(struct client *c, struct vectors *vecs, case CLT_LOCKED_WORK: if (trylock(&vecs->lock) == 0) { /* don't use cleanup_lock(), lest we wakeup ourselves */ - pthread_cleanup_push_cast(__unlock, &vecs->lock); + pthread_cleanup_push_cast(unlock__, &vecs->lock); c->error = execute_handler(c, vecs); check_for_locked_work(c); pthread_cleanup_pop(1); From patchwork Thu Aug 8 15:25:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757819 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A83819006B for ; Thu, 8 Aug 2024 15:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130818; cv=none; b=Ecmq89ijkL5d8yHViieYGoiAoWFV7GQuMYh6UTTfDzfmvGTHL96sft2UToKsxksEbTIVrw0ODAmx8PjWEe/xM+co4ejR66+OcL4DRWLJqVFjmYAAHMIxRF67IvbC6dwnQEEIX6eBJbZWxH/0eRHqzdwlgMrsgdU3Hl6VmgheX88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130818; c=relaxed/simple; bh=bBhls0mvluKoZDyonXKAW4S1PGMMr60Dtn0KVNr2lVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M1EMNBJ1dSN45jdN7fzhBQxUdlddRJkQPL2aBmimaYA3VHhLbncFHgEOWGBRRoX6IY0Uj9mRdcdgJmcxuV7/Jmte2aZb7kFaO11AOn1yOqPDLBaYLf2XH3Pij8i6J8cEWc9xYRmqK4AlKp7Eg2Cw7lEZSQaxac/0HBbIOuYa8aw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=KBvdbI0o; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="KBvdbI0o" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-52f04b4abdcso1476568e87.2 for ; Thu, 08 Aug 2024 08:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130814; x=1723735614; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EMZG/B6zmS3uRMbqJnlnzqT9SeJsRdUOFJ5jlqzbgyY=; b=KBvdbI0oa57IiYmglw3N0gRabbxKQsCS1Jsunpo014c9ebbgUQy+LgmFTPGDFVu08K 3FUOrydMIN6opjUTqEtblfstzmJK0ZcvHldQK75y/3tXgTi5WC6O8rQAFZmq+ecVpLlk TdHEc16ZYYywveu+hJnvPuxNi2GLMU+x6sC9recG1RvZcB6FvuH4IrVvulnqOck2IaSY KnrOfPQPdwAgCWt+CXNk0273nwQReKsvKX0m+/seei3OuF3wEwkJQSwN10zRSTSvNYsj fQinLLjCxwM370Pm+SFi0R1SWKD2w8N73X9yYMiqWVINAz0t8qErV4liErLaFdSr8jju StJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130814; x=1723735614; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EMZG/B6zmS3uRMbqJnlnzqT9SeJsRdUOFJ5jlqzbgyY=; b=qd+Mh8w1D0M8Uj7+s8xoL7hkXACn3z22meYbi85W5ct7II/XE29oYcGI0Lu0nJ3Flv VJx54ia2R0BXdjCjM6tuh1W15YqfMbCIEDrsiYKcyuSVdcZCHK+VVj9twblsPfvFHNKG d1RMxdycrLnULOChAqjig2SuG2woJlPwz8XtJ+k9aHyD6Gh+y5chqswjhdIbuunEY8uP i0krgbmZiFXBqE/7Qtb2fxLFe21quxS4lVObek3TTGWpGA1jzJ1a+Obx86PYL7KwVFEx 7+zYDkx5wUoJeVV5qTlm0LNcVRjSpsndL8MU93XqHhfP6Map6cLQxlbYT85j7+nBkyPr /YgQ== X-Gm-Message-State: AOJu0Yz/DLSJW7UFBpRGGszBg82g+XCev8b3QHEsdiG7DTROFA7hnLLG rGa6U3jHDKdR5BSitFT3xYJIeZtvLqvHZ/LtGyVkfUNdTWf4FKtxW/s5//Aoezo= X-Google-Smtp-Source: AGHT+IE4c6vISgnQ6X0vx0ISFrUyPTmP4aivYlms+dSKX1S0nvxs2ffjw0/JxqBR6nuMS3x/On5Xzw== X-Received: by 2002:a05:6512:3d29:b0:52e:987f:cfc6 with SMTP id 2adb3069b0e04-530e589a324mr1789554e87.51.1723130814137; Thu, 08 Aug 2024 08:26:54 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0cb83sm750372766b.49.2024.08.08.08.26.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:53 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 20/41] libmultipath: rename __sysfs_attr_get_value() Date: Thu, 8 Aug 2024 17:25:59 +0200 Message-ID: <20240808152620.93965-21-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/sysfs.c | 6 +++--- tests/sysfs.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index afe9de9..b2c1ce0 100644 --- a/libmultipath/sysfs.c +++ b/libmultipath/sysfs.c @@ -45,7 +45,7 @@ * as libudev lacks the capability to update an attribute value. * So for modified attributes we need to implement our own function. */ -static ssize_t __sysfs_attr_get_value(struct udev_device *dev, const char *attr_name, +static ssize_t sysfs_attr_get_value__(struct udev_device *dev, const char *attr_name, char *value, size_t value_len, bool binary) { const char *syspath; @@ -100,13 +100,13 @@ static ssize_t __sysfs_attr_get_value(struct udev_device *dev, const char *attr_ ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name, char *value, size_t value_len) { - return __sysfs_attr_get_value(dev, attr_name, value, value_len, false); + return sysfs_attr_get_value__(dev, attr_name, value, value_len, false); } ssize_t sysfs_bin_attr_get_value(struct udev_device *dev, const char *attr_name, unsigned char *value, size_t value_len) { - return __sysfs_attr_get_value(dev, attr_name, (char *)value, + return sysfs_attr_get_value__(dev, attr_name, (char *)value, value_len, true); } diff --git a/tests/sysfs.c b/tests/sysfs.c index c623d1b..6dfa9f3 100644 --- a/tests/sysfs.c +++ b/tests/sysfs.c @@ -90,7 +90,7 @@ static int teardown(void **state) static void expect_sagv_invalid(void) { - expect_condlog(1, "__sysfs_attr_get_value: invalid parameters"); + expect_condlog(1, "sysfs_attr_get_value__: invalid parameters"); } static void test_sagv_invalid(void **state) @@ -132,12 +132,12 @@ static void test_sagv_invalid(void **state) static void test_sagv_bad_udev(void **state) { will_return(__wrap_udev_device_get_syspath, NULL); - expect_condlog(3, "__sysfs_attr_get_value: invalid udevice"); + expect_condlog(3, "sysfs_attr_get_value__: invalid udevice"); assert_int_equal(sysfs_attr_get_value((void *)state, (void *)state, (void *)state, 1), -EINVAL); will_return(__wrap_udev_device_get_syspath, NULL); - expect_condlog(3, "__sysfs_attr_get_value: invalid udevice"); + expect_condlog(3, "sysfs_attr_get_value__: invalid udevice"); assert_int_equal(sysfs_bin_attr_get_value((void *)state, (void *)state, (void *)state, 1), -EINVAL); } @@ -151,11 +151,11 @@ static void test_sagv_bad_snprintf(void **state) longstr[sizeof(longstr) - 1] = '\0'; will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(3, "__sysfs_attr_get_value: devpath overflow"); + expect_condlog(3, "sysfs_attr_get_value__: devpath overflow"); assert_int_equal(sysfs_attr_get_value((void *)state, longstr, buf, sizeof(buf)), -EOVERFLOW); will_return(__wrap_udev_device_get_syspath, "/foo"); - expect_condlog(3, "__sysfs_attr_get_value: devpath overflow"); + expect_condlog(3, "sysfs_attr_get_value__: devpath overflow"); assert_int_equal(sysfs_bin_attr_get_value((void *)state, longstr, (unsigned char *)buf, sizeof(buf)), -EOVERFLOW); @@ -171,7 +171,7 @@ static void test_sagv_open_fail(void **state) expect_value(WRAP_OPEN, flags, O_RDONLY); errno = ENOENT; wrap_will_return(WRAP_OPEN, -1); - expect_condlog(3, "__sysfs_attr_get_value: attribute '/foo/bar' cannot be opened"); + expect_condlog(3, "sysfs_attr_get_value__: attribute '/foo/bar' cannot be opened"); assert_int_equal(sysfs_attr_get_value((void *)state, "bar", buf, sizeof(buf)), -ENOENT); } @@ -190,7 +190,7 @@ static void test_sagv_read_fail(void **state) errno = EISDIR; will_return(__wrap_read, -1); will_return(__wrap_read, NULL); - expect_condlog(3, "__sysfs_attr_get_value: read from /foo/bar failed:"); + expect_condlog(3, "sysfs_attr_get_value__: read from /foo/bar failed:"); will_return(__wrap_close, 0); assert_int_equal(sysfs_attr_get_value((void *)state, "bar", buf, sizeof(buf)), -EISDIR); @@ -205,7 +205,7 @@ static void test_sagv_read_fail(void **state) errno = EPERM; will_return(__wrap_read, -1); will_return(__wrap_read, NULL); - expect_condlog(3, "__sysfs_attr_get_value: read from /foo/baz failed:"); + expect_condlog(3, "sysfs_attr_get_value__: read from /foo/baz failed:"); will_return(__wrap_close, 0); assert_int_equal(sysfs_bin_attr_get_value((void *)state, "baz", (unsigned char *)buf, sizeof(buf)), @@ -235,7 +235,7 @@ static void _test_sagv_read(void **state, unsigned int bufsz) if (bufsz <= sizeof(input) - 1) { n = bufsz; trunc = 1; - expect_condlog(3, "__sysfs_attr_get_value: overflow reading from /foo/bar"); + expect_condlog(3, "sysfs_attr_get_value__: overflow reading from /foo/bar"); } else { n = sizeof(input) - 1; trunc = 0; @@ -311,7 +311,7 @@ static void _test_sagv_read_zeroes(void **state, unsigned int bufsz) if (bufsz <= sizeof(input) - 1) { n = bufsz; - expect_condlog(3, "__sysfs_attr_get_value: overflow reading from /foo/bar"); + expect_condlog(3, "sysfs_attr_get_value__: overflow reading from /foo/bar"); } else n = 0; From patchwork Thu Aug 8 15:26:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757820 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24712190063 for ; Thu, 8 Aug 2024 15:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130819; cv=none; b=sOy07mTT3pDmMTH7xXSkw7t/CDTrtute4oXucZvuFS3AWIUBeWrR8+7q7oISjMuSiWTgeTXK5R3xduPUw9xHmMHJxAqj7cH/SVoljaPOa8qAPesd28gC/416LitEdrRNiQmuqUNqv2JHd0b/ocaWYzGObhLgk8WZ9PwAUUwQ5Ls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130819; c=relaxed/simple; bh=TxYC24j9GM7ydyj8Ifqu3VwA1kfVwlcdSpB1ArG2As0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dQOOA8yskjdUqNoxyfeRd0qvTMZziFfbFjlJTQSJSiTu4YE2WNgWwiy15dUawIFMH3EtmyLZ1eR6G2DAb941tiHxaAUfxnaQ4HiXQaWjbeuvy063+9UTCImES3j//Fr5KRRaD7sbWD02TZdZi8334LGBcrWvMbHspo5hEMWqb60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Qq4M6Dlh; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Qq4M6Dlh" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135eso1651936a12.0 for ; Thu, 08 Aug 2024 08:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130815; x=1723735615; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JA63NfXh38zI7QlfT2oUdMyI0pdIgc+Lcl8UNIoi84o=; b=Qq4M6Dlhyj7RBzMhwqMtxiCw6TpXzlnJl8WZ+jKEJ9xQm41Rx8THZvwUDac5vFpEs4 x0lXAk5HPiUFCSmkcO90sgac3Y5Pf/I9t9WzMPrjkK0M049pW7KyN2IDf3JUpeu/H/d8 ldi5cPSCd3L/q2dEK9l8Uocll3lF1jehGzp6wVJOe3yRoISuCWCWOmm6iFUtgM4TA3b5 440Me82mm7OHXo9hhaBUhL0J/K5XGfjLNF2jI7Ce3mAU0yEJUyrDZfGT0CvDCj/bPTLs X5DzN147KW11EUdxdAFRckiwUUpivif6So437KqHkhqALUIkQ2LnxqER5aGS51HIX05b 5RjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130815; x=1723735615; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JA63NfXh38zI7QlfT2oUdMyI0pdIgc+Lcl8UNIoi84o=; b=XEkJP/q4R+QUN6n80PXYHv45La6F/KBv3Ar3LAQujv6OYBQ1wnSdkVYRclO7BHMy+P YV2qvptwVrc8tVA7vLE5WpGgS1iHQ67ndfCHu1tVExi7pW9WGQkmrBz+INbNl9UzHSnD kTKArxIz7LJ13gcxLJfsTtjCAworMwmDZdQVFlWWSw5FgxdwWrZW8y6UoGlXT3ZogQz6 iTSjUzW5XqmyBaFkvRazTRNqijIwg73GrHcNgTwIMMfPXg47XNBxusPSWGROReIsarAD ZnA4yI+l/4qqFL+R6Rhd4Yz4vhHkrt6dyM3LJ/hPTr532S8cYXReeYjL1HYmkgKQxNiG VsnA== X-Gm-Message-State: AOJu0YxwF5xe3MMWhy7BhKfBXbWc3gAG0LXYY34VJQM6cBTPeIadapJ2 ncbsnx/kVZsCwXyq8p4RSdLHMOOtqwNlbfC/NiREbWLHFciiLBa6iOJleeKTerk= X-Google-Smtp-Source: AGHT+IFfxmsCUyrz5iY93Qi3021JsqJuLf4Sa+BzEKFzSS5OzOsM/lB1ZpF0GA5HVNQi1bc3TwV42w== X-Received: by 2002:a05:6402:26d4:b0:59e:a1a6:11b9 with SMTP id 4fb4d7f45d1cf-5bbb3bc0154mr2087927a12.2.1723130815039; Thu, 08 Aug 2024 08:26:55 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2d3496fsm737199a12.72.2024.08.08.08.26.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:54 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 21/41] libmultipath: rename __snprint_foreign_topology() Date: Thu, 8 Aug 2024 17:26:00 +0200 Message-ID: <20240808152620.93965-22-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ... and __LAST_FOREIGN_RETCODE. Signed-off-by: Martin Wilck --- libmultipath/foreign.c | 6 +++--- libmultipath/foreign.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index d01a5ef..2a42df5 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -499,7 +499,7 @@ void foreign_multipath_layout(fieldwidth_t *width) pthread_cleanup_pop(1); } -static int __snprint_foreign_topology(struct strbuf *buf, int verbosity, +static int snprint_foreign_topology__(struct strbuf *buf, int verbosity, const fieldwidth_t *width) { struct foreign *fgn; @@ -540,7 +540,7 @@ int snprint_foreign_topology(struct strbuf *buf, int verbosity, return 0; } pthread_cleanup_push(unlock_foreigns, NULL); - rc = __snprint_foreign_topology(buf, verbosity, width); + rc = snprint_foreign_topology__(buf, verbosity, width); pthread_cleanup_pop(1); return rc; } @@ -570,7 +570,7 @@ void print_foreign_topology(int verbosity) fgn->release_paths(fgn->context, vec); pthread_cleanup_pop(1); } - __snprint_foreign_topology(&buf, verbosity, width); + snprint_foreign_topology__(&buf, verbosity, width); pthread_cleanup_pop(1); printf("%s", get_strbuf_str(&buf)); } diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h index db1592c..f3bc1b2 100644 --- a/libmultipath/foreign.h +++ b/libmultipath/foreign.h @@ -32,7 +32,7 @@ enum foreign_retcode { FOREIGN_UNCLAIMED, FOREIGN_NODEV, FOREIGN_ERR, - __LAST_FOREIGN_RETCODE, + LAST_FOREIGN_RETCODE__, }; /** From patchwork Thu Aug 8 15:26:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757821 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA1BD190462 for ; Thu, 8 Aug 2024 15:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130820; cv=none; b=D7v1VznfRI9A0xUdChyeKZRKx7mMZyxwZi8NmTyHsb2B3TQtrm16zWtWFYNoECF/MqP8GB0tSGDoJfLZkl2DQwhrgeY96XL9B76nnCOXE8e5zY4nPPhb0L4bx6oGPdJE3KiPkXExw/F98HxYJl33T1aY21tIOESVjqaMqwjiqpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130820; c=relaxed/simple; bh=SferSm7gQwjsvs1jIhc24SVw7F61Gi1NOCeCqlS5+ds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fYtMLdjCpztELVM9ycBaLGCZDxLilKh4rGWHoE2MH9jMKB2IVHpem8UTkdhlv+ewhANf66mKYIF9PkMF9GzCOlQtfWZ7Z7qEojsswgs2DMmYCtZwM3TIqg5ulUBOBIUBg5jIqUWdgFPySSSUl2cpQRKPu4Vxp+LmOyvTmTLMkHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=gNvRVMSf; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gNvRVMSf" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a7a81bd549eso97608666b.3 for ; Thu, 08 Aug 2024 08:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130816; x=1723735616; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3NlI8fwGm6fP48uLft8EtDunzL17dsF5KwEJj9rj2VQ=; b=gNvRVMSfeSMFDb4EdsOLO4kjIciXf7LLI0detHcMIyfQQwrkbF0+yIYWfONJHXZ8g+ Ehs6+OULsFukmQRZy/4NYZcmJOlm+mlav/rkS7vL13xWUa6B15VkpMjsNRAXH5KOd4/f memLx3QHuhAZzC1fy/aGWWA1J/OiuIAXttLx6O/wly7Xz2RDMkIUAUZpkAwjoLv0wVF4 MusfeORsJlSfGegsSmCrraDxsYietOmrGRDjgohmYwOlpSmO++J8rcE6QIP4/HCDunkB SQMVGAVR4vnsQ2ogKADHtAPJPypSN4aHqEW1mQ5zg7DQLpYiDtlbylmClSNOIucy423Z Jq6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130816; x=1723735616; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3NlI8fwGm6fP48uLft8EtDunzL17dsF5KwEJj9rj2VQ=; b=gexLuiiEnlG2PrjAoaMATMIB/woQQyDuf0e6ZoDCoE5xRtm0BH9vUrwh6d2TEMpkow r89rvfeiuwz18n9HWw0dRTqCuBGWL6JuwpIyCO6lHUpVHv/3X2CDhVKR5Xy5G9wi2xQK iYYoR0pqn3El6wslyOccPPYTUlZ3n7jQUv9/dBcuE3Yhtlw5cFkbVUaoQmtBWEShT0d7 d9gt5fruvYuZ0Sgc+iPudWpA6pzd0njzpfS3hLA1WmSXlJvdylIgHU1VuA4wYEjfCJAU SbRP+B7zyMPm1PnGUdLzEvQwBbL82QTDLK8kQsOU4p5r5/g3ZJwMnKDcF7oWPOeyReLu AH/g== X-Gm-Message-State: AOJu0YzUcMuFL+tLdrW9zXftDGu33VNIEd2a9I+w7o4oTaSlZW79M+Cd vi3qB5+PRlnYIr8yIKPAc3xrYV7uhLgwxOaUhrS1JbYGCpbqU8fqejUktyDnH6E= X-Google-Smtp-Source: AGHT+IGcPE9QOek0xmRzSYylBpWGVTB46OdgyivCPHSwe0GUGYRL2JN9+cl1aL3s1DOr5Po4WdJ2sw== X-Received: by 2002:a17:907:f78b:b0:a77:c043:5b5a with SMTP id a640c23a62f3a-a8090db1dfemr174689966b.39.1723130815994; Thu, 08 Aug 2024 08:26:55 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9d437bbsm747852066b.121.2024.08.08.08.26.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:55 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 22/41] libmultipath: rename macros with double underscores in propsel.c Date: Thu, 8 Aug 2024 17:26:01 +0200 Message-ID: <20240808152620.93965-23-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/propsel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index e2dcb31..a3fce20 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -48,7 +48,7 @@ do { \ } \ } while(0) -#define __do_set_from_vec(type, var, src, dest) \ +#define do_set_from_vec__(type, var, src, dest) \ ({ \ type *_p; \ bool _found = false; \ @@ -64,11 +64,11 @@ do { \ _found; \ }) -#define __do_set_from_hwe(var, src, dest) \ - __do_set_from_vec(struct hwentry, var, (src)->hwe, dest) +#define do_set_from_hwe__(var, src, dest) \ + do_set_from_vec__(struct hwentry, var, (src)->hwe, dest) #define do_set_from_hwe(var, src, dest, msg) \ - if (src->hwe && __do_set_from_hwe(var, src, dest)) { \ + if (src->hwe && do_set_from_hwe__(var, src, dest)) { \ origin = msg; \ goto out; \ } @@ -660,7 +660,7 @@ check_rdac(struct path * pp) if (pp->bus != SYSFS_BUS_SCSI) return 0; /* Avoid checking 0xc9 if this is likely not an RDAC array */ - if (!__do_set_from_hwe(checker_name, pp, checker_name) && + if (!do_set_from_hwe__(checker_name, pp, checker_name) && !is_vpd_page_supported(pp->fd, 0xC9)) return 0; if (checker_name && strcmp(checker_name, RDAC)) From patchwork Thu Aug 8 15:26:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757822 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA20E190468 for ; Thu, 8 Aug 2024 15:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130820; cv=none; b=VdHlhC4XN0YfBL1X6C14q4E9tFA15ZlsTLdhECpz9L1kdKrcyByfSL3IYvfOL+mkv3WF/a+H0gNucRe8/umVL8Xg+SiM28BSc88FwwvcDMLrGSdES236atJFJzKu8H5TcJnA6/ni5GAlRSSzgs0b8CMC0nmHaIERbQpixfOPdV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130820; c=relaxed/simple; bh=9NDJb86pvCINZo73KdVCa640PlVd0wOamDKwb4U1LqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uj164OzakKBop+884nu43qoqc18vCFmBSYr3msgJh+jpY3aR3/AqEjEw8NkUL8yhpGzckOXhwginE1WSBOEK3w35DwttKwklxMJAoLYk5UzOQjwl5TGzARzQP18yXNuQbSMf3HSZIxz0OJVNCqm5SCGFjK+ctYjY2TldT7NGFiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=EjmyKakv; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="EjmyKakv" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5b01af9b0c9so1192485a12.3 for ; Thu, 08 Aug 2024 08:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130817; x=1723735617; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hiyIz3ejGgt7sPKinx/mWchTJwGbSJpTPnR53Xsk+QU=; b=EjmyKakvYxVDqn0lhBNun2IBbsdmGF/2JBjsv1ZHT90Aauswjhj2O0Lh8T9XiKygbz eg198ng68JjXBsKAomT2dNN6Aca332aCIK4Ya+yguZFf1no5ij2SZ/pB+SR/i6harAb0 cdl/14vglPNI00NTwGzg66JF48M6fkgtlqBUvVeZT0z3uFuIX1TfF1vlN1OrerQuOk5T PI8SmLoUvWhRnfuQTP7YOeRfry6bCt/5y8NXB/emRZBEX/sl2Or3gf8TYHLHUisKnfna YQAB32U1zlCMgTTMBr+tjQ0+mHLEZ2XVcaMZRA0NzKeEg18Sf3CsYlVhkL3Cbt+DkT9h csTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130817; x=1723735617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hiyIz3ejGgt7sPKinx/mWchTJwGbSJpTPnR53Xsk+QU=; b=Vip0rWI1ckYeIS8D+bruk0F4CGWftNod1pXGBAOJO5FUg4XcK5pP3RrLYkcIdmOAt0 9jdSK6jrOSDHlAWeag3CnvuFuzMgHuMKE/1AM2irzwz1RDG1sn0aFGj9OVkuytDRT/fT kqhm5m/hHQxSjYqe4Evx5bweYsxwiGMGIy3RZuy6AU07FNoCt+myZm3defrccmHbKUxu s5y88cvI6cWECYOBHG7EzcS/N6qVxYdNvwNPcBRNU9Qq9P2YfAq6cWq+xtTTx7sNUJ17 M9RxPcBOONQwZYHkG+agW6CJLkmzL+JHIo3S3O1d27WTzeY2vZpgOGGfhaZc7Hs0dtmV M5IA== X-Gm-Message-State: AOJu0Yz9DlGk7RSC2fqJOw6ydLrrketvX+9kSyvQYjdP98AVwly+9iLq 6Tr/+aZMJ2ZCBIDut9LEVOKcTRwyCoKWBSm33D1egjaPjAcuzY4RnJGJjhUch6Y= X-Google-Smtp-Source: AGHT+IH45lcwIxZjgzC2/r8U7k8yjawQJgD+vStVv8RnrswmGDKs9TtbSiciWjXWL1VXQYpKZ+zT7A== X-Received: by 2002:a05:6402:50cd:b0:5a1:b42f:c93 with SMTP id 4fb4d7f45d1cf-5bbb221c324mr1788498a12.13.1723130816952; Thu, 08 Aug 2024 08:26:56 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2bf8e78sm729878a12.3.2024.08.08.08.26.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:56 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 23/41] libmultipath: rename enum values with double underscores in structs.h Date: Thu, 8 Aug 2024 17:26:02 +0200 Message-ID: <20240808152620.93965-24-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/dict.c | 4 ++-- libmultipath/print.c | 2 +- libmultipath/structs.h | 4 ++-- libmultipath/valid.c | 2 +- tests/mpathvalid.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 546103f..a06a613 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -568,7 +568,7 @@ def_find_multipaths_handler(struct config *conf, vector strvec, if (!buff) return 1; - for (i = FIND_MULTIPATHS_OFF; i < __FIND_MULTIPATHS_LAST; i++) { + for (i = FIND_MULTIPATHS_OFF; i < FIND_MULTIPATHS_LAST__; i++) { if (find_multipaths_optvals[i] != NULL && !strcmp(buff, find_multipaths_optvals[i])) { conf->find_multipaths = i; @@ -576,7 +576,7 @@ def_find_multipaths_handler(struct config *conf, vector strvec, } } - if (i >= __FIND_MULTIPATHS_LAST) { + if (i >= FIND_MULTIPATHS_LAST__) { if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0) conf->find_multipaths = FIND_MULTIPATHS_OFF; else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0) diff --git a/libmultipath/print.c b/libmultipath/print.c index b911802..b8868ea 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -575,7 +575,7 @@ static int snprint_initialized(struct strbuf *buff, const struct path * pp) }; const char *str; - if (pp->initialized < INIT_NEW || pp->initialized >= __INIT_LAST) + if (pp->initialized < INIT_NEW || pp->initialized >= INIT_LAST__) str = "undef"; else str = init_state_name[pp->initialized]; diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 6b5de7a..56fb74b 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -99,7 +99,7 @@ enum find_multipaths_states { FIND_MULTIPATHS_GREEDY, FIND_MULTIPATHS_SMART, FIND_MULTIPATHS_STRICT, - __FIND_MULTIPATHS_LAST, + FIND_MULTIPATHS_LAST__, }; enum marginal_pathgroups_mode { @@ -258,7 +258,7 @@ enum initialized_states { * change uevent is received. */ INIT_PARTIAL, - __INIT_LAST, + INIT_LAST__, }; enum prkey_sources { diff --git a/libmultipath/valid.c b/libmultipath/valid.c index d751780..5df9b02 100644 --- a/libmultipath/valid.c +++ b/libmultipath/valid.c @@ -302,7 +302,7 @@ is_path_valid(const char *name, struct config *conf, struct path *pp, return PATH_IS_ERROR; if (conf->find_multipaths <= FIND_MULTIPATHS_UNDEF || - conf->find_multipaths >= __FIND_MULTIPATHS_LAST) + conf->find_multipaths >= FIND_MULTIPATHS_LAST__) return PATH_IS_ERROR; if (safe_sprintf(pp->dev, "%s", name)) diff --git a/tests/mpathvalid.c b/tests/mpathvalid.c index df66ed6..134dfc9 100644 --- a/tests/mpathvalid.c +++ b/tests/mpathvalid.c @@ -130,7 +130,7 @@ void make_config_file(int findmp) char buf[64]; assert_true(findmp > FIND_MULTIPATHS_UNDEF && - findmp < __FIND_MULTIPATHS_LAST); + findmp < FIND_MULTIPATHS_LAST__); r = snprintf(buf, sizeof(buf), "defaults {\nfind_multipaths %s\n}\n", find_multipaths_optvals[findmp]); From patchwork Thu Aug 8 15:26:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757823 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5FBF190475 for ; Thu, 8 Aug 2024 15:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130821; cv=none; b=Xyz20G/mPPLVPE/VYL0X90FBXxEh3CA3BUullSaDkw5sXVGN7UU+VeWBtiTjumdlZi8PZjJXMDT60fJEhcujmqSFhnFyF1Gr8Y9EO7x/rZOVHb1FCxQQila8zir7jXxNwVfZOf9xaJ3T6eRpWntEUXcL0wUgUnLJ+OzenXJ7Tp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130821; c=relaxed/simple; bh=Acwc7K6VUtkipSQ+y5yJIKDM51C7wu1tVtZwh54RkfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rw4WZqxTKmmbp/mEAz8T+0517DiiAkB4EGbnT3DOPeGM81Pm1gTWlN+AhGIu4MOx2ycbKVStYoalV2WlvVL0o0UEJuic8G1tqX3cQTyaQ2eSF9Ir6nNjof+UJ/Q1my3/P1BbmfYiCwbdyBzWOVOzp4EwTcDol+X8CcIkQd5LRPw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=SzvvYGj/; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="SzvvYGj/" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a7aa4bf4d1eso141512866b.0 for ; Thu, 08 Aug 2024 08:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130818; x=1723735618; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pKWkBe/yzdeS/gkunkSE4OuaqidURsKkkxDKM/IXAjc=; b=SzvvYGj/ObyfjiD/Tu+NJGA6+ZQnsnLTpDsozB74G244/zooFmLQTEuWt5Cs9nlvzV M/JL80/l1h+uIpnZ8ofPHms8jrPUtIoCQDoXWfqld8quSWzUXhOmPEqBkL4MzAlMUm5j nNDFoXT53Vo9AZ1Y+IkLfLP4C6YAmvSWJjOO9vvV1hvAkMf+verYFuyjStOH65aSeenj jnqWPb5yiJ6UKRyBkY3SlrdLXDNXa/+zLpC0IA8LvM1NmrzIsX7cAnCEh7mIjvLCIHiR AvcLPlx3ziHlxGFPArR6MbiOUjvPn0V5rJsMtc94PTTgNenaeIsMMoZUAEbsENMRQn/h WhOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130818; x=1723735618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pKWkBe/yzdeS/gkunkSE4OuaqidURsKkkxDKM/IXAjc=; b=dp48GiRk9BU9qWuwlagOS7wo9iE2zZUpZckLFTJeuZ8Moa3hcPI8mBcrHXJO7SqBdv Y5aJdSRm7ufnBBF+8jlklbMfupb/AKXL5Pyb7k2eUqSKvzCxhgpvtTq8aVjEYduxmbYV z0p6WQF6T5c/IFNBqGapgbFJUi4qwPltkVrO0yoNrntqhFd/Jfr4nodEpK9EYYPPOiFW zOo0REzp1AypCBgAi96vXjBGPEubgDeTEUWYAd2vfBnRCmKUEChF9nMovjjs/0QcB94+ 7DM4bYj3p73P5R3bK2v+ndw4abqoCxjvrOHURIdLAcP6QmyGzo2oB61/XhLTMz1Ba4L/ ZL4g== X-Gm-Message-State: AOJu0Yy+iQqSG3knWsBxZKUH2QYf4oG3wCZu4YWFg4CpNZtZ8H1QdO0A 27ntKna4qQ8sEY8H7OgQdLggGAPmlhtksmB6QxYL1QwVYnAFhfhyQVm2czha4ak= X-Google-Smtp-Source: AGHT+IGbOR89BeLDTSkG7bZbRWo7K8S5XUqhV9EQGIeLBQa4aAsJ/+U39rm05dAUPewJM7lA8GLXNg== X-Received: by 2002:a17:907:3f16:b0:a7a:a2b7:93ff with SMTP id a640c23a62f3a-a8090eabebfmr190193566b.57.1723130817905; Thu, 08 Aug 2024 08:26:57 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9e80e6asm754068266b.165.2024.08.08.08.26.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:57 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 24/41] libmultipath: rename macros starting with underscore Date: Thu, 8 Aug 2024 17:26:03 +0200 Message-ID: <20240808152620.93965-25-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/checkers/directio.c | 8 ++++---- libmultipath/checkers/emc_clariion.c | 20 ++++++++++---------- libmultipath/checkers/rdac.c | 20 ++++++++++---------- libmultipath/checkers/tur.c | 10 +++++----- libmultipath/foreign/nvme.c | 26 +++++++++++++------------- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c index 12b8be4..8e87878 100644 --- a/libmultipath/checkers/directio.c +++ b/libmultipath/checkers/directio.c @@ -49,11 +49,11 @@ enum { MSG_DIRECTIO_BLOCKSIZE, }; -#define _IDX(x) (MSG_DIRECTIO_##x - CHECKER_FIRST_MSGID) +#define IDX_(x) (MSG_DIRECTIO_##x - CHECKER_FIRST_MSGID) const char *libcheck_msgtable[] = { - [_IDX(UNKNOWN)] = " is not available", - [_IDX(PENDING)] = " is waiting on aio", - [_IDX(BLOCKSIZE)] = " cannot get blocksize, set default", + [IDX_(UNKNOWN)] = " is not available", + [IDX_(PENDING)] = " is waiting on aio", + [IDX_(BLOCKSIZE)] = " cannot get blocksize, set default", NULL, }; diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c index 04635b5..bf0baab 100644 --- a/libmultipath/checkers/emc_clariion.c +++ b/libmultipath/checkers/emc_clariion.c @@ -57,20 +57,20 @@ enum { MSG_CLARIION_PASSIVE_GOOD, }; -#define _IDX(x) (MSG_CLARIION_ ## x - CHECKER_FIRST_MSGID) +#define IDX_(x) (MSG_CLARIION_ ## x - CHECKER_FIRST_MSGID) const char *libcheck_msgtable[] = { - [_IDX(QUERY_FAILED)] = ": sending query command failed", - [_IDX(QUERY_ERROR)] = ": query command indicates error", - [_IDX(PATH_CONFIG)] = + [IDX_(QUERY_FAILED)] = ": sending query command failed", + [IDX_(QUERY_ERROR)] = ": query command indicates error", + [IDX_(PATH_CONFIG)] = ": Path not correctly configured for failover", - [_IDX(UNIT_REPORT)] = + [IDX_(UNIT_REPORT)] = ": Path unit report page in unknown format", - [_IDX(PATH_NOT_AVAIL)] = + [IDX_(PATH_NOT_AVAIL)] = ": Path not available for normal operations", - [_IDX(LUN_UNBOUND)] = ": Logical Unit is unbound or LUNZ", - [_IDX(WWN_CHANGED)] = ": Logical Unit WWN has changed", - [_IDX(READ_ERROR)] = ": Read error", - [_IDX(PASSIVE_GOOD)] = ": Active path is healthy", + [IDX_(LUN_UNBOUND)] = ": Logical Unit is unbound or LUNZ", + [IDX_(WWN_CHANGED)] = ": Logical Unit WWN has changed", + [IDX_(READ_ERROR)] = ": Read error", + [IDX_(PASSIVE_GOOD)] = ": Active path is healthy", NULL, }; diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c index 9a3860f..87b8872 100644 --- a/libmultipath/checkers/rdac.c +++ b/libmultipath/checkers/rdac.c @@ -234,19 +234,19 @@ enum { RDAC_MSGID_INQUIRY_FAILED, }; -#define _IDX(x) (RDAC_MSGID_##x - CHECKER_FIRST_MSGID) +#define IDX_(x) (RDAC_MSGID_##x - CHECKER_FIRST_MSGID) const char *libcheck_msgtable[] = { - [_IDX(NOT_CONN)] = MSG_RDAC_DOWN_TYPE("lun not connected"), - [_IDX(IN_STARTUP)] = MSG_RDAC_DOWN_TYPE("ctlr is in startup sequence"), - [_IDX(NON_RESPONSIVE)] = + [IDX_(NOT_CONN)] = MSG_RDAC_DOWN_TYPE("lun not connected"), + [IDX_(IN_STARTUP)] = MSG_RDAC_DOWN_TYPE("ctlr is in startup sequence"), + [IDX_(NON_RESPONSIVE)] = MSG_RDAC_DOWN_TYPE("non-responsive to queries"), - [_IDX(IN_RESET)] = MSG_RDAC_DOWN_TYPE("ctlr held in reset"), - [_IDX(FW_DOWNLOADING)] = + [IDX_(IN_RESET)] = MSG_RDAC_DOWN_TYPE("ctlr held in reset"), + [IDX_(FW_DOWNLOADING)] = MSG_RDAC_DOWN_TYPE("ctlr firmware downloading"), - [_IDX(QUIESCED)] = MSG_RDAC_DOWN_TYPE("ctlr quiesced by admin request"), - [_IDX(SERVICE_MODE)] = MSG_RDAC_DOWN_TYPE("ctlr is in service mode"), - [_IDX(UNAVAILABLE)] = MSG_RDAC_DOWN_TYPE("ctlr is unavailable"), - [_IDX(INQUIRY_FAILED)] = MSG_RDAC_DOWN_TYPE("inquiry failed"), + [IDX_(QUIESCED)] = MSG_RDAC_DOWN_TYPE("ctlr quiesced by admin request"), + [IDX_(SERVICE_MODE)] = MSG_RDAC_DOWN_TYPE("ctlr is in service mode"), + [IDX_(UNAVAILABLE)] = MSG_RDAC_DOWN_TYPE("ctlr is unavailable"), + [IDX_(INQUIRY_FAILED)] = MSG_RDAC_DOWN_TYPE("inquiry failed"), NULL, }; diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c index 2800446..a2905af 100644 --- a/libmultipath/checkers/tur.c +++ b/libmultipath/checkers/tur.c @@ -35,12 +35,12 @@ enum { MSG_TUR_TRANSITIONING, }; -#define _IDX(x) (MSG_ ## x - CHECKER_FIRST_MSGID) +#define IDX_(x) (MSG_ ## x - CHECKER_FIRST_MSGID) const char *libcheck_msgtable[] = { - [_IDX(TUR_RUNNING)] = " still running", - [_IDX(TUR_TIMEOUT)] = " timed out", - [_IDX(TUR_FAILED)] = " failed to initialize", - [_IDX(TUR_TRANSITIONING)] = " reports path is transitioning", + [IDX_(TUR_RUNNING)] = " still running", + [IDX_(TUR_TIMEOUT)] = " timed out", + [IDX_(TUR_FAILED)] = " failed to initialize", + [IDX_(TUR_TRANSITIONING)] = " reports path is transitioning", NULL, }; diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index 6f2d880..9b26764 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@ -955,18 +955,18 @@ void release_paths(__attribute__((unused)) const struct context *ctx, } /* compile-time check whether all methods are present and correctly typed */ -#define _METHOD_INIT(x) .x = x +#define METHOD_INIT(x) .x = x static struct foreign __methods __attribute__((unused)) = { - _METHOD_INIT(init), - _METHOD_INIT(cleanup), - _METHOD_INIT(change), - _METHOD_INIT(delete), - _METHOD_INIT(delete_all), - _METHOD_INIT(check), - _METHOD_INIT(lock), - _METHOD_INIT(unlock), - _METHOD_INIT(get_multipaths), - _METHOD_INIT(release_multipaths), - _METHOD_INIT(get_paths), - _METHOD_INIT(release_paths), + METHOD_INIT(init), + METHOD_INIT(cleanup), + METHOD_INIT(change), + METHOD_INIT(delete), + METHOD_INIT(delete_all), + METHOD_INIT(check), + METHOD_INIT(lock), + METHOD_INIT(unlock), + METHOD_INIT(get_multipaths), + METHOD_INIT(release_multipaths), + METHOD_INIT(get_paths), + METHOD_INIT(release_paths), }; From patchwork Thu Aug 8 15:26:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757824 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9068019047A for ; Thu, 8 Aug 2024 15:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130822; cv=none; b=aQUTg8gTvoTZv7NVQ/3JV3J3Wpt6RrajIz7RiAONPzLHy8A6LuUnFQuaeOi5iaeiKKr681rJ/3TUu1/NRsu7cRqUfy9gru0GVG8/abclaGGSHEM7gHkJJacFApom+tlT+GDXSi8bB4s3TUdfgDEKqPefCKj63R7YxX+1jV4QIA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130822; c=relaxed/simple; bh=gmRae4yZF0mXEA/sR1Wi2TDfcVj/DykINmRNErNregA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n1kCZhbxGXEkjcyJ1y1HbWH6MZsJkuu/VDfxCXSc4Klqq4xdH9NRHX7Jkkw3nSJFKLSpGG7i4v+NuZqeBbTdaqEZ73bfm43edjSaZS/YjFLBGdG5iSofWH6wm4g9gke0jGxFP1+5fuYdoTgPVWzwZntONENvLvz2WDj0h4YL7ME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=bFHGBJtn; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="bFHGBJtn" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135eso1652042a12.0 for ; Thu, 08 Aug 2024 08:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130819; x=1723735619; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KR7siNlYC4ymS5QtLxgHnwNoHyUWhkIPVBQGWioywrY=; b=bFHGBJtnb3MB7WFQyMrSe8w+Ps8FfIjE+HrPjl8aIB1r5+e1zxewSXtaIpy+kH4UrY MZD3B5+K2T03p8AgwKirQdPhD5tyYEGCSIhj0dYd77cSB8XfsuAN/bZOjB8XlH4HNOiv yiiTlpMfHfRozRHwjW784bKXvv7AG6OannccClBP0s0wPaGiP661VHPGevcudnuqPQFi QZC17sHUAsOVpEuFVSDf6zL+kKHIoS8I4hHOFUgRqwe2inA1a0gTGyCG9PjtDD2+SEHH H1C17f6C1/GgjcmHVktxpeWBVb4NSt4wDERk0PDzNzi9SnGQQY/GrZ0kOrqfWPy6esBX zc5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130819; x=1723735619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KR7siNlYC4ymS5QtLxgHnwNoHyUWhkIPVBQGWioywrY=; b=rbyFYVRsMxxaI7ssE7ev0Aku64IQALLW4ILs3K/gtP6N85BvmVqkleivtAtQOByy3L cvKM3VG28FgA3x7qRvwTVupnV7xzaGxVHNvADBYHjHCxODSpeW6QnnQaK8Vr8sasIgyy uGZUUTNPhENBJDNvvigoyqE6muUhhNrWb0IVF9WvZ2jvp53sf3QXquItumo/c7zeLRsE YtwJKDe9gijhdhGXx/FEby6bvORuEgmTOl2fjey9+YuJkI63rZKyTWoWcYwjqSzdixd2 QPbAllZEJ6Oi69x446BaV/saovwtHxCzYY2NNhnWGmaEL9d+GQenbLemaToWdtx4sF8D uT3g== X-Gm-Message-State: AOJu0YyDUCctKK6CulVZOq1WtotH0fyVD0rdE6WXI+hAEB7p/KNlc7H7 7qWjD7AgobAWRSEGtn2GY3JNyQqwZm6wrO+swbw3W69sOHJXCx4Z31+GwIAUrV4= X-Google-Smtp-Source: AGHT+IF9Qjxsdd/XiouIid6BTsTld+p4cTGvd3/0+QEulYfRSfelHWGieTaLZyGtaQLMV4MfviF60g== X-Received: by 2002:a05:6402:11cc:b0:5a1:5c0c:cbd6 with SMTP id 4fb4d7f45d1cf-5bbb3c18a79mr2168147a12.8.1723130818837; Thu, 08 Aug 2024 08:26:58 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2c1fc20sm725694a12.26.2024.08.08.08.26.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:58 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 25/41] libmultipath: rename __internal_config variable Date: Thu, 8 Aug 2024 17:26:04 +0200 Message-ID: <20240808152620.93965-26-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/config.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index a59533b..34cbb43 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -72,13 +72,13 @@ void libmultipath_exit(void) pthread_once(&_exit_once, _libmultipath_exit); } -static struct config __internal_config; +static struct config internal_config; struct config *libmp_get_multipath_config(void) { - if (!__internal_config.hwtable) + if (!internal_config.hwtable) /* not initialized */ return NULL; - return &__internal_config; + return &internal_config; } struct config *get_multipath_config(void) @@ -734,7 +734,7 @@ static void _uninit_config(struct config *conf) int i; if (!conf) - conf = &__internal_config; + conf = &internal_config; if (conf->selector) free(conf->selector); @@ -791,14 +791,14 @@ static void _uninit_config(struct config *conf) void uninit_config(void) { - _uninit_config(&__internal_config); + _uninit_config(&internal_config); } void free_config(struct config *conf) { if (!conf) return; - else if (conf == &__internal_config) { + else if (conf == &internal_config) { condlog(0, "ERROR: %s called for internal config. Use uninit_config() instead", __func__); return; @@ -883,7 +883,7 @@ static int _init_config (const char *file, struct config *conf); int init_config(const char *file) { - return _init_config(file, &__internal_config); + return _init_config(file, &internal_config); } struct config *load_config(const char *file) @@ -901,7 +901,7 @@ int _init_config (const char *file, struct config *conf) { if (!conf) - conf = &__internal_config; + conf = &internal_config; /* * Processing the config file will overwrite conf->verbosity if set From patchwork Thu Aug 8 15:26:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757825 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCAE1190063 for ; Thu, 8 Aug 2024 15:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130823; cv=none; b=H5FbtiS5ywWbtzJff8UEIedU6bWyL0GY68TT1WoKheuuRDqRfM/D9/8q6C+I1XX9AHJifJAlPRSVe6kFmEFi964WDKmdpPldnMvmv0ZTQMD0Eba2sKgF3TaAoQe65Y86tzfMamUcj6QTArkOHJO4quCOnhWV1nlrNaMtmaeDSF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130823; c=relaxed/simple; bh=fXTIyXhsS6z6yT0MRAp5NN/+iSCq2WjnB+u6qhpcoog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uSwBI0VuNqRMJlGMbqt3xT+ZpjfIbHmQ+E3MGMuLnTse+X3p0UbogrJ9vb4YtZsyfDEndxJ7ySxoMpCPY4PUDS5l1MdlnN3AgcrU+eTTsxPrAWBcxvk5TaqyXEYFtO3T2MfiaxOwqWLTtyF+hoy5F9Tstfqo8ulV8iXXy+OjVIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=O7uhhQyh; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="O7uhhQyh" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135eso1652061a12.0 for ; Thu, 08 Aug 2024 08:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130820; x=1723735620; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pyjbdEnUBdpI5/ZGj494ZmZAu7mldzv4y5T1N8U8l4E=; b=O7uhhQyhHPMupbEh0OEywMsqQ2Y03syBEiItXhdbPFSf3++Om70w66WEFSlAq0+BRK eBCueLDp4XUVpqQuZhOnWUCQcFoqnZUToGlJW4aj86TxZlrpLztRTXKq+uxDQMSKFNDB +oH5SIXujJWQa8WBfboG8gUXlF4cV2V37P2hrwfzBdNtY8jGm+LIMMEmDASEgTmAoB4u EgSDdMspgA/9ah5vucOfKEcssehzUgJ2Sa0AbU9MDSHRPfLjhGBTFBSxeNPG5JqiTwlB wazVaSe2mWEOUYvSfCbmKVL+aipf+QbbhwWZ1xRn2HXuusnAJtJBwVDFyGmGBVR0+8X/ EeCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130820; x=1723735620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pyjbdEnUBdpI5/ZGj494ZmZAu7mldzv4y5T1N8U8l4E=; b=CCVSvPSYtpyN+Fa5vNXObKn1MrMWeh8pD3O0jPQBLoX/NmFT+iJ6gLnxMDkWvYChBA jFVFr9L+AoxKwisZE0cQKzdI6TuB+Bdxh2Jkv4keiFAbeHX3Sai2762Sc7g54Y8GDyvp FUCPHzBy5gGXZnrSSWxBiAPxCZ6Z8t3e/N70lj07AhDHWze3EBvAtzW7PiEZJ+Qm6270 pJ2X5F4hmbDg0+mkVyzAcluAJH1mu8bawF0blCATvBIPhmGHWrmh/g51wYqORXS0fdb2 VCfp8v6XlOz54yub7QxShE6QitNAzKhcxWqsUg+qUE6gVuExeWYO0oK5idHZbF3NvfEH 4+mQ== X-Gm-Message-State: AOJu0YwJxkCCyP7xFaLjFWIvVM0wca6lnsLIS5MpYUgBJ8/VZdj4pZ9X wsYSdVj7MoKST+I9zHzy5RqFrNzCckekyullqv9EmgDN4U+cQ4xnWeL2WIRf4c2qgp5Kw4LQBxE T2WI= X-Google-Smtp-Source: AGHT+IH0mC2Z04ZjFxobbY+9LQJvAZIFNsPiw+bAmwcVMbhJLMCGoiAosxirxOTZu4TqC4SMGLCxnA== X-Received: by 2002:a05:6402:3547:b0:582:7394:a83d with SMTP id 4fb4d7f45d1cf-5bbb3d0bb2bmr1900448a12.12.1723130819767; Thu, 08 Aug 2024 08:26:59 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2d3518dsm767942a12.78.2024.08.08.08.26.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:26:59 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 26/41] libmultipath: rename _dm_flush_map() to dm_flush_map__() Date: Thu, 8 Aug 2024 17:26:05 +0200 Message-ID: <20240808152620.93965-27-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 4 ++-- libmultipath/devmapper.h | 8 ++++---- libmultipath/libmultipath.version | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 0a4b586..c497c22 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -965,7 +965,7 @@ int mpath_in_use(const char *name) return 0; } -int _dm_flush_map (const char *mapname, int flags, int retries) +int dm_flush_map__ (const char *mapname, int flags, int retries) { int r; int queue_if_no_path = 0; @@ -1050,7 +1050,7 @@ dm_flush_map_nopaths(const char *mapname, int deferred_remove DR_UNUSED__) deferred_remove == DEFERRED_REMOVE_IN_PROGRESS) ? DMFL_DEFERRED : 0); #endif - return _dm_flush_map(mapname, flags, 0); + return dm_flush_map__(mapname, flags, 0); } int dm_flush_maps(int retries) diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index d9c08fd..ba05e0a 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -161,11 +161,11 @@ enum { DMFL_NO_FLUSH = 1 << 3, }; -int _dm_flush_map (const char *mapname, int flags, int retries); -#define dm_flush_map(mapname) _dm_flush_map(mapname, DMFL_NEED_SYNC, 0) -#define dm_flush_map_nosync(mapname) _dm_flush_map(mapname, DMFL_NONE, 0) +int dm_flush_map__ (const char *mapname, int flags, int retries); +#define dm_flush_map(mapname) dm_flush_map__(mapname, DMFL_NEED_SYNC, 0) +#define dm_flush_map_nosync(mapname) dm_flush_map__(mapname, DMFL_NONE, 0) #define dm_suspend_and_flush_map(mapname, retries) \ - _dm_flush_map(mapname, DMFL_NEED_SYNC|DMFL_SUSPEND, retries) + dm_flush_map__(mapname, DMFL_NEED_SYNC|DMFL_SUSPEND, retries) int dm_flush_map_nopaths(const char * mapname, int deferred_remove); int dm_cancel_deferred_remove(struct multipath *mpp); int dm_flush_maps (int retries); diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version index e6c6daf..f92f759 100644 --- a/libmultipath/libmultipath.version +++ b/libmultipath/libmultipath.version @@ -75,7 +75,7 @@ global: dm_enablegroup; dm_fail_path; dm_find_map_by_wwid; - _dm_flush_map; + dm_flush_map__; dm_flush_map_nopaths; dm_flush_maps; dm_geteventnr; From patchwork Thu Aug 8 15:26:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757826 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74EB419046C for ; Thu, 8 Aug 2024 15:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130825; cv=none; b=OIiPlaWaEA5zlLnU/VtTSoVk8zloTNcguDhXnlP39n+9hVeidJ376m+RoNSAxi2O81RVMj5cYeugo170q7WTQ0en3P0WxfaZ1uEXKvUw5xhbXs8gFgPMdlQH3JyTPMd2a8z4qFbqsQ4q+bjKLYuyfbMLM8wJskXBg3mvlUM3U3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130825; c=relaxed/simple; bh=K9HLXtorIyyAcjWhxoh3RZ5qgiFglnwsGwak9HpSm4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dXeN4xjQuZMDuiFPQJa0dyZ6bwsOSHTzq+fawkAFdYGq2p93OgxoYfxXx6S0FzEY58F/K4wwS5iX2Foj6dismSL+3mqP1WIipmthP41YwdpH3BlJSCu/OlDvxNSQBR3mWrowFHfHgtxIYohEuST7Yp+kN8xEsfT4wj07szY0uf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=DLYMebji; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DLYMebji" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52efba36802so1451799e87.2 for ; Thu, 08 Aug 2024 08:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130822; x=1723735622; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PzVNZqXichmiTFd/hQR3amRuWy98kwE/0BUtDYkLWjA=; b=DLYMebjiwePJrudgZXcQcFektaKNmFbsLpKNfLXVeagPA6lheKUkKcZ53QW3br0aW2 RN/2Qu9jiRG1kVVZ8cXM1CSeNLGqS4LKI6N711wzHmbe5ZVmycXRjUgg2qJgi3X0KU2A ONqLLHSsZ3O7Qz7Ud+0EOj7CqLZBq5whTpGTBRtstxv78DTvPez6oXELGGOSHS9KvZDA 57ItCGV2fLw0C8vI9uuTfSRPEYmUxURnphC0ClmxTcnQCwUovsza0M+rawNyHBb1spLG ODbQAz/thi9h49Lr92G+MgR+lxj+oXI8HO94bo1hbGFM/HNdiwZtD1Nvw45y+++q9BwW Yfgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130822; x=1723735622; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PzVNZqXichmiTFd/hQR3amRuWy98kwE/0BUtDYkLWjA=; b=vupbA0jqGJUpUYrF4Znp6STHoWtuvC3LW8VhuIsXqm15rx5ly+Ik2hyn8LTPOdfzRq bNX9CBAgSPfUE5Urb5Ke7CHPoVQhlIlwvX5CwDv+Njy6U8Jv/foKqUGilmgvqJjbney8 ypw3/WUTtKUjl4uxBS3FwjdZ9QxK+kQtVMZxTEddjarhYMKJnaAeHpnUWM0nOzRdy8r9 NiXOszryeidnsmmDiVwNGM/qSXIN3rOaWAaN0n4VmTm1Y1OyX1ou6b6cQcs082Q7+fg/ RL3DeD2h/2oqTdDqOxECDhrdzSUq4njggJdJMz2knOqvdGVqwMFQZx5J3qmekt/lVnjM 9hBA== X-Gm-Message-State: AOJu0YxBi31l21pdBV0xkuNbR8k/iMMVdSqim4gMmg5SzZ1tClBKb0g+ fF/W9cXErjBHh39LxL5x2Fk/DKc1+j7zTMqloApG3oYveGyn/F+5oD7CSPrKsM0= X-Google-Smtp-Source: AGHT+IFgyesIdR0e0vV+veQFaYWvaHmjJ7vRP5fRpTaaJGj6FhJmnG5Wbdt2qPCc5mThg9Gtq6hSIA== X-Received: by 2002:a05:6512:3e1a:b0:52b:9c8a:734f with SMTP id 2adb3069b0e04-530e588b62bmr1674490e87.50.1723130821225; Thu, 08 Aug 2024 08:27:01 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2c1fc20sm725708a12.26.2024.08.08.08.27.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:01 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 27/41] libmultipath: foreign: rename _check() to check__() Date: Thu, 8 Aug 2024 17:26:06 +0200 Message-ID: <20240808152620.93965-28-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/foreign/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index 9b26764..40b88f7 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@ -891,7 +891,7 @@ int delete(struct context *ctx, struct udev_device *ud) return rc; } -void _check(struct context *ctx) +void check__(struct context *ctx) { struct gen_multipath *gm; int i; @@ -908,7 +908,7 @@ void check(struct context *ctx) condlog(4, "%s called for \"%s\"", __func__, THIS); lock(ctx); pthread_cleanup_push(unlock, ctx); - _check(ctx); + check__(ctx); pthread_cleanup_pop(1); return; } From patchwork Thu Aug 8 15:26:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757827 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34EFE19047A for ; Thu, 8 Aug 2024 15:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130826; cv=none; b=cYRPlJS0QTmaMG+1avS6+7jvI2PvdPIj+2ZSJjza6OzLJEkSt6RKnuxLHQQCW+ChScRRVxNmHffPvs26TOMbKpH/J4jiGVFNGLJYyyhJEq6Vh3qkVTJqCUiJVKkznxMfhHIql0gh+tHFIbLFRlDBCObsnKLKPUjO8vhNBAWSCNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130826; c=relaxed/simple; bh=U6/9sLjbgduDGLMiK+4pq97jFMOBkVzT/b6K+Ka2txk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q+jgG+7imv6C9ti4wOpUu0duvxpegN4GlLNcqB07aGy7N+tfYxKYjNc/CkQitfOsdpuWrFV3jCPpKXoLUAgCc+xAr983r15KwvpwAD9z+9hOmj6IFyAVoszbezHcKAfLCDzLYq6vGTvSfFUYKSPMuHFIj/D8OWQM9pCjib+5s/k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=fcKfamPE; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="fcKfamPE" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a7ab76558a9so166416966b.1 for ; Thu, 08 Aug 2024 08:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130822; x=1723735622; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Si9FSarNrsIrF9LJFUeb3R9ppHt6Z4HgOoqYsocg2gE=; b=fcKfamPEYRDyFiF8W2jXH0+3HWHvhhTry1xs5+IUUSyNdCTU4nesInVmVJhd5FujZV iSh5fFXGpt3b51/ozy7RpzJrJYyDYnD4Kpf7dNyV5xi00cxGQOwYTK/6uQwWetMwfjjg sOMfCCMGp1gftYACYWKhWoEcnlv3tim9y5kf41VadfFSeeujpa2hFPtiAtY1HJz2RFct LqVq9SXj62CwcP/pu+R9pXUq7y1Q0iGiwbYWUp0NG4D71Ssbr2tQ7kdhqnk+8ahKpSbk EM5+eNOLJzeVxvlicDpC2XfIxnUDTNwhi3OPjtCKrBHOHn0M+QAIrfm2BwtPMK+28aZa c0fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130822; x=1723735622; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Si9FSarNrsIrF9LJFUeb3R9ppHt6Z4HgOoqYsocg2gE=; b=rKIoQRM0dMeLg46ACg2FwQ6usmDi/lICfqgaxD4N5uhP/YZv9kUI90WsR1nDvN0YoO SouVT564nglAEqbeMBon6JxJ9eZo6KZA9ZNtaMvTZM0tZPvkJquKC+2aIBhWJYbYi/sC KCukZCtEaxZ1L7oOK5ShWL0AFyYYiL+5/+UEuf5sCJjeI7ydWrRNImSGQ1yUwd3zCkfM 4W+WNkhOJbsNRPD75XQKAVFQkd48J8YzoRop78RTCcUKDXMNZ02XfOOZhRUlTUCQH6tR PRHAFUbf0gYlOMdPd6Rtvkb7zoN0P6ju3r4AABT/SCcR0+JcJwEf/REpsnAib92oCUkg GukA== X-Gm-Message-State: AOJu0YyJKpfKaHG9adScqFPBSTdc8LwmSXQ/vnGJ3cKXwDYHeZSvnHPf tO4DtstEHD9gLIwwsBiRh9mPu+MitsO8DLB02bQAqjcbfrCRrgDCkTVCZvD6/wiCF0BZ1VopP/E CbKQ= X-Google-Smtp-Source: AGHT+IGTp3VMmUslrrPreS4xy1gci5rI7IpgJC2DHoJmzXsUbNwwLhnz8zaSP4Zs5Q+R+rdSUF/OCg== X-Received: by 2002:a17:907:d843:b0:a7a:a557:454e with SMTP id a640c23a62f3a-a8091ed389fmr201441666b.2.1723130822286; Thu, 08 Aug 2024 08:27:02 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0cca0sm751327466b.64.2024.08.08.08.27.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:02 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 28/41] libmultipath: rename _cleanup_foreign() Date: Thu, 8 Aug 2024 17:26:07 +0200 Message-ID: <20240808152620.93965-29-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/foreign.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index 2a42df5..5ec2d0b 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -84,7 +84,7 @@ static void free_foreign(struct foreign *fgn) free(fgn); } -void _cleanup_foreign(void) +void cleanup_foreign__(void) { struct foreign *fgn; int i; @@ -103,7 +103,7 @@ void _cleanup_foreign(void) void cleanup_foreign(void) { wrlock_foreigns(); - _cleanup_foreign(); + cleanup_foreign__(); unlock_foreigns(NULL); } @@ -164,7 +164,7 @@ static int _init_foreign(const char *enable) r = -errno; condlog(1, "%s: error scanning foreign multipath libraries: %m", __func__); - _cleanup_foreign(); + cleanup_foreign__(); goto out_free_pre; } From patchwork Thu Aug 8 15:26:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757828 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 733A1190496 for ; Thu, 8 Aug 2024 15:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130827; cv=none; b=StQnz32u93Rg49dyTk7vzy9poVuFeHWcMLziCEXkxll5abNGQSyU+5o4iyVysToDiqhIHdNOPQzk6lwxcR3E0jdK2KtHHYwTUYL02ag+AtRk5gwrjmSwFFtbQ5qzbEpcp3C+AW+TGNDorKsk0jFYU31Rn4bv23F9q1tv6JBZYJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130827; c=relaxed/simple; bh=PcutuV9sz5YtjKCa0x2seiyTjzDv6DIDETTcNWXqq08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fr/jdMsj/upmW5KjCJfLVoH7WmHtiUtcaUXvkqfKCF+ZCAp70O+qLvIaIfcDPJZpsXfNilS32oxbFBfcJDjSH/hpwgKn2t1UpZ38ctDZN8vs/KoAELIhg9PrseHm99Yz4nAYpcwAA9ZGU0vcLo/0y3aEdPuEVA1LxNem21zam2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=OFzHTzoo; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="OFzHTzoo" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a7a9a7af0d0so138534966b.3 for ; Thu, 08 Aug 2024 08:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130824; x=1723735624; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=htcux0/wSrySG9BnaIiMFLDdx3wbC4yP7Itv73hPvNc=; b=OFzHTzooMZn7gYeaCdqiwymNUK37vzHV/R6qlqDqBkuaEOxy82KinIAzLXLNWIvr8E 5FcT1lqEe7DdkEf1KfP/XdfJp84HWuxCSsFTFEEeJeEEO2FLdNn9nx4dawxVxoXhQPHM qRFVqQNKcQ2/sf91wntRm8hPoN8QgCXHxSoRmqxR8wKSyi428i13bNB+5f3pbA7/TG3a FcweLfpRKbbzcYRzxLyAAI8QV6rYL2nAclC3lktcU3Tc3/T0zl0PQ1gxy9liYYu0QUNt cdj//lnlD0UmBDGUqGwTduvLyfhmeTFXLuQjAn/CuaFdBojV5mS0RNmahJbMb6Jy3F5H de7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130824; x=1723735624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=htcux0/wSrySG9BnaIiMFLDdx3wbC4yP7Itv73hPvNc=; b=SovocmltQ+/1liES1X+H+vItV4lw1Cq90QvUTYhKYu6yfgQkWeJFJJ44R23zO6/cPt AU2+A+JYYW92d4tz0H5se8KB3yqyby+s1UzoESKDH35eZQwvDUSav9ulp58ORANZq4pq P2nzJkWLbXxRhksqeOwPPtxSS4uvqhZlbrYaswg7d6Yd6fBqPlhjBqjMRnZWs4TYiUcl TMDQHDH8GoEd0S1WVp+aEnc41fruqb7rI/45CQiTCuAhK4ZWSrQ0wUnggcaPEyVZFG9I pmVUR4J3bVn33YI329xta4UyC1ckfW8DpfEXupvA9Z3/0IN6yMOyUQXf4FqLNebGyHXj pbrQ== X-Gm-Message-State: AOJu0YwUXlnDoQRjtSb3oVA/HIC2G5eJb0IU6M1Tg9Es8Dst0vQTITc+ mfnCPAqZCmkj9mgfYJIt2/uA/HE32FztM2a1c6dqc1LhrIh43tHk9sWgX0oxaB4= X-Google-Smtp-Source: AGHT+IEZUEsjLUdbWUQU+8b64llVNEUmXR2n7xj4zPLa8VGvVZQzsPrCksN2wVJ9ASMOuhQiyMC4ug== X-Received: by 2002:a17:907:f71f:b0:a7d:340e:43a4 with SMTP id a640c23a62f3a-a8090da5fc3mr164443166b.31.1723130823621; Thu, 08 Aug 2024 08:27:03 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9bc4230sm753344966b.32.2024.08.08.08.27.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:03 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 29/41] libmultipath: rename _init_config() Date: Thu, 8 Aug 2024 17:26:08 +0200 Message-ID: <20240808152620.93965-30-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 34cbb43..b742fb4 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -879,25 +879,25 @@ static void set_max_checkint_from_watchdog(struct config *conf) } #endif -static int _init_config (const char *file, struct config *conf); +static int init_config__ (const char *file, struct config *conf); int init_config(const char *file) { - return _init_config(file, &internal_config); + return init_config__(file, &internal_config); } struct config *load_config(const char *file) { struct config *conf = alloc_config(); - if (conf && !_init_config(file, conf)) + if (conf && !init_config__(file, conf)) return conf; free(conf); return NULL; } -int _init_config (const char *file, struct config *conf) +int init_config__ (const char *file, struct config *conf) { if (!conf) From patchwork Thu Aug 8 15:26:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757829 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA27119047B for ; Thu, 8 Aug 2024 15:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130829; cv=none; b=KEWAi+7VgnRioyrNf0lga5cw/oN9vhZwKwguj3SrWU120Du16QXEg9XXNWWBZ55GPGxnu6f5W2XwlohfmL834yYIM7rqK15xJgoHpAD7+3B8280caQqfjm9dxx9c0ylme4TC4+lQ9QcR2WH7vfUnob1SaUqnXyt8sah39+LQuUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130829; c=relaxed/simple; bh=rax+MGScDV6VlPXOTydRWv04YdV7KbTZrkstO5mo/7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uLzhOTOqNzzPuBBwmDPl/0wbVGuh2MohAtHaHAWWclk6ofYPJYNwMcgwJkZw2p3DFEiA6N+63w3abu0VxPqCRxCfULs9EkfXz+4wG5gDTk3M7n44H518PIGRquwjWLp1KatlOYtOPO7LHaQKiS2HrwYimKIj6y3Oo/02sPz5PZE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=EM3eSwjW; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="EM3eSwjW" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52efd8807aaso1251452e87.3 for ; Thu, 08 Aug 2024 08:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130825; x=1723735625; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q0+TMzyITHM/uvpQoCp/tFTLqXVrNZsgRyiVa7oxJbw=; b=EM3eSwjW17qc4SKlvS6g6F/vxg0nCMlemKVINlg6bD218tmbzX7+N3pg3cz8Y+dSS4 CAUICrt+Fnlot6rhnyPf6Kd5J06ticFiT++i6OP/UGlmTO0oMa/Eov8W/VAKum9FVlXc SYOHpuIK2PjbOxWVBfKhtv3a+JNvelAnp2xsGjYjtGgeERVw07AG+YiAod5zlBQ/WD88 i+IKppTg2Pjz4M7t5+PImqKxYaxmmXvHwX2LIfiO317wBiZBrCWvG01Q0p7hxRa/GeiV yKc3s/Nn2eR22vHz94CIS1L/nZjbW6usCXx+n5Moqcft7o8632r8GsMP7iwvsrSmWaoO x4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130825; x=1723735625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q0+TMzyITHM/uvpQoCp/tFTLqXVrNZsgRyiVa7oxJbw=; b=AvEw2UP5qP+2FjC2kNWBhKTO+gqzUaEtrrPiX0LW7UoHDvhdknIUH8EYIg/ZVjuKh4 12UObLeutSHGXc54x0fwNlW4jrS/MxoNbJEJM7uoglne3NzyHZeubFlOnBVhiPx462JS Suoi6Jqpcm6X6JnTuukJh8/XiqaYYRKojd/KxhfGoGs7Vn8kpfPj1GBOn+JOIZdqqpGN 6nrCCPE/9pE6o3jXQADI9cn42ca6Ot+3eKNnmupv0JLrq7PLjVXKUDatyU8yGvcfT44s o5WMv3tRdvSDfhh8rt9c525yUUmgkYnuPRilLXPlP11Rkcz9KQoke7QmRHKWoXp2Mbs6 43fA== X-Gm-Message-State: AOJu0Yza7LlmYM/rAFvqatnelx20a6bMcx/IDUgoc0tM5dzCGz9bihMx 1QOvCizGaXmlxr+5N6hvxvXnP2/e7jfnUiFMzlN08qoqjbkxAofri7z0s6VNlT0= X-Google-Smtp-Source: AGHT+IHMoqvsbkeb0niX5qq/X03KVuaAph2Nt+vY2wfPIXKcdOwmOYTwTyvzvN8x4Ko3e1fmMPriXQ== X-Received: by 2002:a05:6512:39cd:b0:52f:228:cf80 with SMTP id 2adb3069b0e04-530e58afe6dmr1803984e87.40.1723130824674; Thu, 08 Aug 2024 08:27:04 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ec7173sm747338466b.204.2024.08.08.08.27.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:04 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 30/41] libmultipath: rename symbols starting with underscore in print.h Date: Thu, 8 Aug 2024 17:26:09 +0200 Message-ID: <20240808152620.93965-31-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/foreign.c | 12 +++++------ libmultipath/foreign.h | 2 +- libmultipath/libmultipath.version | 8 ++++---- libmultipath/print.c | 34 +++++++++++++++---------------- libmultipath/print.h | 20 +++++++++--------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index 5ec2d0b..d23439e 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -458,7 +458,7 @@ void foreign_path_layout(fieldwidth_t *width) vec = fgn->get_paths(fgn->context); if (vec != NULL) { - _get_path_layout(vec, LAYOUT_RESET_NOT, width); + get_path_layout__(vec, LAYOUT_RESET_NOT, width); } fgn->release_paths(fgn->context, vec); @@ -489,7 +489,7 @@ void foreign_multipath_layout(fieldwidth_t *width) vec = fgn->get_multipaths(fgn->context); if (vec != NULL) { - _get_multipath_layout(vec, LAYOUT_RESET_NOT, width); + get_multipath_layout__(vec, LAYOUT_RESET_NOT, width); } fgn->release_multipaths(fgn->context, vec); @@ -517,7 +517,7 @@ static int snprint_foreign_topology__(struct strbuf *buf, int verbosity, vec = fgn->get_multipaths(fgn->context); if (vec != NULL) { vector_foreach_slot(vec, gm, j) { - if (_snprint_multipath_topology( + if (snprint_multipath_topology__( gm, buf, verbosity, width) < 0) break; } @@ -566,7 +566,7 @@ void print_foreign_topology(int verbosity) fgn->lock(fgn->context); pthread_cleanup_push(fgn->unlock, fgn->context); vec = fgn->get_paths(fgn->context); - _get_multipath_layout(vec, LAYOUT_RESET_NOT, width); + get_multipath_layout__(vec, LAYOUT_RESET_NOT, width); fgn->release_paths(fgn->context, vec); pthread_cleanup_pop(1); } @@ -600,7 +600,7 @@ int snprint_foreign_paths(struct strbuf *buf, const char *style, vec = fgn->get_paths(fgn->context); if (vec != NULL) { vector_foreach_slot(vec, gp, j) { - ret = _snprint_path(gp, buf, style, width); + ret = snprint_path__(gp, buf, style, width); if (ret < 0) break; } @@ -640,7 +640,7 @@ int snprint_foreign_multipaths(struct strbuf *buf, const char *style, vec = fgn->get_multipaths(fgn->context); if (vec != NULL) { vector_foreach_slot(vec, gm, j) { - ret = _snprint_multipath(gm, buf, + ret = snprint_multipath__(gm, buf, style, width); if (ret < 0) break; diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h index f3bc1b2..809824d 100644 --- a/libmultipath/foreign.h +++ b/libmultipath/foreign.h @@ -271,7 +271,7 @@ void foreign_multipath_layout(fieldwidth_t *width); * '\0' - terminated. * @param buf: output buffer * @param verbosity: verbosity level - * @param width: an array of field widths, initialized by _get_path_layout() + * @param width: an array of field widths, initialized by get_path_layout__() * @returns: number of printed characters excluding trailing '\0'. */ int snprint_foreign_topology(struct strbuf *buf, int verbosity, diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version index f92f759..21d48da 100644 --- a/libmultipath/libmultipath.version +++ b/libmultipath/libmultipath.version @@ -149,7 +149,7 @@ global: path_offline; print_all_paths; print_foreign_topology; - _print_multipath_topology; + print_multipath_topology__; reinstate_paths; remember_wwid; remove_feature; @@ -179,12 +179,12 @@ global: snprint_foreign_multipaths; snprint_foreign_paths; snprint_foreign_topology; - _snprint_multipath; + snprint_multipath__; snprint_multipath_header; snprint_multipath_map_json; - _snprint_multipath_topology; + snprint_multipath_topology__; snprint_multipath_topology_json; - _snprint_path; + snprint_path__; snprint_path_header; snprint_status; snprint_wildcards; diff --git a/libmultipath/print.c b/libmultipath/print.c index b8868ea..190c823 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -924,7 +924,7 @@ void get_path_layout(vector pathvec, int header, fieldwidth_t *width) { vector gpvec = vector_convert(NULL, pathvec, struct path, dm_path_to_gen); - _get_path_layout(gpvec, + get_path_layout__(gpvec, header ? LAYOUT_RESET_HEADER : LAYOUT_RESET_ZERO, width); vector_free(gpvec); @@ -946,7 +946,7 @@ reset_width(fieldwidth_t *width, enum layout_reset reset, const char *header) } } -void _get_path_layout (const struct _vector *gpvec, enum layout_reset reset, +void get_path_layout__ (const struct _vector *gpvec, enum layout_reset reset, fieldwidth_t *width) { unsigned int i, j; @@ -980,14 +980,14 @@ fieldwidth_t *alloc_multipath_layout(void) { void get_multipath_layout (vector mpvec, int header, fieldwidth_t *width) { vector gmvec = vector_convert(NULL, mpvec, struct multipath, dm_multipath_to_gen); - _get_multipath_layout(gmvec, + get_multipath_layout__(gmvec, header ? LAYOUT_RESET_HEADER : LAYOUT_RESET_ZERO, width); vector_free(gmvec); } void -_get_multipath_layout (const struct _vector *gmvec, enum layout_reset reset, +get_multipath_layout__ (const struct _vector *gmvec, enum layout_reset reset, fieldwidth_t *width) { unsigned int i, j; @@ -1110,7 +1110,7 @@ int snprint_multipath_header(struct strbuf *line, const char *format, return get_strbuf_len(line) - initial_len; } -int _snprint_multipath(const struct gen_multipath *gmp, +int snprint_multipath__(const struct gen_multipath *gmp, struct strbuf *line, const char *format, const fieldwidth_t *width) { @@ -1171,7 +1171,7 @@ int snprint_path_header(struct strbuf *line, const char *format, return get_strbuf_len(line) - initial_len; } -int _snprint_path(const struct gen_path *gp, struct strbuf *line, +int snprint_path__(const struct gen_path *gp, struct strbuf *line, const char *format, const fieldwidth_t *width) { int initial_len = get_strbuf_len(line); @@ -1200,7 +1200,7 @@ int _snprint_path(const struct gen_path *gp, struct strbuf *line, return get_strbuf_len(line) - initial_len; } -int _snprint_pathgroup(const struct gen_pathgroup *ggp, struct strbuf *line, +int snprint_pathgroup__(const struct gen_pathgroup *ggp, struct strbuf *line, const char *format) { int initial_len = get_strbuf_len(line); @@ -1223,9 +1223,9 @@ int _snprint_pathgroup(const struct gen_pathgroup *ggp, struct strbuf *line, } #define snprint_pathgroup(line, fmt, pgp) \ - _snprint_pathgroup(dm_pathgroup_to_gen(pgp), line, fmt) + snprint_pathgroup__(dm_pathgroup_to_gen(pgp), line, fmt) -void _print_multipath_topology(const struct gen_multipath *gmp, int verbosity) +void print_multipath_topology__(const struct gen_multipath *gmp, int verbosity) { STRBUF_ON_STACK(buff); fieldwidth_t *p_width __attribute__((cleanup(cleanup_ucharp))) = NULL; @@ -1241,13 +1241,13 @@ void _print_multipath_topology(const struct gen_multipath *gmp, int verbosity) pathvec = gpg->ops->get_paths(gpg); if (pathvec == NULL) continue; - _get_path_layout(pathvec, LAYOUT_RESET_NOT, p_width); + get_path_layout__(pathvec, LAYOUT_RESET_NOT, p_width); gpg->ops->rel_paths(gpg, pathvec); } gmp->ops->rel_pathgroups(gmp, pgvec); } - _snprint_multipath_topology(gmp, &buff, verbosity, p_width); + snprint_multipath_topology__(gmp, &buff, verbosity, p_width); printf("%s", get_strbuf_str(&buff)); } @@ -1266,7 +1266,7 @@ int snprint_multipath_style(const struct gen_multipath *gmp, need_wwid ? " (%w)" : "", " %d %s"); } -int _snprint_multipath_topology(const struct gen_multipath *gmp, +int snprint_multipath_topology__(const struct gen_multipath *gmp, struct strbuf *buff, int verbosity, const fieldwidth_t *p_width) { @@ -1284,7 +1284,7 @@ int _snprint_multipath_topology(const struct gen_multipath *gmp, return -ENOMEM; if (verbosity == 1) - return _snprint_multipath(gmp, buff, "%n", width); + return snprint_multipath__(gmp, buff, "%n", width); if(isatty(1) && (rc = print_strbuf(&style, "%c[%dm", 0x1B, 1)) < 0) /* bold on */ @@ -1295,8 +1295,8 @@ int _snprint_multipath_topology(const struct gen_multipath *gmp, (rc = print_strbuf(&style, "%c[%dm", 0x1B, 0)) < 0) /* bold off */ return rc; - if ((rc = _snprint_multipath(gmp, buff, get_strbuf_str(&style), width)) < 0 - || (rc = _snprint_multipath(gmp, buff, PRINT_MAP_PROPS, width)) < 0) + if ((rc = snprint_multipath__(gmp, buff, get_strbuf_str(&style), width)) < 0 + || (rc = snprint_multipath__(gmp, buff, PRINT_MAP_PROPS, width)) < 0) return rc; pgvec = gmp->ops->get_pathgroups(gmp); @@ -1310,7 +1310,7 @@ int _snprint_multipath_topology(const struct gen_multipath *gmp, if ((rc = print_strbuf(buff, "%c-+- ", last_group ? '`' : '|')) < 0 || - (rc = _snprint_pathgroup(gpg, buff, PRINT_PG_INDENT)) < 0) + (rc = snprint_pathgroup__(gpg, buff, PRINT_PG_INDENT)) < 0) return rc; pathvec = gpg->ops->get_paths(gpg); @@ -1322,7 +1322,7 @@ int _snprint_multipath_topology(const struct gen_multipath *gmp, last_group ? ' ' : '|', i + 1 == VECTOR_SIZE(pathvec) ? '`': '|')) < 0 || - (rc = _snprint_path(gp, buff, + (rc = snprint_path__(gp, buff, PRINT_PATH_INDENT, p_width)) < 0) return rc; } diff --git a/libmultipath/print.h b/libmultipath/print.h index 4dd2ef2..9c2aea4 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -17,28 +17,28 @@ enum layout_reset { /* fieldwidth_t is defined in generic.h */ fieldwidth_t *alloc_path_layout(void); -void _get_path_layout (const struct _vector *gpvec, enum layout_reset, +void get_path_layout__ (const struct _vector *gpvec, enum layout_reset, fieldwidth_t *width); void get_path_layout (vector pathvec, int header, fieldwidth_t *width); fieldwidth_t *alloc_multipath_layout(void); -void _get_multipath_layout (const struct _vector *gmvec, enum layout_reset, +void get_multipath_layout__ (const struct _vector *gmvec, enum layout_reset, fieldwidth_t *width); void get_multipath_layout (vector mpvec, int header, fieldwidth_t *width); int snprint_path_header(struct strbuf *, const char *, const fieldwidth_t *); int snprint_multipath_header(struct strbuf *, const char *, const fieldwidth_t *); -int _snprint_path (const struct gen_path *, struct strbuf *, const char *, +int snprint_path__ (const struct gen_path *, struct strbuf *, const char *, const fieldwidth_t *); #define snprint_path(buf, fmt, pp, w) \ - _snprint_path(dm_path_to_gen(pp), buf, fmt, w) -int _snprint_multipath (const struct gen_multipath *, struct strbuf *, + snprint_path__(dm_path_to_gen(pp), buf, fmt, w) +int snprint_multipath__ (const struct gen_multipath *, struct strbuf *, const char *, const fieldwidth_t *); #define snprint_multipath(buf, fmt, mp, w) \ - _snprint_multipath(dm_multipath_to_gen(mp), buf, fmt, w) -int _snprint_multipath_topology (const struct gen_multipath *, struct strbuf *, + snprint_multipath__(dm_multipath_to_gen(mp), buf, fmt, w) +int snprint_multipath_topology__ (const struct gen_multipath *, struct strbuf *, int verbosity, const fieldwidth_t *); #define snprint_multipath_topology(buf, mpp, v, w) \ - _snprint_multipath_topology (dm_multipath_to_gen(mpp), buf, v, w) + snprint_multipath_topology__ (dm_multipath_to_gen(mpp), buf, v, w) int snprint_multipath_topology_json(struct strbuf *, const struct vectors *vecs); int snprint_config__(const struct config *conf, struct strbuf *buff, const struct _vector *hwtable, const struct _vector *mpvec); @@ -58,10 +58,10 @@ int snprint_tgt_wwpn(struct strbuf *, const struct path *); #define PROTOCOL_BUF_SIZE sizeof("scsi:unspec") int snprint_path_protocol(struct strbuf *, const struct path *); -void _print_multipath_topology (const struct gen_multipath * gmp, +void print_multipath_topology__ (const struct gen_multipath * gmp, int verbosity); #define print_multipath_topology(mpp, v) \ - _print_multipath_topology(dm_multipath_to_gen(mpp), v) + print_multipath_topology__(dm_multipath_to_gen(mpp), v) void print_all_paths (vector pathvec, int banner); From patchwork Thu Aug 8 15:26:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757830 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C8BC19049E for ; Thu, 8 Aug 2024 15:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130829; cv=none; b=PGgw1+PhFY8xjeB1Zo8Qu5ZYwVnPzNy6izK722A8NUrEOHz7fZgDXtFQB1Hi4YHgeM76tgZim36myzueJlU2yPbxPqBKlVQ4FosPWympr+u54PQxUJ58rHk1aDOKNleZguLbq+Sij4dl/Y1UX6oSDJwHwiswVdxx0fBGyorlwoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130829; c=relaxed/simple; bh=RBZENBhEOZn2aypmo3EIll4pjz3OgDpjP7jPkRbSzSY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OZ+FXXO1Fjhg1lVUp7K34O+Yg/bENNXuCFsfScDJtl2UPcdo3TpQ9NkIw1VWt97PDSczTb10Nz4mFANB69dD4qJzbc+qJOCtBw3HzInu6d8HyKJDPADyKLyut76xZoxtgMfikj7Bztjg6qrlu5kfyH2gmMtciAkSbzIgcPNdylY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=KO5iwTov; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="KO5iwTov" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5a79df5af51so3319408a12.0 for ; Thu, 08 Aug 2024 08:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130826; x=1723735626; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qqv0EfF+RgG/HZJTMIyd6xkVgeZiuOYgYYOXbs60qnU=; b=KO5iwTovnNz0bf8w2i/dTfzLcjl1FJ0M08wHoCEVuOuX1jYDxyh0CCX38T+V41aJuI WNsQsDibIRY9hLmstj6rJtIWHQYHRjoSG0gT3TwpEN1ujjcociFH+sxIpeOA2mNVwplv KrZMvch4GWgzM1AF9pa0wgM0ghuvQGZxci/ykb/Qu10QuNNoRFHkrVbXdmdBKgu/uo3J oWo/jlb6ULWGY5lHx+j6wfT4wAlv5oaPnE8QiCAyAjs5m727Jq3J/pcPrEnEf2VoFi+3 Y7J/CenUdBeNktFWlfwR0NaRnY/gKCplfGv9ION7lIwM80YrwXxC23rWi+wL4veNURp8 u+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130826; x=1723735626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qqv0EfF+RgG/HZJTMIyd6xkVgeZiuOYgYYOXbs60qnU=; b=SDQppAdcyZuMGKm7myEfs9tW6c1S+CyAOrRc4xgRExxiQ0eHfNk9J2J5aZc8R5mSMu gJlwRMm8pGV1kgOe3hfDcm5WcBQy8Q/nO+jhmeLun9OfK/meWWD3L1IELKqWW9pL7y5c 11Jf/MPIL9n//zADY+/ZVLm4v/12bLXFglSTdCRaiqbHVwxtqs6NV/8ZlLEUc/2evbst jnD1vN394Kcpqi57ruoo6GreeGv7iG10Ff4YPQ7ENA2MfThDGIize5gxxWYOGFB4L6iD 3kAOCoGTacR+lOGDcOUsIFUVb3h6JR5xtFz9XEEudPP1ZXUap4LoeWJ8I4kgC0/nzyAs C2Ng== X-Gm-Message-State: AOJu0YwNPqJqggrQWhsJy5oQTiROMxvWSNaB7ui+2iMv4L64TZXWDtLE ll8F+z5zKEd2sRUQnVjChvkOX4amlUO6QGqmOMxmnbSfIpMOQY75j0770fXQ7Hc= X-Google-Smtp-Source: AGHT+IHdGP02BDzOL67ragK8Vdk5ft7tzKcU1vhl1jZGo2EH2+9beAsGwuRUnhJKOsOPVbvj7GXGyQ== X-Received: by 2002:a17:907:c888:b0:a7d:89ac:9539 with SMTP id a640c23a62f3a-a8091ec7f4bmr173210766b.7.1723130825708; Thu, 08 Aug 2024 08:27:05 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0cae0sm749198266b.56.2024.08.08.08.27.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:05 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 31/41] libmultipath: remove dead code in pgpolicies.h Date: Thu, 8 Aug 2024 17:26:10 +0200 Message-ID: <20240808152620.93965-32-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libmultipath/pgpolicies.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libmultipath/pgpolicies.h b/libmultipath/pgpolicies.h index 4469f8b..c1983e1 100644 --- a/libmultipath/pgpolicies.h +++ b/libmultipath/pgpolicies.h @@ -1,12 +1,6 @@ #ifndef PGPOLICIES_H_INCLUDED #define PGPOLICIES_H_INCLUDED -#if 0 -#ifndef _MAIN_H -#include "main.h" -#endif -#endif - #define POLICY_NAME_SIZE 32 /* Storage controllers capabilities */ From patchwork Thu Aug 8 15:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757831 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18D2E19046C for ; Thu, 8 Aug 2024 15:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130830; cv=none; b=pIwN8KqyOuB0zfyVY30TT44ium4IsEPPiVHvfyVFwcMAxxWVfzApWvfwQCtF70K9N4PCmvrWSRjsALVElDeh6CY8B2XxQJUmOSXZ+YDsAPFnqbeWCpVTl5ia+7ETuAdpHZrmtNOcNWfLEX5pcLASFI9ytLve9SfaeO85mQL0wso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130830; c=relaxed/simple; bh=U1N23bLhZ8Q/cU5ry7kDQKb2YMEjjn8f+5ivTrR3AC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DFY5wdq4CorhGo6dHg0Ufls48qMcE1AzwTl56Wa2Ecr9UWI3TowbaMwV8idBAqgoy1BO4nUoh9U0nnCe3pCetXLNZxUZTMD5r4/jlHtRuJ1Lrd8peQ7OLZN3WCyxoP0fD5WNAA92Wi/gTZ9xSd8Ll/zeaqZbL+xO0r9k1rwx7AY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Vq3/AJaL; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Vq3/AJaL" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a7a9a369055so111378066b.3 for ; Thu, 08 Aug 2024 08:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130827; x=1723735627; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MbGYQx5ZtiHFGUqnXY26+MQ5M/tCOwsS5KJP9foxsPc=; b=Vq3/AJaLEZjD6QEG4vFrVWn9Z0zmWlYqJondC6wNj7aYy0YCvX6597aw73rzTvzNgw kHqTF9rKwAZKki4RV7AHKKIjQf9crEnl5WSOcFZeVEqTxpufPspBA8v4K3LI7hVlyqdJ Y5XPKNlrvkTHR31qGYO16tTUQj+YwAwFbQGi58CwZQyLzObbDjH+6RIuLWvvDsmCZaK+ dyVAgGi9NhKAN/E5mMh0SoDnIv5Gpnqnk5qF9RpntWqItj05SN8tfbiVafGMQC5CTQvz zpZMM1Mslq9q8oxvE90Ze1FJ6e+fXsJxD9/F3NLKGw8Jyhx/7VW9mtzzTWoBlvgKqpp4 OtSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130827; x=1723735627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MbGYQx5ZtiHFGUqnXY26+MQ5M/tCOwsS5KJP9foxsPc=; b=cakHynpL70trcDzPOFlUCydNb8qd5iqpPSCIxZSNUF/1dOoPhe6f5e6gFj3YHfxJEb 2usc6L5p6Z5c2lA3DURgHqV7YrsVj6wBJQSja724hiCXJ93AIqvBY0dtwkYXyjqNDTGp uVsmZQCXwex0dLhcrj9FLVcaEhwEfabo4unJiQmgbXiCLzCpO9H8to7VVk9Y87fUZlLs RJ0QDboIZBs08Zvxb4FmuisgZqzyqVy9sdTIRHm8/vo0P+OQpb45bNIt8n8WrjZ/YbZW y3yE9QyZaUuAQxvsBniDWL+rSa3lHGzhU2477kFuQpbLl0sC/k46M6HnERlj8WYBQDQ5 vu+A== X-Gm-Message-State: AOJu0Ywz9TOU56AWp285Z51VM8Dto5d0vemDN0PLuVndUfI1dNVLtI2z A9UGHZ3D2ELvCgTrWfAP6pb2LedImT5NqvSWPfF6lZmlj/WsC++yS6WyXXr2dSk= X-Google-Smtp-Source: AGHT+IFQG4pWsuy0786BrZTGLzSZYuMyeW/PZ84swBaDiSvf0BUEpRjVYJwzPoLaRc6Ue/VU8NV3DA== X-Received: by 2002:a17:907:f14b:b0:a7a:b385:37c5 with SMTP id a640c23a62f3a-a8090c66787mr147639166b.17.1723130827119; Thu, 08 Aug 2024 08:27:07 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7de8afba6asm607006766b.66.2024.08.08.08.27.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:06 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 32/41] libmultipath: remove struct and union names in cciss.h Date: Thu, 8 Aug 2024 17:26:11 +0200 Message-ID: <20240808152620.93965-33-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Only the typedef names are used in the rest of the code, so we don't need these struct names. Signed-off-by: Martin Wilck --- libmultipath/checkers/cciss.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libmultipath/checkers/cciss.h b/libmultipath/checkers/cciss.h index bdb1184..19450c2 100644 --- a/libmultipath/checkers/cciss.h +++ b/libmultipath/checkers/cciss.h @@ -42,7 +42,7 @@ #pragma pack(1) //Command List Structure -typedef union _SCSI3Addr_struct { +typedef union { struct { BYTE Dev; BYTE Bus:6; @@ -61,27 +61,27 @@ typedef union _SCSI3Addr_struct { } LogUnit; } SCSI3Addr_struct; -typedef struct _PhysDevAddr_struct { +typedef struct { DWORD TargetId:24; DWORD Bus:6; DWORD Mode:2; SCSI3Addr_struct Target[2]; //2 level target device addr } PhysDevAddr_struct; -typedef struct _LogDevAddr_struct { +typedef struct { DWORD VolId:30; DWORD Mode:2; BYTE reserved[4]; } LogDevAddr_struct; -typedef union _LUNAddr_struct { +typedef union { BYTE LunAddrBytes[8]; SCSI3Addr_struct SCSI3Lun[4]; PhysDevAddr_struct PhysDev; LogDevAddr_struct LogDev; } LUNAddr_struct; -typedef struct _RequestBlock_struct { +typedef struct { BYTE CDBLen; struct { BYTE Type:3; @@ -92,7 +92,7 @@ typedef struct _RequestBlock_struct { BYTE CDB[16]; } RequestBlock_struct; -typedef union _MoreErrInfo_struct{ +typedef union { struct { BYTE Reserved[3]; BYTE Type; @@ -106,7 +106,7 @@ typedef union _MoreErrInfo_struct{ } Invalid_Cmd; } MoreErrInfo_struct; -typedef struct _ErrorInfo_struct { +typedef struct { BYTE ScsiStatus; BYTE SenseLen; HWORD CommandStatus; @@ -117,7 +117,7 @@ typedef struct _ErrorInfo_struct { #pragma pack() -typedef struct _IOCTL_Command_struct { +typedef struct { LUNAddr_struct LUN_info; RequestBlock_struct Request; ErrorInfo_struct error_info; @@ -125,7 +125,7 @@ typedef struct _IOCTL_Command_struct { BYTE *buf; } IOCTL_Command_struct; -typedef struct _LogvolInfo_struct{ +typedef struct { __u32 LunID; int num_opens; /* number of opens on the logical volume */ int num_parts; /* number of partitions configured on logvol */ From patchwork Thu Aug 8 15:26:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757832 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E15C190671 for ; Thu, 8 Aug 2024 15:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130832; cv=none; b=jbvR+i14G3juDGhoL8V4cQGf0vi3wjeZnkudywHvFEjdGCdmN+PIWgV3TD2TUCabM6u9ndm+BPVPySht0zEtyRc/DpH94PchdihiDGEQaa22WPmeH1TelB5/i+0IVyI86GC6nlvVJsAF2wOVIAhF6NxwvN0NMwOk1qLcmnjQ85k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130832; c=relaxed/simple; bh=sH/eBvX8xOSfZkjw47il6wDT/Rph4dvJD9W59NUzIgk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KUh7tOT/BQhthAq1kuXGOY9uF7D8FfzILuO0k/kX5leHht1FONiLT4pwEPV9RNLabn+28sTL0Dnuex8phjBZCpMHpPhsLZ089fm5IUSmrkrRjTVfgD5Hnp7BFV8aKmu5TM4A8wMODv0KKlBAj1usvM/xP+6w4SaCHIXErB5x+EI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=eEBa3SxR; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="eEBa3SxR" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52f00ad303aso1386827e87.2 for ; Thu, 08 Aug 2024 08:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130828; x=1723735628; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o/6BD02ZqkXxxYcu6Z7ezi5phgzZ2Stn7B2M5TNlNBw=; b=eEBa3SxR8+SohI/1UjQTRHoye3z0YvaTRcXLCxX0IBpmhWX6QKkkqsKgBGWu9zgb5J +cS14fXY9AgMGZbmdI7M6hXFJkSzX1uDsocb7V2aACxta6AG5+cXzrZlnwtkQJLfJlte ts4gD6RhE2P4oyYJ1NTkHNTEPWeYHiILNC97A/ZNsW3BvNPN6Xb5lU+azfJXV4W6Cpyp fHRhcWAKR1tk4H7E6iiN0WRWpCSffIONJ2qTsccuRYiVB/6bg568YZ7jjjEUOoTgKXQa Vkd5g4EdEJkqrkjhS0ANO0hCVsD2/j0A56wYlZHmK+tbPhX090yBo3MP1U5LrS1FXNiM XOPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130828; x=1723735628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o/6BD02ZqkXxxYcu6Z7ezi5phgzZ2Stn7B2M5TNlNBw=; b=mjcseduMVHD42trN8Z36IyASG9nnzOoAjUdtqPNnHdU/5hEu0N7FPyRfXmh8xs4UOq uJypJLGWYohgTvrFFxfynuLCxLrIcIRYyq8dfpOgWW0EI/lyPWudbPdcjgpP26A/ldDS nIgCtSqjb0JSvTI/ZvHbJ6NitweRmUOdCnr4Uoddt0BnBvS70kGVbG+VELCkdgKW71LB KT5HU7MCy6f4I4Z7I6DMGKbwdPpi+mxexmU2n3cSe2brtLei5j5q89fnn4xh9O4YZLUi L3GT0wGOEXhMgwbJRaxZYAzc8XFgLmfo6aAep1ELKcHYgt7ds/XliGIXPerlgCtQj4oU b15g== X-Gm-Message-State: AOJu0Yy563WOqqREHYJP7CaltBmw1kPst+j83TzS810qEMKRgBZAs0pH bzHHaT69LZOKtf66fo9x14gPqdCsB7hjvd0ZC0BsAfP7Wpg0S8dyCvza1fGfjjE= X-Google-Smtp-Source: AGHT+IGy1r1G9vUR4t3HZaNfRtkYMhOm+JAhsWmvc+N8FCcvV+sojBL77+ERo1xyv2Yg22fofxPOAQ== X-Received: by 2002:a05:6512:3a84:b0:52e:9694:3f98 with SMTP id 2adb3069b0e04-530e5844a89mr1501925e87.27.1723130828126; Thu, 08 Aug 2024 08:27:08 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9d4e371sm753619966b.109.2024.08.08.08.27.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:07 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 33/41] libmpathpersist: rename functions with double leading underscore Date: Thu, 8 Aug 2024 17:26:12 +0200 Message-ID: <20240808152620.93965-34-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Also remove some superfluous "extern" qualifiers in mpath_persist.h. Signed-off-by: Martin Wilck --- libmpathpersist/libmpathpersist.version | 6 ++-- libmpathpersist/mpath_persist.c | 22 +++++++------- libmpathpersist/mpath_persist.h | 39 ++++++++++++------------- mpathpersist/main.c | 6 ++-- 4 files changed, 35 insertions(+), 38 deletions(-) diff --git a/libmpathpersist/libmpathpersist.version b/libmpathpersist/libmpathpersist.version index a8c6aae..f467d99 100644 --- a/libmpathpersist/libmpathpersist.version +++ b/libmpathpersist/libmpathpersist.version @@ -10,7 +10,7 @@ * * See libmultipath.version for general policy about version numbers. */ -LIBMPATHPERSIST_2.1.0 { +LIBMPATHPERSIST_3.0.0 { global: /* public API as defined in mpath_persist.h */ libmpathpersist_exit; @@ -19,10 +19,10 @@ global: mpath_lib_init; mpath_mx_alloc_len; mpath_persistent_reserve_free_vecs; - __mpath_persistent_reserve_in; + mpath_persistent_reserve_in__; mpath_persistent_reserve_in; mpath_persistent_reserve_init_vecs; - __mpath_persistent_reserve_out; + mpath_persistent_reserve_out__; mpath_persistent_reserve_out; local: *; }; diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 6cfcdde..ace91d7 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c @@ -74,7 +74,7 @@ int libmpathpersist_exit(void) static vector curmp; static vector pathvec; -static void __mpath_persistent_reserve_free_vecs(vector curmp, vector pathvec) +static void mpath_persistent_reserve_free_vecs__(vector curmp, vector pathvec) { free_multipathvec(curmp, KEEP_PATHS); free_pathvec(pathvec, FREE_PATHS); @@ -82,11 +82,11 @@ static void __mpath_persistent_reserve_free_vecs(vector curmp, vector pathvec) void mpath_persistent_reserve_free_vecs(void) { - __mpath_persistent_reserve_free_vecs(curmp, pathvec); + mpath_persistent_reserve_free_vecs__(curmp, pathvec); curmp = pathvec = NULL; } -static int __mpath_persistent_reserve_init_vecs(vector *curmp_p, +static int mpath_persistent_reserve_init_vecs__(vector *curmp_p, vector *pathvec_p, int verbose) { libmp_verbosity = verbose; @@ -110,17 +110,17 @@ static int __mpath_persistent_reserve_init_vecs(vector *curmp_p, return MPATH_PR_SUCCESS; err: - __mpath_persistent_reserve_free_vecs(*curmp_p, *pathvec_p); + mpath_persistent_reserve_free_vecs__(*curmp_p, *pathvec_p); *curmp_p = *pathvec_p = NULL; return MPATH_PR_DMMP_ERROR; } int mpath_persistent_reserve_init_vecs(int verbose) { - return __mpath_persistent_reserve_init_vecs(&curmp, &pathvec, verbose); + return mpath_persistent_reserve_init_vecs__(&curmp, &pathvec, verbose); } -int __mpath_persistent_reserve_in (int fd, int rq_servact, +int mpath_persistent_reserve_in__(int fd, int rq_servact, struct prin_resp *resp, int noisy) { return do_mpath_persistent_reserve_in(curmp, pathvec, fd, rq_servact, @@ -128,7 +128,7 @@ int __mpath_persistent_reserve_in (int fd, int rq_servact, } -int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, +int mpath_persistent_reserve_out__( int fd, int rq_servact, int rq_scope, unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy) { return do_mpath_persistent_reserve_out(curmp, pathvec, fd, rq_servact, @@ -140,14 +140,14 @@ int mpath_persistent_reserve_in (int fd, int rq_servact, struct prin_resp *resp, int noisy, int verbose) { vector curmp = NULL, pathvec; - int ret = __mpath_persistent_reserve_init_vecs(&curmp, &pathvec, + int ret = mpath_persistent_reserve_init_vecs__(&curmp, &pathvec, verbose); if (ret != MPATH_PR_SUCCESS) return ret; ret = do_mpath_persistent_reserve_in(curmp, pathvec, fd, rq_servact, resp, noisy); - __mpath_persistent_reserve_free_vecs(curmp, pathvec); + mpath_persistent_reserve_free_vecs__(curmp, pathvec); return ret; } @@ -155,13 +155,13 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy, int verbose) { vector curmp = NULL, pathvec; - int ret = __mpath_persistent_reserve_init_vecs(&curmp, &pathvec, + int ret = mpath_persistent_reserve_init_vecs__(&curmp, &pathvec, verbose); if (ret != MPATH_PR_SUCCESS) return ret; ret = do_mpath_persistent_reserve_out(curmp, pathvec, fd, rq_servact, rq_scope, rq_type, paramp, noisy); - __mpath_persistent_reserve_free_vecs(curmp, pathvec); + mpath_persistent_reserve_free_vecs__(curmp, pathvec); return ret; } diff --git a/libmpathpersist/mpath_persist.h b/libmpathpersist/mpath_persist.h index 9c88e15..d94205f 100644 --- a/libmpathpersist/mpath_persist.h +++ b/libmpathpersist/mpath_persist.h @@ -3,7 +3,6 @@ #ifndef MPATH_PERSIST_H_INCLUDED #define MPATH_PERSIST_H_INCLUDED - #ifdef __cplusplus extern "C" { #endif @@ -81,12 +80,8 @@ extern "C" { #define MPATH_WWUI_DEVICE_NAME 0x00 /* World wide unique initiator device name */ #define MPATH_WWUI_PORT_IDENTIFIER 0x40 /* World wide unique initiator port identifier */ - - extern unsigned int mpath_mx_alloc_len; - - struct prin_readdescr { uint32_t prgeneration; @@ -183,7 +178,7 @@ struct prout_param_descriptor { /* PROUT parameter descriptor */ * * RETURNS: 0->Success, 1->Failed. */ -extern int libmpathpersist_init (void); +int libmpathpersist_init(void); /* * DESCRIPTION : @@ -197,7 +192,7 @@ extern int libmpathpersist_init (void); * * RETURNS: struct config ->Success, NULL->Failed. */ -extern struct config * mpath_lib_init (void); +struct config *mpath_lib_init(void); /* @@ -209,7 +204,7 @@ extern struct config * mpath_lib_init (void); * * RETURNS: 0->Success, 1->Failed. */ -extern int mpath_lib_exit (struct config *conf); +int mpath_lib_exit(struct config *conf); /* * DESCRIPTION : @@ -221,7 +216,7 @@ extern int mpath_lib_exit (struct config *conf); * * RETURNS: 0->Success, 1->Failed. */ -extern int libmpathpersist_exit (void); +int libmpathpersist_exit(void); /* @@ -241,8 +236,8 @@ extern int libmpathpersist_exit (void); * above in RETURN_STATUS. * */ -extern int mpath_persistent_reserve_in (int fd, int rq_servact, struct prin_resp *resp, - int noisy, int verbose); +int mpath_persistent_reserve_in(int fd, int rq_servact, struct prin_resp *resp, + int noisy, int verbose); /* * DESCRIPTION : @@ -254,8 +249,8 @@ extern int mpath_persistent_reserve_in (int fd, int rq_servact, struct prin_resp * RESTRICTIONS: * This function uses static internal variables, and is not thread-safe. */ -extern int __mpath_persistent_reserve_in(int fd, int rq_servact, - struct prin_resp *resp, int noisy); +int mpath_persistent_reserve_in__(int fd, int rq_servact, + struct prin_resp *resp, int noisy); /* * DESCRIPTION : @@ -279,9 +274,10 @@ extern int __mpath_persistent_reserve_in(int fd, int rq_servact, * RETURNS: MPATH_PR_SUCCESS if PR command successful else returns any of the status specified * above in RETURN_STATUS. */ -extern int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, - unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy, - int verbose); +int mpath_persistent_reserve_out(int fd, int rq_servact, int rq_scope, + unsigned int rq_type, + struct prout_param_descriptor *paramp, + int noisy, int verbose); /* * DESCRIPTION : * This function is like mpath_persistent_reserve_out(), except that it @@ -292,15 +288,16 @@ extern int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, * RESTRICTIONS: * This function uses static internal variables, and is not thread-safe. */ -extern int __mpath_persistent_reserve_out( int fd, int rq_servact, int rq_scope, - unsigned int rq_type, struct prout_param_descriptor *paramp, - int noisy); +int mpath_persistent_reserve_out__(int fd, int rq_servact, int rq_scope, + unsigned int rq_type, + struct prout_param_descriptor *paramp, + int noisy); /* * DESCRIPTION : * This function allocates data structures and performs basic initialization and - * device discovery for later calls of __mpath_persistent_reserve_in() or - * __mpath_persistent_reserve_out(). + * device discovery for later calls of mpath_persistent_reserve_in__() or + * mpath_persistent_reserve_out__(). * @verbose: Set verbosity level. Input argument. value:0 to 3. 0->disabled, 3->Max verbose * * RESTRICTIONS: diff --git a/mpathpersist/main.c b/mpathpersist/main.c index b661790..efb46b9 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -505,7 +505,7 @@ static int handle_args(int argc, char * argv[], int nline) goto out_fd; } - ret = __mpath_persistent_reserve_in (fd, prin_sa, resp, noisy); + ret = mpath_persistent_reserve_in__(fd, prin_sa, resp, noisy); if (ret != MPATH_PR_SUCCESS ) { fprintf (stderr, "Persistent Reserve IN command failed\n"); @@ -575,8 +575,8 @@ static int handle_args(int argc, char * argv[], int nline) } /* PROUT commands other than 'register and move' */ - ret = __mpath_persistent_reserve_out (fd, prout_sa, 0, prout_type, - paramp, noisy); + ret = mpath_persistent_reserve_out__(fd, prout_sa, 0, prout_type, + paramp, noisy); free_prout_param_descriptor(paramp); } From patchwork Thu Aug 8 15:26:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757833 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34550191474 for ; Thu, 8 Aug 2024 15:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130833; cv=none; b=Guu62noBfPjwXrf5/lvUxTA25fVhZ4xPnvRvz0biMnvG4ef6MA62g8R0+OFWe/sLujIlQkgpp+URC9Lc1a+nOZUkMGXMq2UkssIrtf5fe2n7nLdR51AECwhyJ5YNpoUizppNO5sb200p0+BTNi0y7EkcdaFlYMRiwQaDKlFh1W4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130833; c=relaxed/simple; bh=BZ2ufZzymcE5S1nEBqkYIC1a73EBbWDydKorytx14+U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XbtwNMOctibfOJHrAAaxyyTWPGJa9NqQ8UW8Z48wZMlsqNhpMvzYKlHD3Rn/32C+bNC7i6MgwjHVRQrMuPo0il4vUZzp8M4ZUeZs7sFg15Wm980nZpohzaAb2OQYeY2umxBNPGEUG3FHeT6mCki84C3wD6jgaYv0wsANMpaM+00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=B1LncQJ3; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="B1LncQJ3" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a7a9e25008aso135585866b.0 for ; Thu, 08 Aug 2024 08:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130829; x=1723735629; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IGAcoYP+NRdSl9G7OoWn3dvxLqe4ZyEafx75lvH92t0=; b=B1LncQJ3nf8E2/CGrB0E+bcLunbya8h2KUxJ4yShfrhcVzaiffdCz2N+M21EL1SJNH 7yC18EdEVwpvvovNACPdImeq/l2I5v/xyIpcm6Q8Ej0BLb0Bs8lCzPeg3KFSp3pddlB3 ipfqeq6K2QpSrRYlZ88+fVaVAXFykJhIBz5l9rxwvxfoA5HIPwR9Nk8yTGdEOOdHej/W YPiGbLHM8EOIxeDd1fX+orrMM+ziM44B8ZU+s+d563Zhm9j7k2XtfPSRnEBoy6OX6Nq6 wob2gLxxbfWzBTEwtCB56jHbhZLT1FLWdchtFOzjP5a+idEnTxTwWbSTv4rC5g+BZ3Cj 5jAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130829; x=1723735629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IGAcoYP+NRdSl9G7OoWn3dvxLqe4ZyEafx75lvH92t0=; b=qDoUspx5yiyAX386+ycyQ5YKMIs5Ou4WsYCA+mS9mxvUHiE0dPA/kD6gZWpZVRxV9D N38Sad52ClR0J2HZnrPnow4CzUxjA7MW5S+eqMtYx00Nf/xz8g0WdhhI5KoCdM3g8z5u Z8Od+Jno+o2xkuQVuiOZLEzG2q8ArleN5hha8c9ge5KuYWq5ZEMAUV+oihBcIYCu34Vl DTmx7VtCYhXoxgoOO6lXoAamNQR6J6igZ2EHc+i7M38yq1IhFXyAkHoijpYlMhElpxEZ pLZ+hxNU8mWYHkIozms0qvcWt80fNLdEy7YDYgNYD7Z8L/C4dD3IEWHPGFBpihPz/qeQ 1lgQ== X-Gm-Message-State: AOJu0YwkFyowGLR/tboj+yLAFZr9m8ys10JPEviO50f0dNkLR2a/1Imr 4P+xORU+f+gWvm5eBIz0+jPgEYQ19eN1o5r/19cCbg+odVe7ASdG8QcGZYOHnd8= X-Google-Smtp-Source: AGHT+IEbEv4XkbNrk+8jvSV64cTzRLp16w7+wNW4/WtBOww9kSQO4HBbe4Ko1pVVxEVdeJ5IqwB1yQ== X-Received: by 2002:a17:907:1c18:b0:a72:8296:ca1f with SMTP id a640c23a62f3a-a8090e3d103mr172661066b.50.1723130829160; Thu, 08 Aug 2024 08:27:09 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0b8dasm748739566b.83.2024.08.08.08.27.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:08 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 34/41] libdmmp: rename macros starting with _DMMP Date: Thu, 8 Aug 2024 17:26:13 +0200 Message-ID: <20240808152620.93965-35-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libdmmp/libdmmp.c | 60 +++++++++++++++++++-------------------- libdmmp/libdmmp_misc.c | 6 ++-- libdmmp/libdmmp_pg.c | 6 ++-- libdmmp/libdmmp_private.h | 2 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libdmmp/libdmmp.c b/libdmmp/libdmmp.c index 1bfdbed..47f5b53 100644 --- a/libdmmp/libdmmp.c +++ b/libdmmp/libdmmp.c @@ -35,19 +35,19 @@ #include "libdmmp/libdmmp.h" #include "libdmmp_private.h" -#define _DEFAULT_UXSOCK_TIMEOUT 60000 +#define DEFAULT_UXSOCK_TIMEOUT 60000 /* ^ 60 seconds. On system with 10k sdX, dmmp_mpath_array_get() * only take 3.5 seconds, so this default value should be OK for most users. */ -#define _DMMP_IPC_SHOW_JSON_CMD "show maps json" -#define _DMMP_JSON_MAJOR_KEY "major_version" -#define _DMMP_JSON_MAJOR_VERSION 0 -#define _DMMP_JSON_MAPS_KEY "maps" -#define _ERRNO_STR_BUFF_SIZE 256 -#define _IPC_MAX_CMD_LEN 512 +#define DMMP_IPC_SHOW_JSON_CMD "show maps json" +#define DMMP_JSON_MAJOR_KEY "major_version" +#define DMMP_JSON_MAJOR_VERSION 0 +#define DMMP_JSON_MAPS_KEY "maps" +#define ERRNO_STR_BUFF_SIZE 256 +#define IPC_MAX_CMD_LEN 512 /* ^ Was MAX_CMD_LEN in ./libmultipath/uxsock.h */ -#define _LAST_ERR_MSG_BUFF_SIZE 1024 +#define LAST_ERR_MSG_BUFF_SIZE 1024 struct dmmp_context { void (*log_func)(struct dmmp_context *ctx, int priority, @@ -56,7 +56,7 @@ struct dmmp_context { int log_priority; void *userdata; unsigned int tmo; - char last_err_msg[_LAST_ERR_MSG_BUFF_SIZE]; + char last_err_msg[LAST_ERR_MSG_BUFF_SIZE]; }; /* @@ -99,7 +99,7 @@ void _dmmp_log(struct dmmp_context *ctx, int priority, const char *file, va_start(args, format); ctx->log_func(ctx, priority, file, line, func_name, format, args); if (priority == DMMP_LOG_PRIORITY_ERROR) - vsnprintf(ctx->last_err_msg, _LAST_ERR_MSG_BUFF_SIZE, + vsnprintf(ctx->last_err_msg, LAST_ERR_MSG_BUFF_SIZE, format, args); va_end(args); } @@ -116,8 +116,8 @@ struct dmmp_context *dmmp_context_new(void) ctx->log_func = _dmmp_log_stderr; ctx->log_priority = DMMP_LOG_PRIORITY_DEFAULT; ctx->userdata = NULL; - ctx->tmo = _DEFAULT_UXSOCK_TIMEOUT; - memset(ctx->last_err_msg, 0, _LAST_ERR_MSG_BUFF_SIZE); + ctx->tmo = DEFAULT_UXSOCK_TIMEOUT; + memset(ctx->last_err_msg, 0, LAST_ERR_MSG_BUFF_SIZE); return ctx; } @@ -180,7 +180,7 @@ int dmmp_mpath_array_get(struct dmmp_context *ctx, _good(_ipc_connect(ctx, &ipc_fd), rc, out); - _good(_process_cmd(ctx, ipc_fd, _DMMP_IPC_SHOW_JSON_CMD, &j_str), + _good(_process_cmd(ctx, ipc_fd, DMMP_IPC_SHOW_JSON_CMD, &j_str), rc, out); _debug(ctx, "Got json output from multipathd: '%s'", j_str); @@ -202,20 +202,20 @@ int dmmp_mpath_array_get(struct dmmp_context *ctx, } _json_obj_get_value(ctx, j_obj, cur_json_major_version, - _DMMP_JSON_MAJOR_KEY, json_type_int, + DMMP_JSON_MAJOR_KEY, json_type_int, json_object_get_int, rc, out); - if (cur_json_major_version != _DMMP_JSON_MAJOR_VERSION) { + if (cur_json_major_version != DMMP_JSON_MAJOR_VERSION) { rc = DMMP_ERR_INCOMPATIBLE; _error(ctx, "Incompatible multipathd JSON major version %d, " "should be %d", cur_json_major_version, - _DMMP_JSON_MAJOR_VERSION); + DMMP_JSON_MAJOR_VERSION); goto out; } _debug(ctx, "multipathd JSON major version(%d) check pass", - _DMMP_JSON_MAJOR_VERSION); + DMMP_JSON_MAJOR_VERSION); - _json_obj_get_value(ctx, j_obj, ar_maps, _DMMP_JSON_MAPS_KEY, + _json_obj_get_value(ctx, j_obj, ar_maps, DMMP_JSON_MAPS_KEY, json_type_array, json_object_get_array, rc, out); if (ar_maps == NULL) { @@ -279,7 +279,7 @@ static int _process_cmd(struct dmmp_context *ctx, int fd, const char *cmd, { int errno_save = 0; int rc = DMMP_OK; - char errno_str_buff[_ERRNO_STR_BUFF_SIZE]; + char errno_str_buff[ERRNO_STR_BUFF_SIZE]; struct timespec start_ts; struct timespec cur_ts; unsigned int ipc_tmo = 0; @@ -300,7 +300,7 @@ static int _process_cmd(struct dmmp_context *ctx, int fd, const char *cmd, ipc_tmo = ctx->tmo; if (ctx->tmo == 0) - ipc_tmo = _DEFAULT_UXSOCK_TIMEOUT; + ipc_tmo = DEFAULT_UXSOCK_TIMEOUT; invoke: _debug(ctx, "Invoking IPC command '%s' with IPC tmo %u milliseconds", @@ -308,8 +308,8 @@ invoke: flag_check_tmo = false; if (mpath_process_cmd(fd, cmd, output, ipc_tmo) != 0) { errno_save = errno; - memset(errno_str_buff, 0, _ERRNO_STR_BUFF_SIZE); - strerror_r(errno_save, errno_str_buff, _ERRNO_STR_BUFF_SIZE); + memset(errno_str_buff, 0, ERRNO_STR_BUFF_SIZE); + strerror_r(errno_save, errno_str_buff, ERRNO_STR_BUFF_SIZE); if (errno_save == ETIMEDOUT) { flag_check_tmo = true; } else { @@ -397,7 +397,7 @@ static int _ipc_connect(struct dmmp_context *ctx, int *fd) { int rc = DMMP_OK; int errno_save = 0; - char errno_str_buff[_ERRNO_STR_BUFF_SIZE]; + char errno_str_buff[ERRNO_STR_BUFF_SIZE]; assert(ctx != NULL); assert(fd != NULL); @@ -407,8 +407,8 @@ static int _ipc_connect(struct dmmp_context *ctx, int *fd) *fd = mpath_connect(); if (*fd == -1) { errno_save = errno; - memset(errno_str_buff, 0, _ERRNO_STR_BUFF_SIZE); - strerror_r(errno_save, errno_str_buff, _ERRNO_STR_BUFF_SIZE); + memset(errno_str_buff, 0, ERRNO_STR_BUFF_SIZE); + strerror_r(errno_save, errno_str_buff, ERRNO_STR_BUFF_SIZE); if (errno_save == ECONNREFUSED) { rc = DMMP_ERR_NO_DAEMON; _error(ctx, "Socket connection refuse. " @@ -426,14 +426,14 @@ int dmmp_flush_mpath(struct dmmp_context *ctx, const char *mpath_name) { int rc = DMMP_OK; int ipc_fd = -1; - char cmd[_IPC_MAX_CMD_LEN]; + char cmd[IPC_MAX_CMD_LEN]; char *output = NULL; assert(ctx != NULL); assert(mpath_name != NULL); - snprintf(cmd, _IPC_MAX_CMD_LEN, "del map %s", mpath_name); - if (strlen(cmd) == _IPC_MAX_CMD_LEN - 1) { + snprintf(cmd, IPC_MAX_CMD_LEN, "del map %s", mpath_name); + if (strlen(cmd) == IPC_MAX_CMD_LEN - 1) { rc = DMMP_ERR_INVALID_ARGUMENT; _error(ctx, "Invalid mpath name %s", mpath_name); goto out; @@ -461,9 +461,9 @@ int dmmp_reconfig(struct dmmp_context *ctx) int rc = DMMP_OK; int ipc_fd = -1; char *output = NULL; - char cmd[_IPC_MAX_CMD_LEN]; + char cmd[IPC_MAX_CMD_LEN]; - snprintf(cmd, _IPC_MAX_CMD_LEN, "%s", "reconfigure"); + snprintf(cmd, IPC_MAX_CMD_LEN, "%s", "reconfigure"); _good(_ipc_connect(ctx, &ipc_fd), rc, out); _good(_process_cmd(ctx, ipc_fd, cmd, &output), rc, out); diff --git a/libdmmp/libdmmp_misc.c b/libdmmp/libdmmp_misc.c index 69b5a20..51c71cd 100644 --- a/libdmmp/libdmmp_misc.c +++ b/libdmmp/libdmmp_misc.c @@ -30,7 +30,7 @@ #include "libdmmp/libdmmp.h" #include "libdmmp_private.h" -#define _DMMP_LOG_STRERR_ALIGN_WIDTH 80 +#define DMMP_LOG_STRERR_ALIGN_WIDTH 80 /* ^ Only used in _dmmp_log_stderr() for pretty log output. * When provided log message is less than 80 bytes, fill it with space, then * print code file name, function name, line after the 80th bytes. @@ -81,9 +81,9 @@ void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, * bypass clang static analyzer about unused ctx argument warning */ - if (printed_bytes < _DMMP_LOG_STRERR_ALIGN_WIDTH) { + if (printed_bytes < DMMP_LOG_STRERR_ALIGN_WIDTH) { fprintf(stderr, "%*s # %s:%s():%d\n", - _DMMP_LOG_STRERR_ALIGN_WIDTH - printed_bytes, "", file, + DMMP_LOG_STRERR_ALIGN_WIDTH - printed_bytes, "", file, func_name, line); } else { fprintf(stderr, " # %s:%s():%d\n", file, func_name, line); diff --git a/libdmmp/libdmmp_pg.c b/libdmmp/libdmmp_pg.c index 5149161..6be2316 100644 --- a/libdmmp/libdmmp_pg.c +++ b/libdmmp/libdmmp_pg.c @@ -78,7 +78,7 @@ struct dmmp_path_group *_dmmp_path_group_new(void) malloc(sizeof(struct dmmp_path_group)); if (dmmp_pg != NULL) { - dmmp_pg->id = _DMMP_PATH_GROUP_ID_UNKNOWN; + dmmp_pg->id = DMMP_PATH_GROUP_ID_UNKNOWN; dmmp_pg->status = DMMP_PATH_GROUP_STATUS_UNKNOWN; dmmp_pg->priority = 0; dmmp_pg->selector = NULL; @@ -127,10 +127,10 @@ int _dmmp_path_group_update(struct dmmp_context *ctx, dmmp_pg->id = id; - if (dmmp_pg->id == _DMMP_PATH_GROUP_ID_UNKNOWN) { + if (dmmp_pg->id == DMMP_PATH_GROUP_ID_UNKNOWN) { rc = DMMP_ERR_BUG; _error(ctx, "BUG: Got unknown(%d) path group ID", - _DMMP_PATH_GROUP_ID_UNKNOWN); + DMMP_PATH_GROUP_ID_UNKNOWN); goto out; } diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h index 9606fb3..0c497b3 100644 --- a/libdmmp/libdmmp_private.h +++ b/libdmmp/libdmmp_private.h @@ -46,7 +46,7 @@ extern "C" { goto out; \ } while(0) -#define _DMMP_PATH_GROUP_ID_UNKNOWN 0 +#define DMMP_PATH_GROUP_ID_UNKNOWN 0 struct DMMP_DLL_LOCAL _num_str_conv; struct _num_str_conv { From patchwork Thu Aug 8 15:26:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757834 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D2E219046C for ; Thu, 8 Aug 2024 15:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130834; cv=none; b=j/GdXXBbIo/6msh+wpn9pCxr0VswoK2Xs2D5pwBaZB2fDp3hMaK0oInarjVlyL1CumFd63TUS0j58GpAnl5ekV9ZY0SQtMYh9mBGfElIeSnPmpUXMHfRM9giFctEL0YkzNyNayURA5H8veF2F/NC2ig5Y5cV1Ac/qqIZP2n+rkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130834; c=relaxed/simple; bh=6mMPXeCvVJ2goGbCus+K4rYvAjUIf/cKbrCtgzqE3Ro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WdNht0STEemqdVgm+e+J9opHEtxP44zKHroT9cqBiFh6P5cm6Qjw9rWBeRbPi5mdHdoSdh/HvSXOzrCoVNORlYYrTzx7pSztfphUue0NRnzUaW+PhrgpHCotSdazGbRPY7WK5LpbRwT2j4pr7K3NVGrtz6Se6i8zABLbg2yB+EM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=OjnOlwBm; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="OjnOlwBm" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso1474054a12.1 for ; Thu, 08 Aug 2024 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130830; x=1723735630; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hl9z3Kv7VvQbdoOUQwTGJl7h/Tz+6ItN6aWF5tvGMOA=; b=OjnOlwBmNWSBghhnDOFs9Bpu2yQNdC6R+rLe6vU0QwyaWfF57rYkX63VBueRt8aSfJ dhaMgtZDgJAV+6d6iwO0nhU80wHzQjlToqdGqAgBRcHZBkrgQhmXx/H7mg/zC4sEpa5M OGh97m+PN8s2d9VC+tLkSYKan3A52XmoybXlKa9GJnyuK6iI2vutFCy6x/2pDwLDamOJ 1sMQNolw9Br3fsT5cqBCHDtlbGo+glCO0Tso1C7wJKst8k9HNR4/aXk5Jr77NBWLTcqZ 5XRBxhIZrkRZRHKq2kAzruap7FpmmelA5c1n+etCUvK/iJiq4sHBojC78RS4BRn2b5HO ByTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130830; x=1723735630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hl9z3Kv7VvQbdoOUQwTGJl7h/Tz+6ItN6aWF5tvGMOA=; b=qFgeMCOe2o8ikUVuErNmRkJoRO1iZN1iOpdFrkdBy7Fp3Foi2ZKHQ0xStrwXBEhGye s58A+CsEgpijLoMCyTfCLj6KlfgxhGZKgKYKh/6q/h23eZLu+1hRi/8iN4ZurzxGZqCl yWO1EhGUVU1e6CSAlsHireAQAOa8SBZZwQwXmrP7uCAKN5FzYPTC13tM0rqrDegPkMU9 Dzruj8Vqhu0Rq5JU6Q1WLoE+YAuT1+qEoIVF7LVeyBAfRv1HJbPIpRjg34VnAzH/KL43 LHJhDA0VChOQYtX+sXWpMhcBmLDmpi25+70cP4jZqSPLRCu/sTKHsEfeP7xk6Lb62QiE rGNw== X-Gm-Message-State: AOJu0YzfoBHzrMbh0SntvFVYvKGxiB4n69jUF5xUFkxV8v0OXojka4+P KeP0cIZOySwUdaiRgdn94ztu3zLtMrQ+pI8l4TUBaYFHJXnLd523vS4Zq9GJSsxW+T3OFWjGLsl eiVo= X-Google-Smtp-Source: AGHT+IFRhAJt5mt4+73wcZHiGsgQJuSVRdgPSzqiDgzP9mw7iMTCo16KUHcgN6RudIktiTpcUM4Q0Q== X-Received: by 2002:a17:907:f743:b0:a7a:952b:95b4 with SMTP id a640c23a62f3a-a8090e929d5mr160474266b.47.1723130830116; Thu, 08 Aug 2024 08:27:10 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ec8855sm756275366b.199.2024.08.08.08.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:09 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 35/41] libdmmp: rename enum values and variables starting with _DMMP_ Date: Thu, 8 Aug 2024 17:26:14 +0200 Message-ID: <20240808152620.93965-36-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libdmmp/libdmmp_path.c | 14 +++++++------- libdmmp/libdmmp_pg.c | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libdmmp/libdmmp_path.c b/libdmmp/libdmmp_path.c index 21714b1..0650f8d 100644 --- a/libdmmp/libdmmp_path.c +++ b/libdmmp/libdmmp_path.c @@ -27,17 +27,17 @@ #include "libdmmp/libdmmp.h" #include "libdmmp_private.h" -#define _DMMP_SHOW_PS_INDEX_BLK_NAME 0 -#define _DMMP_SHOW_PS_INDEX_STATUS 1 -#define _DMMP_SHOW_PS_INDEX_WWID 2 -#define _DMMP_SHOW_PS_INDEX_PGID 3 +#define DMMP_SHOW_PS_INDEX_BLK_NAME 0 +#define DMMP_SHOW_PS_INDEX_STATUS 1 +#define DMMP_SHOW_PS_INDEX_WWID 2 +#define DMMP_SHOW_PS_INDEX_PGID 3 struct dmmp_path { char *blk_name; uint32_t status; }; -static const struct _num_str_conv _DMMP_PATH_STATUS_CONV[] = { +static const struct _num_str_conv DMMP_PATH_STATUS_CONV[] = { {DMMP_PATH_STATUS_UNKNOWN, "undef"}, {DMMP_PATH_STATUS_UP, "ready"}, {DMMP_PATH_STATUS_DOWN, "faulty"}, @@ -49,10 +49,10 @@ static const struct _num_str_conv _DMMP_PATH_STATUS_CONV[] = { }; _dmmp_str_func_gen(dmmp_path_status_str, uint32_t, path_status, - _DMMP_PATH_STATUS_CONV); + DMMP_PATH_STATUS_CONV); _dmmp_str_conv_func_gen(_dmmp_path_status_str_conv, ctx, path_status_str, uint32_t, DMMP_PATH_STATUS_UNKNOWN, - _DMMP_PATH_STATUS_CONV); + DMMP_PATH_STATUS_CONV); _dmmp_getter_func_gen(dmmp_path_blk_name_get, struct dmmp_path, dmmp_p, blk_name, const char *); diff --git a/libdmmp/libdmmp_pg.c b/libdmmp/libdmmp_pg.c index 6be2316..42e87fe 100644 --- a/libdmmp/libdmmp_pg.c +++ b/libdmmp/libdmmp_pg.c @@ -28,12 +28,12 @@ #include "libdmmp/libdmmp.h" #include "libdmmp_private.h" -#define _DMMP_SHOW_PGS_CMD "show groups raw format %w|%g|%p|%t|%s" -#define _DMMP_SHOW_PG_INDEX_WWID 0 -#define _DMMP_SHOW_PG_INDEX_PG_ID 1 -#define _DMMP_SHOW_PG_INDEX_PRI 2 -#define _DMMP_SHOW_PG_INDEX_STATUS 3 -#define _DMMP_SHOW_PG_INDEX_SELECTOR 4 +#define DMMP_SHOW_PGS_CMD "show groups raw format %w|%g|%p|%t|%s" +#define DMMP_SHOW_PG_INDEX_WWID 0 +#define DMMP_SHOW_PG_INDEX_PG_ID 1 +#define DMMP_SHOW_PG_INDEX_PRI 2 +#define DMMP_SHOW_PG_INDEX_STATUS 3 +#define DMMP_SHOW_PG_INDEX_SELECTOR 4 struct dmmp_path_group { uint32_t id; @@ -45,7 +45,7 @@ struct dmmp_path_group { struct dmmp_path **dmmp_ps; }; -static const struct _num_str_conv _DMMP_PATH_GROUP_STATUS_CONV[] = { +static const struct _num_str_conv DMMP_PATH_GROUP_STATUS_CONV[] = { {DMMP_PATH_GROUP_STATUS_UNKNOWN, "undef"}, {DMMP_PATH_GROUP_STATUS_ACTIVE, "active"}, {DMMP_PATH_GROUP_STATUS_DISABLED, "disabled"}, @@ -53,10 +53,10 @@ static const struct _num_str_conv _DMMP_PATH_GROUP_STATUS_CONV[] = { }; _dmmp_str_func_gen(dmmp_path_group_status_str, uint32_t, pg_status, - _DMMP_PATH_GROUP_STATUS_CONV); + DMMP_PATH_GROUP_STATUS_CONV); _dmmp_str_conv_func_gen(_dmmp_path_group_status_str_conv, ctx, pg_status_str, uint32_t, DMMP_PATH_GROUP_STATUS_UNKNOWN, - _DMMP_PATH_GROUP_STATUS_CONV); + DMMP_PATH_GROUP_STATUS_CONV); _dmmp_getter_func_gen(dmmp_path_group_id_get, struct dmmp_path_group, dmmp_pg, id, uint32_t); From patchwork Thu Aug 8 15:26:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757835 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11363190675 for ; Thu, 8 Aug 2024 15:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130835; cv=none; b=Dsv97KfeXyee/2+xFkptD0UAAxnjfImG7FCqBFufcrfB/UL4ylmAujw55cOMgIdJDaXtyy0JeN9Wch8BaOA8uY3K9fZ/dO2ccMfz/DYT9Acx1c3HHCthD7eM3xnLPfK1DF92+dwhvIB4psblsKubhEjDYNqzN5eYndAuoRUeBPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130835; c=relaxed/simple; bh=aCnLxAZJrxFK8csJsnDeMeLisoxPEm59hZVEOuPr8bU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IPdVmMuPnkDjSMxiWtPnZ6H7eM6/jBlopD6+RVz41iR2wFriNpXzZx4a2GoYmdyzCoWtTLafJSnMaZHK8JKOUBIteBhl1V1voIwjtXWRvNiJv4Rluuf8GRbWWSYWUJtsgvQ6x5CCED09M52np0vRVUhrMvrx/s7TmMP9wYzNvVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=eneoJjcy; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="eneoJjcy" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso1474074a12.1 for ; Thu, 08 Aug 2024 08:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130831; x=1723735631; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/8aM4huH9AEwE4yZ99m5usL/kiMBP+AqpRKwQr45UVg=; b=eneoJjcyNllpR9RyYKfgdw3IiVuV7CTU8aLw/zq1DwMlBj96r9q5NYwLnCvUuqfSYD uUCP+RFT1q1FR+OvYtjta/pNMMYWpOOBA9AlXUq5mLJU4RwVcMaGrwNeWOX2C5QubyyX rmBoEqKEaAWsWeB2sCB/rTXxMsMcMNTn1yUTW31fX/BdqMwQSdj9GBIRyAbaoekukgqH RY5wOuQKkYSHwzpL1RN3E5oN/++kylgdTFlB2HiG5Pb1wBsbg+K0ed2nuqJ+VcTxHQNG pjRqb8O0r3CxFVG8pkpgXMa14Gi/GBhMBrh1vCp4HUCHdTjxgvEIwtGU8wo9uxDKGe2U IIlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130831; x=1723735631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/8aM4huH9AEwE4yZ99m5usL/kiMBP+AqpRKwQr45UVg=; b=Encj9vmXGPPHsheZipcEG56eqp6UHHznjcaJHzzx9QSSMCMJxfzekHmbSTnA5X6eS0 FCTED3b+yVris3DgoHCNo1FUsb0x+TrvJ4+xY48BG+pvBf19NeAifBsoH3Tpddb8imyQ t94H9rOJfjNZCbnS2bnJ4eXlZSbyRc2RBn2NbMW4h0exGC5mNQDFZHyOEUhWX7LlN8fQ Rxz8cDmqZpACKrXpGTDXrYTS5up1zhXrcPkFg7kTIrPXluPn4iXkSWgWoD49Xu6bD6Ty voBf/S3H4jaWgUtUnRjM65ENk9ky1odCDNlCZ78d85qnxGghY4Xul7lQzLdIbZdP6jNo hCtw== X-Gm-Message-State: AOJu0Yz6KTYgZZhhpeQO34d7A3bON9aqR/7UrmsZNHC3n4FwKIt/0pzQ m2dD//HAn5hHrxVYKdPk2VlfNCGPejyLLUMyU1ZybxHF6yiZcvavCXuGQMASNq4= X-Google-Smtp-Source: AGHT+IH7iTQ1l6QGddRYKcEz3KlKrGjTCH+kpDKXVB0345pq8b062mrza0VsC7LaegQYBp49St2/wg== X-Received: by 2002:a17:907:3e20:b0:a6f:586b:6c2 with SMTP id a640c23a62f3a-a8090f02e01mr184419866b.60.1723130831139; Thu, 08 Aug 2024 08:27:11 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9e8676fsm746555566b.164.2024.08.08.08.27.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:10 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 36/41] libdmmp: rename non-static functions starting with underscore Date: Thu, 8 Aug 2024 17:26:15 +0200 Message-ID: <20240808152620.93965-37-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- libdmmp/libdmmp.c | 10 +++++----- libdmmp/libdmmp_misc.c | 4 ++-- libdmmp/libdmmp_mp.c | 12 ++++++------ libdmmp/libdmmp_path.c | 8 ++++---- libdmmp/libdmmp_pg.c | 16 ++++++++-------- libdmmp/libdmmp_private.h | 24 ++++++++++++------------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libdmmp/libdmmp.c b/libdmmp/libdmmp.c index 47f5b53..8b9686a 100644 --- a/libdmmp/libdmmp.c +++ b/libdmmp/libdmmp.c @@ -86,9 +86,9 @@ _dmmp_getter_func_gen(dmmp_last_error_msg, struct dmmp_context, ctx, last_err_msg, const char *); _dmmp_array_free_func_gen(dmmp_mpath_array_free, struct dmmp_mpath, - _dmmp_mpath_free); + dmmp_mpath_free); -void _dmmp_log(struct dmmp_context *ctx, int priority, const char *file, +void dmmp_log(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, ...) { va_list args; @@ -113,7 +113,7 @@ struct dmmp_context *dmmp_context_new(void) if (ctx == NULL) return NULL; - ctx->log_func = _dmmp_log_stderr; + ctx->log_func = dmmp_log_stderr; ctx->log_priority = DMMP_LOG_PRIORITY_DEFAULT; ctx->userdata = NULL; ctx->tmo = DEFAULT_UXSOCK_TIMEOUT; @@ -250,10 +250,10 @@ int dmmp_mpath_array_get(struct dmmp_context *ctx, goto out; } - dmmp_mp = _dmmp_mpath_new(); + dmmp_mp = dmmp_mpath_new(); _dmmp_alloc_null_check(ctx, dmmp_mp, rc, out); (*dmmp_mps)[i] = dmmp_mp; - _good(_dmmp_mpath_update(ctx, dmmp_mp, j_obj_map), rc, out); + _good(dmmp_mpath_update(ctx, dmmp_mp, j_obj_map), rc, out); } out: diff --git a/libdmmp/libdmmp_misc.c b/libdmmp/libdmmp_misc.c index 51c71cd..92bbf8d 100644 --- a/libdmmp/libdmmp_misc.c +++ b/libdmmp/libdmmp_misc.c @@ -31,7 +31,7 @@ #include "libdmmp_private.h" #define DMMP_LOG_STRERR_ALIGN_WIDTH 80 -/* ^ Only used in _dmmp_log_stderr() for pretty log output. +/* ^ Only used in dmmp_log_stderr() for pretty log output. * When provided log message is less than 80 bytes, fill it with space, then * print code file name, function name, line after the 80th bytes. */ @@ -62,7 +62,7 @@ static const struct _num_str_conv _DMMP_PRI_CONV[] = { }; _dmmp_str_func_gen(dmmp_log_priority_str, int, priority, _DMMP_PRI_CONV); -void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, +void dmmp_log_stderr(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, va_list args) { diff --git a/libdmmp/libdmmp_mp.c b/libdmmp/libdmmp_mp.c index bc48d0e..1be8ba1 100644 --- a/libdmmp/libdmmp_mp.c +++ b/libdmmp/libdmmp_mp.c @@ -44,7 +44,7 @@ _dmmp_getter_func_gen(dmmp_mpath_wwid_get, struct dmmp_mpath, dmmp_mp, _dmmp_getter_func_gen(dmmp_mpath_kdev_name_get, struct dmmp_mpath, dmmp_mp, kdev_name, const char *); -struct dmmp_mpath *_dmmp_mpath_new(void) +struct dmmp_mpath *dmmp_mpath_new(void) { struct dmmp_mpath *dmmp_mp = NULL; @@ -59,7 +59,7 @@ struct dmmp_mpath *_dmmp_mpath_new(void) return dmmp_mp; } -int _dmmp_mpath_update(struct dmmp_context *ctx, struct dmmp_mpath *dmmp_mp, +int dmmp_mpath_update(struct dmmp_context *ctx, struct dmmp_mpath *dmmp_mp, json_object *j_obj_map) { int rc = DMMP_OK; @@ -113,10 +113,10 @@ int _dmmp_mpath_update(struct dmmp_context *ctx, struct dmmp_mpath *dmmp_mp, dmmp_mp->dmmp_pgs[i] = NULL; for (i = 0; i < dmmp_mp->dmmp_pg_count; ++i) { - dmmp_pg = _dmmp_path_group_new(); + dmmp_pg = dmmp_path_group_new(); _dmmp_alloc_null_check(ctx, dmmp_pg, rc, out); dmmp_mp->dmmp_pgs[i] = dmmp_pg; - _good(_dmmp_path_group_update(ctx, dmmp_pg, + _good(dmmp_path_group_update(ctx, dmmp_pg, array_list_get_idx(ar_pgs, i)), rc, out); } @@ -126,11 +126,11 @@ int _dmmp_mpath_update(struct dmmp_context *ctx, struct dmmp_mpath *dmmp_mp, out: if (rc != DMMP_OK) - _dmmp_mpath_free(dmmp_mp); + dmmp_mpath_free(dmmp_mp); return rc; } -void _dmmp_mpath_free(struct dmmp_mpath *dmmp_mp) +void dmmp_mpath_free(struct dmmp_mpath *dmmp_mp) { if (dmmp_mp == NULL) return ; diff --git a/libdmmp/libdmmp_path.c b/libdmmp/libdmmp_path.c index 0650f8d..96a96f4 100644 --- a/libdmmp/libdmmp_path.c +++ b/libdmmp/libdmmp_path.c @@ -59,7 +59,7 @@ _dmmp_getter_func_gen(dmmp_path_blk_name_get, struct dmmp_path, dmmp_p, _dmmp_getter_func_gen(dmmp_path_status_get, struct dmmp_path, dmmp_p, status, uint32_t); -struct dmmp_path *_dmmp_path_new(void) +struct dmmp_path *dmmp_path_new(void) { struct dmmp_path *dmmp_p = NULL; @@ -72,7 +72,7 @@ struct dmmp_path *_dmmp_path_new(void) return dmmp_p; } -int _dmmp_path_update(struct dmmp_context *ctx, struct dmmp_path *dmmp_p, +int dmmp_path_update(struct dmmp_context *ctx, struct dmmp_path *dmmp_p, json_object *j_obj_p) { int rc = DMMP_OK; @@ -102,11 +102,11 @@ int _dmmp_path_update(struct dmmp_context *ctx, struct dmmp_path *dmmp_p, out: if (rc != DMMP_OK) - _dmmp_path_free(dmmp_p); + dmmp_path_free(dmmp_p); return rc; } -void _dmmp_path_free(struct dmmp_path *dmmp_p) +void dmmp_path_free(struct dmmp_path *dmmp_p) { if (dmmp_p == NULL) return; diff --git a/libdmmp/libdmmp_pg.c b/libdmmp/libdmmp_pg.c index 42e87fe..68f1917 100644 --- a/libdmmp/libdmmp_pg.c +++ b/libdmmp/libdmmp_pg.c @@ -67,10 +67,10 @@ _dmmp_getter_func_gen(dmmp_path_group_priority_get, struct dmmp_path_group, _dmmp_getter_func_gen(dmmp_path_group_selector_get, struct dmmp_path_group, dmmp_pg, selector, const char *); _dmmp_array_free_func_gen(_dmmp_path_group_array_free, struct dmmp_path_group, - _dmmp_path_group_free); + dmmp_path_group_free); -struct dmmp_path_group *_dmmp_path_group_new(void) +struct dmmp_path_group *dmmp_path_group_new(void) { struct dmmp_path_group *dmmp_pg = NULL; @@ -87,7 +87,7 @@ struct dmmp_path_group *_dmmp_path_group_new(void) } return dmmp_pg; } -int _dmmp_path_group_update(struct dmmp_context *ctx, +int dmmp_path_group_update(struct dmmp_context *ctx, struct dmmp_path_group *dmmp_pg, json_object *j_obj_pg) { @@ -157,10 +157,10 @@ int _dmmp_path_group_update(struct dmmp_context *ctx, dmmp_pg->dmmp_ps[i] = NULL; for (i = 0; i < dmmp_pg->dmmp_p_count; ++i) { - dmmp_p = _dmmp_path_new(); + dmmp_p = dmmp_path_new(); _dmmp_alloc_null_check(ctx, dmmp_p, rc, out); dmmp_pg->dmmp_ps[i] = dmmp_p; - _good(_dmmp_path_update(ctx, dmmp_p, + _good(dmmp_path_update(ctx, dmmp_p, array_list_get_idx(ar_ps, i)), rc, out); } @@ -173,11 +173,11 @@ int _dmmp_path_group_update(struct dmmp_context *ctx, out: if (rc != DMMP_OK) - _dmmp_path_group_free(dmmp_pg); + dmmp_path_group_free(dmmp_pg); return rc; } -void _dmmp_path_group_free(struct dmmp_path_group *dmmp_pg) +void dmmp_path_group_free(struct dmmp_path_group *dmmp_pg) { uint32_t i = 0; @@ -188,7 +188,7 @@ void _dmmp_path_group_free(struct dmmp_path_group *dmmp_pg) if (dmmp_pg->dmmp_ps != NULL) { for (i = 0; i < dmmp_pg->dmmp_p_count; ++i) { - _dmmp_path_free(dmmp_pg->dmmp_ps[i]); + dmmp_path_free(dmmp_pg->dmmp_ps[i]); } free(dmmp_pg->dmmp_ps); } diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h index 0c497b3..d154146 100644 --- a/libdmmp/libdmmp_private.h +++ b/libdmmp/libdmmp_private.h @@ -110,33 +110,33 @@ do { \ DMMP_DLL_LOCAL int _dmmp_ipc_exec(struct dmmp_context *ctx, const char *cmd, char **output); -DMMP_DLL_LOCAL struct dmmp_mpath *_dmmp_mpath_new(void); -DMMP_DLL_LOCAL struct dmmp_path_group *_dmmp_path_group_new(void); -DMMP_DLL_LOCAL struct dmmp_path *_dmmp_path_new(void); +DMMP_DLL_LOCAL struct dmmp_mpath *dmmp_mpath_new(void); +DMMP_DLL_LOCAL struct dmmp_path_group *dmmp_path_group_new(void); +DMMP_DLL_LOCAL struct dmmp_path *dmmp_path_new(void); -DMMP_DLL_LOCAL int _dmmp_mpath_update(struct dmmp_context *ctx, +DMMP_DLL_LOCAL int dmmp_mpath_update(struct dmmp_context *ctx, struct dmmp_mpath *dmmp_mp, json_object *j_obj_map); -DMMP_DLL_LOCAL int _dmmp_path_group_update(struct dmmp_context *ctx, +DMMP_DLL_LOCAL int dmmp_path_group_update(struct dmmp_context *ctx, struct dmmp_path_group *dmmp_pg, json_object *j_obj_pg); -DMMP_DLL_LOCAL int _dmmp_path_update(struct dmmp_context *ctx, +DMMP_DLL_LOCAL int dmmp_path_update(struct dmmp_context *ctx, struct dmmp_path *dmmp_p, json_object *j_obj_p); -DMMP_DLL_LOCAL void _dmmp_mpath_free(struct dmmp_mpath *dmmp_mp); -DMMP_DLL_LOCAL void _dmmp_path_group_free(struct dmmp_path_group *dmmp_pg); +DMMP_DLL_LOCAL void dmmp_mpath_free(struct dmmp_mpath *dmmp_mp); +DMMP_DLL_LOCAL void dmmp_path_group_free(struct dmmp_path_group *dmmp_pg); DMMP_DLL_LOCAL void _dmmp_path_group_array_free (struct dmmp_path_group **dmmp_pgs, uint32_t dmmp_pg_count); -DMMP_DLL_LOCAL void _dmmp_path_free(struct dmmp_path *dmmp_p); -DMMP_DLL_LOCAL void _dmmp_log(struct dmmp_context *ctx, int priority, +DMMP_DLL_LOCAL void dmmp_path_free(struct dmmp_path *dmmp_p); +DMMP_DLL_LOCAL void dmmp_log(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, ...) __attribute__((format(printf, 6, 7))); DMMP_DLL_LOCAL void _dmmp_log_err_str(struct dmmp_context *ctx, int rc); -DMMP_DLL_LOCAL void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, +DMMP_DLL_LOCAL void dmmp_log_stderr(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, va_list args) @@ -146,7 +146,7 @@ DMMP_DLL_LOCAL void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, #define _dmmp_log_cond(ctx, prio, arg...) \ do { \ if (dmmp_context_log_priority_get(ctx) >= prio) \ - _dmmp_log(ctx, prio, __FILE__, __LINE__, __FUNCTION__, \ + dmmp_log(ctx, prio, __FILE__, __LINE__, __FUNCTION__, \ ## arg); \ } while (0) From patchwork Thu Aug 8 15:26:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757836 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17550190682 for ; Thu, 8 Aug 2024 15:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130836; cv=none; b=TRJAbcnRxSjdYf3djfIvVQMLdZILxGyf/jcd0OPDx5HgH8s/IE0R0LWuh7TB6CzaYiWWtt/LELHv6Qqn7dw0wtV02TgDSJrCLMT6miZBA2aPcRDcCcSJYjjX3UBtGwX8iL89v3dxcUbQH/i/SidfB6LE0O7Z9roovd/Ah/YYhBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130836; c=relaxed/simple; bh=UITF0GK3x0gHdrxw7aZ9RsS1odLlv/9Km/ahjukiO+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jedAFHg8MgxF2yCA4iYmd6LZCf4mWKJaOXf37LtIv9VWaR7BVxrtPchOpzeFMHqzqszCKPQq7zJQ1+2CP4Q96VRFW9OwE3ElsnVHqfepMnmoBr/9qhOZkgtZ2O/drW9QP2Z/Vz7yG4T+ho9BZOxT22I9nHktaxifRfwgCqeiLOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=eZUyyz6E; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="eZUyyz6E" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a7a843bef98so123077866b.2 for ; Thu, 08 Aug 2024 08:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130832; x=1723735632; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lx2Ry9m27Y+YF0+rvsvzW+CFu1I6ZWccCIgkqAnmUFQ=; b=eZUyyz6EQEtXHLY3ZBTLT1dJP4BnkR4HTpZSRsP+yI6rh8OBEOoNaWlHXYNU59pV4D 5Fqqa2FzWOjgjS0Vf+18rJEFk2H4LZo8+PvUQw/6MP7oECAvXgAYa9xKYMsrzdSjQ3d2 zhFVIPa6iKVvEr0bABSUg8uYy05vEu3bYv8zDLNaA5DHPZzo1PGgi4IXVWHsLtJKvRf2 tLYJ/LWqUvtW5YcHmegUOk3/K1/DNtOYGZoZ4cYRuOqBDZcD2ebe41eqUWlR56UCBfBG vLVl6dVZKcxOJMHfbWyTOXQ/Ij3ZDIyK2XpvF3JVxVICo15fN7/sSs/6m9MkFRVwf5/2 Ycew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130832; x=1723735632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lx2Ry9m27Y+YF0+rvsvzW+CFu1I6ZWccCIgkqAnmUFQ=; b=e09aIGQX85BsdMNA+rYwfFtbo6GOnfM7G3DTy353LRosqzGG+AL60mJ4ckq36wiQMI gKK0oM4ktI0Ei7QfcDZr+TrvZTxa5dI0mn+HAQnsa+pAKsov0Q6gYJmUdjSzfFFu4S8L TdH/uYWqED38zHeQUwliy9NU+BU8PCbiE7fhePS58MtAQhs66Qf1YizvFTQ3Mb/UYzr5 X7nUlBKRR+i5tjncfjpJIPmBrOPIFYrSkLSWd/D5TnansE94x/IbK1sfRA2sPSvmlrB+ Fff0DaNEmcjA3RrqtLuTfFtKLvNgPcjzqyQd7x9XszAwQaqDX4xCUy0eci4f38HPpkXG 56Pw== X-Gm-Message-State: AOJu0YxHIWpV/vPBeFJA676K4+VvktS+uM78VzICGoz7JPgs6k9veCkW qsD0oT+z/fVKYUvEeM7hhYvpN0MRF1Thsdr/XTaHXDS/F6yMHyuMy/nFwpFjuz0= X-Google-Smtp-Source: AGHT+IG/KZ5qGeZpUtX1G1lRk9npFMgzRRBqz1Y9GkNTiTUYOct0lS0q+fBENto/4/srgyr+CkCIWw== X-Received: by 2002:a17:906:cae8:b0:a7a:8bf9:a6e8 with SMTP id a640c23a62f3a-a8090d94773mr162492966b.35.1723130832102; Thu, 08 Aug 2024 08:27:12 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9ecad3esm748882566b.206.2024.08.08.08.27.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:11 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 37/41] multipathd: rename symbols with double leading underscore Date: Thu, 8 Aug 2024 17:26:16 +0200 Message-ID: <20240808152620.93965-38-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Also remove last mentions of __setup_multipath(), which has been removed in e5debe0 ("multipathd: don't modify the multipath device on show commands"). Signed-off-by: Martin Wilck --- multipathd/cli.c | 2 +- multipathd/cli.h | 6 +++--- multipathd/dmevents.c | 2 +- multipathd/main.c | 30 +++++++++++++++--------------- multipathd/waiter.c | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/multipathd/cli.c b/multipathd/cli.c index 0c89b7c..139a4c4 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -114,7 +114,7 @@ find_handler (uint32_t fp) } int -__set_handler_callback (uint32_t fp, cli_handler *fn, bool locked) +set_handler_callback__ (uint32_t fp, cli_handler *fn, bool locked) { struct handler *h; diff --git a/multipathd/cli.h b/multipathd/cli.h index 2940832..dd26a2c 100644 --- a/multipathd/cli.h +++ b/multipathd/cli.h @@ -137,9 +137,9 @@ struct handler { }; int alloc_handlers (void); -int __set_handler_callback (uint32_t fp, cli_handler *fn, bool locked); -#define set_handler_callback(fp, fn) __set_handler_callback(fp, fn, true) -#define set_unlocked_handler_callback(fp, fn) __set_handler_callback(fp, fn, false) +int set_handler_callback__ (uint32_t fp, cli_handler *fn, bool locked); +#define set_handler_callback(fp, fn) set_handler_callback__(fp, fn, true) +#define set_unlocked_handler_callback(fp, fn) set_handler_callback__(fp, fn, false) int get_cmdvec (char *cmd, vector *v, bool allow_incomplete); struct handler *find_handler_for_cmdvec(const struct _vector *v); diff --git a/multipathd/dmevents.c b/multipathd/dmevents.c index af1e12e..7a78b8f 100644 --- a/multipathd/dmevents.c +++ b/multipathd/dmevents.c @@ -202,7 +202,7 @@ fail: return -1; } -/* You must call __setup_multipath() after calling this function, to +/* You must call setup_multipath() after calling this function, to * deal with any events that came in before the device was added */ int watch_dmevents(char *name) { diff --git a/multipathd/main.c b/multipathd/main.c index bb19c97..229b516 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -131,7 +131,7 @@ static int poll_dmevents = 1; /* Don't access this variable without holding config_lock */ static enum daemon_status running_state = DAEMON_INIT; /* Don't access this variable without holding config_lock */ -static bool __delayed_reconfig; +static bool delayed_reconfig; /* Don't access this variable without holding config_lock */ static enum force_reload_types reconfigure_pending = FORCE_RELOAD_NONE; pid_t daemon_pid; @@ -243,7 +243,7 @@ static void config_cleanup(__attribute__((unused)) void *arg) pthread_mutex_unlock(&config_lock); } -#define __wait_for_state_change(condition, ms) \ +#define wait_for_state_change__(condition, ms) \ ({ \ struct timespec tmo; \ int rc = 0; \ @@ -275,14 +275,14 @@ enum daemon_status wait_for_state_change_if(enum daemon_status oldstate, pthread_mutex_lock(&config_lock); pthread_cleanup_push(config_cleanup, NULL); - __wait_for_state_change(running_state == oldstate, ms); + wait_for_state_change__(running_state == oldstate, ms); st = running_state; pthread_cleanup_pop(1); return st; } /* must be called with config_lock held */ -static void __post_config_state(enum daemon_status state) +static void post_config_state__(enum daemon_status state) { if (state != running_state && running_state != DAEMON_SHUTDOWN) { enum daemon_status old_state = running_state; @@ -299,7 +299,7 @@ void post_config_state(enum daemon_status state) { pthread_mutex_lock(&config_lock); pthread_cleanup_push(config_cleanup, NULL); - __post_config_state(state); + post_config_state__(state); pthread_cleanup_pop(1); } @@ -308,15 +308,15 @@ static bool unblock_reconfigure(void) bool was_delayed; pthread_mutex_lock(&config_lock); - was_delayed = __delayed_reconfig; + was_delayed = delayed_reconfig; if (was_delayed) { - __delayed_reconfig = false; + delayed_reconfig = false; /* * In IDLE state, make sure child() is woken up * Otherwise it will wake up when state switches to IDLE */ if (running_state == DAEMON_IDLE) - __post_config_state(DAEMON_CONFIGURE); + post_config_state__(DAEMON_CONFIGURE); } pthread_mutex_unlock(&config_lock); if (was_delayed) @@ -350,7 +350,7 @@ void schedule_reconfigure(enum force_reload_types requested_type) break; case DAEMON_IDLE: reconfigure_pending = type; - __post_config_state(DAEMON_CONFIGURE); + post_config_state__(DAEMON_CONFIGURE); break; case DAEMON_CONFIGURE: case DAEMON_RUNNING: @@ -378,7 +378,7 @@ static enum daemon_status set_config_state(enum daemon_status state) } if (rc == 0 && running_state == DAEMON_IDLE && state != DAEMON_IDLE) - __post_config_state(state); + post_config_state__(state); st = running_state; pthread_cleanup_pop(1); @@ -3749,17 +3749,17 @@ child (__attribute__((unused)) void *param) /* * Check if another reconfigure request was scheduled * while we last ran reconfigure(). - * We have to test __delayed_reconfig here + * We have to test delayed_reconfig here * to avoid a busy loop */ (reconfigure_pending == FORCE_RELOAD_NONE - || __delayed_reconfig)) + || delayed_reconfig)) pthread_cond_wait(&config_cond, &config_lock); if (running_state != DAEMON_CONFIGURE && running_state != DAEMON_SHUTDOWN) /* This sets running_state to DAEMON_CONFIGURE */ - __post_config_state(DAEMON_CONFIGURE); + post_config_state__(DAEMON_CONFIGURE); state = running_state; pthread_cleanup_pop(1); if (state == DAEMON_SHUTDOWN) @@ -3776,13 +3776,13 @@ child (__attribute__((unused)) void *param) reload_type = reconfigure_pending == FORCE_RELOAD_YES ? FORCE_RELOAD_YES : FORCE_RELOAD_WEAK; reconfigure_pending = FORCE_RELOAD_NONE; - __delayed_reconfig = false; + delayed_reconfig = false; pthread_mutex_unlock(&config_lock); rc = reconfigure(vecs, reload_type); } else { pthread_mutex_lock(&config_lock); - __delayed_reconfig = true; + delayed_reconfig = true; pthread_mutex_unlock(&config_lock); condlog(3, "delaying reconfigure()"); } diff --git a/multipathd/waiter.c b/multipathd/waiter.c index 1dd93c5..f251c50 100644 --- a/multipathd/waiter.c +++ b/multipathd/waiter.c @@ -56,7 +56,7 @@ void stop_waiter_thread (struct multipath *mpp) mpp->alias); return; } - /* Don't cancel yourself. __setup_multipath is called by + /* Don't cancel yourself. setup_multipath is called by by the waiter thread, and may remove a multipath device */ if (pthread_equal(mpp->waiter, pthread_self())) return; From patchwork Thu Aug 8 15:26:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757837 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EE5619046C for ; Thu, 8 Aug 2024 15:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130837; cv=none; b=F54AEEuM48MDSnKMw3LCEfa4jSghZrgZOW1J3afU9KQnC7huSutJYVSqGXA27GRr8f75QELcqwT0mLVTNwzDHW3WgHHTzB3HTVsRW5ea/CbVunDjMePUKxaF4rR+80asjT578UW4MIC1BWPb6DlljwG/OE93H9Xs33kefwt+AkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130837; c=relaxed/simple; bh=CYbxxxt4EPqdTrKfRONwjdlRu2xuvzA3sG7xSjQwvco=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZGqxBVfrGRwXLNcagBLO5vWuLUYYaH6wfMMIjiyXxhpllu9xiXXNuNsHhwP6+hf/qq2GXc+AlS3AjwvF3bxBAa1gfbRcothaWZxu/o0HrG/7s/sSRl6VQefG8aaS9YMEsZVIdb1MlBm6yiOtbjwCEZDMO3ab6r+V/2OHiHAGTJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=bJtUmb1Q; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="bJtUmb1Q" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a7a94478a4eso352066366b.1 for ; Thu, 08 Aug 2024 08:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130833; x=1723735633; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y6iPYtrqlca+GAQmY0VXtcBcvQFpvgb9k62+cjGxXV0=; b=bJtUmb1QGIjlzZfRVM14m6YlYQQ+qEKMWih22W4NkHhEn9MeHbT+Hde3Vm86N73GEj aOIVI2Qnv6AALbFkTaUiaxhxcpSVjiokS2t5i0Nj8X/Et63IYiU9DfrwpesyZeWfQ7A6 CfZP75OhEEsw37n3Py/V5RbFdhtgULDcT2C0PrbQ9H/j2ti6Bv2eHDJCXmXu7WjhwxWv U5p1Ex3UcwtakXagmRwsZ8eutQv5Y051SHTEXpBdfM+XqGzt/xAyYkAI3gGa5k2CzkUi S3Sc65pGmAsvD/Xgoa5TWHbX9ZAn/QhLtnxjrO8AxEWvgOjIgnDevLcK/hFJ7EWiSAWD GcWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130833; x=1723735633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6iPYtrqlca+GAQmY0VXtcBcvQFpvgb9k62+cjGxXV0=; b=h+4FuL1os7/n1vA+kDyZi7oPp846Q5sgxWRffwLX93vt2Glng9zgm+OQFyMOPf3NfY tyuUWe8Z+iZC/imazfoKPjkDffjkHae+JMDLaf4iECPumu0cHJ8DXhg3Le4nK5W2ngh6 v34ejnHTZXjtHcT1OwRp+f7OCVgHjjGWpTCj9Lg4jo3acs/+xuXfirtsoUPsHzuMXt+C ysMe475tI5nZVsRYgZe2D928NQEBcJUAhM2ooqk5DnjBHe2lYxcv1YDeA32uoyd/N0L/ C99CjZa7KGfsAqlX+TPFFPghMCteVgeY9l0lMcmvoSm7jnAEWhyWiEBSGoQuB4t2CcOO CAnA== X-Gm-Message-State: AOJu0YyW7bmJyBtMkeQ/8+OqHfgiyq1/OiVeQ5vYFgKP6P/HQI48B6kS hytJXvSyjfwAhnhmjvdTAPW+utdxgQzGIGgt5n/vLr/c+PDtaynmFYscPoiy4ww= X-Google-Smtp-Source: AGHT+IHyulFNhyBSJ4tBi/DlYtpWFXsnCUYxPLm+qE2/Jz7VwLhqkXIQsKXUlr2k1w29vho0hRk70g== X-Received: by 2002:a17:907:a0c:b0:a72:66d5:892c with SMTP id a640c23a62f3a-a8091f5aba8mr217492066b.18.1723130833143; Thu, 08 Aug 2024 08:27:13 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0cbe6sm751758766b.71.2024.08.08.08.27.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:12 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 38/41] multipath-tools tests: rename functions with double underscores Date: Thu, 8 Aug 2024 17:26:17 +0200 Message-ID: <20240808152620.93965-39-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- tests/alias.c | 42 +++++++++++++++++++++--------------------- tests/test-lib.c | 4 ++-- tests/test-lib.h | 16 ++++++++-------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/alias.c b/tests/alias.c index 4f23cf9..163d9a7 100644 --- a/tests/alias.c +++ b/tests/alias.c @@ -25,7 +25,7 @@ #define MPATH_ID_INT_MAX_p1 "fxshrxx" #endif -static int __set_errno(int err) +static int set_errno__(int err) { if (err >= 0) { errno = 0; @@ -63,12 +63,12 @@ ssize_t __wrap_write(int fd, const void *buf, size_t count) start = strstr(start, binding); check_expected(count); assert_ptr_not_equal(start, NULL); - return __set_errno(mock_type(int)); + return set_errno__(mock_type(int)); } int __wrap_rename(const char *old, const char *new) { - return __set_errno(mock_type(int)); + return set_errno__(mock_type(int)); } int WRAP_FUNC(mkstemp)(char *template) @@ -134,7 +134,7 @@ int __wrap_pthread_mutex_unlock(pthread_mutex_t *mutex) #define TEST_FPTR ((FILE *) 0xaffe) /* strbuf wrapper for the old format_devname() */ -static int __format_devname(char *name, int id, size_t len, const char *prefix) +static int format_devname__(char *name, int id, size_t len, const char *prefix) { STRBUF_ON_STACK(buf); @@ -151,7 +151,7 @@ static void fd_mpatha(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 1, sizeof(buf), "FOO"); + rc = format_devname__(buf, 1, sizeof(buf), "FOO"); assert_int_equal(rc, 4); assert_string_equal(buf, "FOOa"); } @@ -162,7 +162,7 @@ static void fd_mpathz(void **state) char buf[5]; int rc; - rc = __format_devname(buf, 26, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26, sizeof(buf), "FOO"); assert_int_equal(rc, 4); assert_string_equal(buf, "FOOz"); } @@ -172,7 +172,7 @@ static void fd_mpathaa(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26 + 1, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26 + 1, sizeof(buf), "FOO"); assert_int_equal(rc, 5); assert_string_equal(buf, "FOOaa"); } @@ -182,7 +182,7 @@ static void fd_mpathzz(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26*26 + 26, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26*26 + 26, sizeof(buf), "FOO"); assert_int_equal(rc, 5); assert_string_equal(buf, "FOOzz"); } @@ -192,7 +192,7 @@ static void fd_mpathaaa(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26*26 + 27, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26*26 + 27, sizeof(buf), "FOO"); assert_int_equal(rc, 6); assert_string_equal(buf, "FOOaaa"); } @@ -202,7 +202,7 @@ static void fd_mpathzzz(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26*26*26 + 26*26 + 26, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26*26*26 + 26*26 + 26, sizeof(buf), "FOO"); assert_int_equal(rc, 6); assert_string_equal(buf, "FOOzzz"); } @@ -212,7 +212,7 @@ static void fd_mpathaaaa(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26*26*26 + 26*26 + 27, sizeof(buf), "FOO"); + rc = format_devname__(buf, 26*26*26 + 26*26 + 27, sizeof(buf), "FOO"); assert_int_equal(rc, 7); assert_string_equal(buf, "FOOaaaa"); } @@ -222,7 +222,7 @@ static void fd_mpathzzzz(void **state) char buf[32]; int rc; - rc = __format_devname(buf, 26*26*26*26 + 26*26*26 + 26*26 + 26, + rc = format_devname__(buf, 26*26*26*26 + 26*26*26 + 26*26 + 26, sizeof(buf), "FOO"); assert_int_equal(rc, 7); assert_string_equal(buf, "FOOzzzz"); @@ -234,7 +234,7 @@ static void fd_mpath_max(void **state) char buf[32]; int rc; - rc = __format_devname(buf, INT_MAX, sizeof(buf), ""); + rc = format_devname__(buf, INT_MAX, sizeof(buf), ""); assert_int_equal(rc, strlen(MPATH_ID_INT_MAX)); assert_string_equal(buf, MPATH_ID_INT_MAX); } @@ -245,7 +245,7 @@ static void fd_mpath_max1(void **state) char buf[32]; int rc; - rc = __format_devname(buf, INT_MIN, sizeof(buf), ""); + rc = format_devname__(buf, INT_MIN, sizeof(buf), ""); assert_int_equal(rc, -1); } @@ -254,7 +254,7 @@ static void fd_mpath_short(void **state) char buf[4]; int rc; - rc = __format_devname(buf, 1, sizeof(buf), "FOO"); + rc = format_devname__(buf, 1, sizeof(buf), "FOO"); assert_int_equal(rc, -1); } @@ -263,7 +263,7 @@ static void fd_mpath_short1(void **state) char buf[5]; int rc; - rc = __format_devname(buf, 27, sizeof(buf), "FOO"); + rc = format_devname__(buf, 27, sizeof(buf), "FOO"); assert_int_equal(rc, -1); } @@ -388,7 +388,7 @@ static void sd_fd_many(void **state) int rc, i; for (i = 1; i < 5000; i++) { - rc = __format_devname(buf, i, sizeof(buf), "MPATH"); + rc = format_devname__(buf, i, sizeof(buf), "MPATH"); assert_in_range(rc, 6, 8); rc = scan_devname(buf, "MPATH"); assert_int_equal(rc, i); @@ -403,7 +403,7 @@ static void sd_fd_random(void **state) srandom(1); for (i = 1; i < 1000; i++) { n = random() & 0xffff; - rc = __format_devname(buf, n, sizeof(buf), "MPATH"); + rc = format_devname__(buf, n, sizeof(buf), "MPATH"); assert_in_range(rc, 6, 9); rc = scan_devname(buf, "MPATH"); assert_int_equal(rc, n); @@ -483,7 +483,7 @@ static void mock_self_alias(const char *alias, const char *wwid) expect_condlog(3, USED_STR(alias, wwid)); \ } while(0) -static void __mock_bindings_file(const char *content, bool conflict_ok) +static void mock_bindings_file__(const char *content, bool conflict_ok) { char *cnt __attribute__((cleanup(cleanup_charp))) = NULL; char *token, *savep = NULL; @@ -509,7 +509,7 @@ static void __mock_bindings_file(const char *content, bool conflict_ok) } static void mock_bindings_file(const char *content) { - return __mock_bindings_file(content, false); + return mock_bindings_file__(content, false); } static int teardown_bindings(void **state) @@ -1918,7 +1918,7 @@ static void order_test(int n, const struct random_aliases ra[], bool conflict_ok for (j = 0; j < n; j++) fill_bindings_random(&buf, ra[j].start, ra[j].end, ra[j].prefix); - __mock_bindings_file(get_strbuf_str(&buf), conflict_ok); + mock_bindings_file__(get_strbuf_str(&buf), conflict_ok); for (j = 0; j < n; j++) { bdg = VECTOR_SLOT(bindings, 0); diff --git a/tests/test-lib.c b/tests/test-lib.c index 88f35e9..99beccc 100644 --- a/tests/test-lib.c +++ b/tests/test-lib.c @@ -367,7 +367,7 @@ void mock_store_pathinfo(int mask, const struct mocked_path *mp) mock_pathinfo(mask, mp); } -struct path *__mock_path(vector pathvec, +struct path *mock_path__(vector pathvec, const char *vnd, const char *prd, const char *rev, const char *wwid, const char *dev, @@ -395,7 +395,7 @@ struct path *__mock_path(vector pathvec, } -struct multipath *__mock_multipath(struct vectors *vecs, struct path *pp) +struct multipath *mock_multipath__(struct vectors *vecs, struct path *pp) { struct multipath *mp; struct config *conf; diff --git a/tests/test-lib.h b/tests/test-lib.h index 61e67b2..ff54834 100644 --- a/tests/test-lib.h +++ b/tests/test-lib.h @@ -40,29 +40,29 @@ struct mocked_path *mocked_path_from_path(struct mocked_path *mp, void mock_pathinfo(int mask, const struct mocked_path *mp); void mock_store_pathinfo(int mask, const struct mocked_path *mp); -struct path *__mock_path(vector pathvec, +struct path *mock_path__(vector pathvec, const char *vnd, const char *prd, const char *rev, const char *wwid, const char *dev, unsigned int flags, int mask); #define mock_path(v, p) \ - __mock_path(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ + mock_path__(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ 0, default_mask) #define mock_path_flags(v, p, f) \ - __mock_path(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ + mock_path__(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ (f), default_mask) #define mock_path_blacklisted(v, p) \ - __mock_path(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ + mock_path__(hwt->vecs->pathvec, (v), (p), "0", NULL, NULL, \ BL_BY_DEVICE, default_mask) #define mock_path_wwid(v, p, w) \ - __mock_path(hwt->vecs->pathvec, (v), (p), "0", (w), NULL, \ + mock_path__(hwt->vecs->pathvec, (v), (p), "0", (w), NULL, \ 0, default_mask) #define mock_path_wwid_flags(v, p, w, f) \ - __mock_path(hwt->vecs->pathvec, (v), (p), "0", (w), \ + mock_path__(hwt->vecs->pathvec, (v), (p), "0", (w), \ NULL, (f), default_mask) -struct multipath *__mock_multipath(struct vectors *vecs, struct path *pp); -#define mock_multipath(pp) __mock_multipath(hwt->vecs, (pp)) +struct multipath *mock_multipath__(struct vectors *vecs, struct path *pp); +#define mock_multipath(pp) mock_multipath__(hwt->vecs, (pp)) #endif From patchwork Thu Aug 8 15:26:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757838 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2BBD190675 for ; Thu, 8 Aug 2024 15:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130837; cv=none; b=rltonU1mqPVECdWfY8HBnj9xJqxi0oeLJD9sipZ9m2MupRx7WTje+t2aAvSBv8b4IyI7M2OTK9Tf2qGZc44o6Wn+OP4Dv3zzyET752A1tglhJ9pflePceAU/bqs/2FtwhlpAWgmIR+wOuDmb8FW9d92PoGrfQxMtR0qGM6vixPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130837; c=relaxed/simple; bh=7Kdn/KFHYX3RbBFmoCe2CvtktFgtMBo9Jtrg+4NFSDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qIPpOlTE3kdTYvKoSKYCRlAOVZRVviZ1OGxpShJICkc8FCdPD6JSaVadOXTHeOoONVzANWSJnC7Ye5MlqbbOhZWfvKcixZKU41piR3eagbSQ4bFd9gnNB3VYWfrIAKOxNZb1cZUrD9hleV5ms7x6Dedvq/dziHcl8Rga9/MKB1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=RKXN9Bun; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="RKXN9Bun" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5a10bb7bcd0so1386126a12.3 for ; Thu, 08 Aug 2024 08:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130834; x=1723735634; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I/XdsqOqCHFaMfps4R4R6XrVW5FOI3Ba4w6ccUccRlY=; b=RKXN9BunLT5sr83lsWImP9t0Dr/BmbAALXrxsj0kCFlkU2nmH5jMPXCakyf1dKBinJ AF6/ivtASGQ8mufspZO8gE5ndiX8FggSLGjllMf80FXCn7lr3DXzMK7clWgH0LUrRoO1 iJFLjbVtXLuLtMZh/d78zi3oyMjR4i3KeTpjH41kVPE0+NuFiJmWFHSnzYO14nlCVcAm BDYmgxSeYNvXCaZZgQ7VuAhSTjofjSmd2qmHNX+jxNq+iA/+LwYnU6gUmwbWbCZNQjHX NLVh/AQ/NMmrSc341dD7fznxUdqkLpHxEXV9RzSv7xEz7SHkeAO+HG6RcDcTgyMimKIa KK+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130834; x=1723735634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I/XdsqOqCHFaMfps4R4R6XrVW5FOI3Ba4w6ccUccRlY=; b=eLv0FgpOVtwuchTdgnS9jDI5gUsaRbCusilfTdeYUpyVJ8n6vJcsCFl4Dkva0fzWAU xE4KWI13T7vRTuWSrdcj/tgL0QsoSIHmxoikRGFdldkGHC5u3bLE9ty0Uj3JrMI00Ryz QaYa5yRD6lkWEggGxqdaOMCC6YQ0gVWCalJdSIE0Sm3woMgpMKj9aYQKFV53xGZMdmtI vvR7uUfrDjEULvloSrpwDZ5GYWHsLbrwFJ7Vi0f1bM1WUKeDGxQBWDQRPJSvGs5ueB2S e+49ULfoYghAYLCFha56P/Rzp7z8WXh+1VbsHY21TU8UsVIAeAQuXVCgGC0FRiGVw0Qe 70OA== X-Gm-Message-State: AOJu0Yy8BGtaNLWmSX2EK6f+CGMG8r76Fm32DpyyzmgHM/hynuOp61n8 oUGqwNhaS6NPODt/9kS4GGugSbEpiWkTXRmY6Ur3XYx1o6yWGlYldHV5MgFXn8I= X-Google-Smtp-Source: AGHT+IE2JEoLZ++Jq42+Qyg7IpjQcKnSnDw0gsdgrkRMANlIZPf6fckeqySNHcU3SAmE8QLcrWlSJw== X-Received: by 2002:a17:907:5c3:b0:a7a:c106:3659 with SMTP id a640c23a62f3a-a8090ef56e8mr162972766b.60.1723130834089; Thu, 08 Aug 2024 08:27:14 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a7dc9c0ca0bsm750999966b.74.2024.08.08.08.27.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:13 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 39/41] kpartx: rename macros with leading underscores Date: Thu, 8 Aug 2024 17:26:18 +0200 Message-ID: <20240808152620.93965-40-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Martin Wilck --- kpartx/devmapper.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c index bf07838..d49c680 100644 --- a/kpartx/devmapper.c +++ b/kpartx/devmapper.c @@ -13,16 +13,16 @@ #include "devmapper.h" #include "kpartx.h" -#define _UUID_PREFIX "part" -#define UUID_PREFIX _UUID_PREFIX "%d-" -#define _UUID_PREFIX_LEN (sizeof(_UUID_PREFIX) - 1) -#define MAX_PREFIX_LEN (_UUID_PREFIX_LEN + 4) +#define UUID_PREFIX_ "part" +#define UUID_PREFIX UUID_PREFIX_ "%d-" +#define UUID_PREFIX_LEN (sizeof(UUID_PREFIX_) - 1) +#define MAX_PREFIX_LEN (UUID_PREFIX_LEN + 4) #define PARAMS_SIZE 1024 #ifdef LIBDM_API_COOKIE -# define __DM_API_COOKIE_UNUSED__ /* empty */ +# define DM_API_COOKIE_UNUSED__ /* empty */ #else -# define __DM_API_COOKIE_UNUSED__ __attribute__((unused)) +# define DM_API_COOKIE_UNUSED__ __attribute__((unused)) #endif int dm_prereq(char * str, uint32_t x, uint32_t y, uint32_t z) @@ -60,7 +60,7 @@ out: return r; } -int dm_simplecmd(int task, const char *name, int no_flush, __DM_API_COOKIE_UNUSED__ uint16_t udev_flags) +int dm_simplecmd(int task, const char *name, int no_flush, DM_API_COOKIE_UNUSED__ uint16_t udev_flags) { int r = 0; #ifdef LIBDM_API_COOKIE @@ -496,12 +496,12 @@ dm_compare_uuid(const char *mapuuid, const char *partname) if (!partuuid) return 1; - if (!strncmp(partuuid, _UUID_PREFIX, _UUID_PREFIX_LEN)) { - char *p = partuuid + _UUID_PREFIX_LEN; + if (!strncmp(partuuid, UUID_PREFIX_, UUID_PREFIX_LEN)) { + char *p = partuuid + UUID_PREFIX_LEN; /* skip partition number */ while (isdigit(*p)) p++; - if (p != partuuid + _UUID_PREFIX_LEN && *p == '-' && + if (p != partuuid + UUID_PREFIX_LEN && *p == '-' && !strcmp(mapuuid, p + 1)) r = 0; } From patchwork Thu Aug 8 15:26:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757840 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A3EC19149D for ; Thu, 8 Aug 2024 15:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130840; cv=none; b=qPw1GQk/JZ3c0ctN8eCnIO30HtnNZ5CL9asHHKAEnQdNO4mRlc4VHrFFNw/VEXzHwcTolG4d3+PNeawl4QL4JdMYd2rxEv9aVBkmf51RAxLUeoBwAGDCamtElfnFZhC6QA5Z9+aCZ/5CUMPiUWylOiX2uTdk1OXf4iWwhMY7FkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130840; c=relaxed/simple; bh=mOKErOpkCYdiQeRbBmnaPysfFkGdTVlB2F99QRJhThw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=heSEgUH8+X6Wch7rn9Xyu/qtwAyO+WdU4yQ+DwkTxK7vJTIqgd5yhyjBQItgI4t0Ex/5YDYBFFgE0AU6lrE/RfDgSaEAskHAlewSb87rsvEX/3aEFU3ecS1FT8NO926KipM9Kw0GEN3qmJGPZqCF8f+H1grqvapEBpVAMjviPqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=UJ4bNDuT; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="UJ4bNDuT" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5b01af9b0c9so1192835a12.3 for ; Thu, 08 Aug 2024 08:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130836; x=1723735636; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k0jdmXW00GtjmZYAeczU5EBbaauVBFiQ2MS4xCMs25c=; b=UJ4bNDuTYLLgr85GZEScveNWGuQp0QMlyE0e5e02EhjI0If93zTHwR61l7LpO5v38h pm0ywV+LMU2mxhDQEYygx/stYIEdyuENTQBNPHAzkg63akEHRNFj5DZ50W0cyoxiF7Ny I+x2atG3aiQVlurGh2+R1DH99uUtkdPHilfgERouonDSxwpdBxiGw9PYju9U2JbOeosM dD4j0eQ8aNNB6UOdjlidB/hSzUXDvL8n4VoavspC+ajQPLoPX/5B1k2yekxRDkmHsGTJ H+x/JaD3irOARL4YI4BwV4npbw5mOVlC5DarEWRZzwb14/6zZm5dmTXABlYWb7gOx8jS QE0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130836; x=1723735636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k0jdmXW00GtjmZYAeczU5EBbaauVBFiQ2MS4xCMs25c=; b=oUydbSe0VZcoP0wQ8pOHTU1MjYZbAYkyPSkw5KrSUTWT/rBEPqPoms8hPqTKDRjyyY j0vJJeRMjSosksUg7jUXASDWQTwNWg87kyQvw1HWiiCXL9vqRi/T0qOr86OubC/zBflR kq3K4hzLGSSlh5w8K/kzmbNnZWHaHa2+Eln/qdpj0zcLqBdeGgmvNBx5N/PtMXkmNgBC mQ65Uw1i4FJ58ydNpwHXNrcxeXjPgIKVv9qWftndkShuIfcciYgw4d4XZz+ffP+pG37w xbLEHOGke9+6pASb6FVXWxHY6ER7yba7Dq1CLTfj1X8IHYkjgtKX1nNbJp+iFT87MLkr IY9g== X-Gm-Message-State: AOJu0Yz4g8Wrglmbr4IErfpjCBciTzVjZEGm7IPzfChBg7dHQm7lclql bYz3EV9b42r3f978XkjYqB/P38X4ETrW1zkDHMePT0GznWQyPy8w8/7dw1/vpI4= X-Google-Smtp-Source: AGHT+IFI+H8Bwko+OGlbj/xxiDbTGRca77L7q8jHkXU1q2/9U2TIq8k+8aDR3mp1HG4gdWnfI+CPlA== X-Received: by 2002:a05:6402:4403:b0:5bb:9aff:3e30 with SMTP id 4fb4d7f45d1cf-5bbb23e5403mr1739479a12.31.1723130835169; Thu, 08 Aug 2024 08:27:15 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2c40084sm726187a12.37.2024.08.08.08.27.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:14 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 40/41] libmpathutil: rename struct _vector to vector_s Date: Thu, 8 Aug 2024 17:26:19 +0200 Message-ID: <20240808152620.93965-41-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This isn't strictly required by glibc, but "struct _vector" is now the only public identifier starting with underscore, so let's replace it, too. Signed-off-by: Martin Wilck --- libmpathutil/vector.c | 2 +- libmpathutil/vector.h | 6 +++--- libmultipath/alias.c | 2 +- libmultipath/blacklist.c | 14 +++++++------- libmultipath/blacklist.h | 8 ++++---- libmultipath/config.c | 8 ++++---- libmultipath/config.h | 6 +++--- libmultipath/configure.c | 2 +- libmultipath/configure.h | 2 +- libmultipath/discovery.c | 10 +++++----- libmultipath/dm-generic.c | 8 ++++---- libmultipath/dmparser.c | 2 +- libmultipath/dmparser.h | 2 +- libmultipath/foreign.c | 12 ++++++------ libmultipath/foreign.h | 8 ++++---- libmultipath/foreign/nvme.c | 20 ++++++++++---------- libmultipath/generic.h | 8 ++++---- libmultipath/io_err_stat.c | 4 ++-- libmultipath/print.c | 22 +++++++++++----------- libmultipath/print.h | 10 +++++----- libmultipath/structs.c | 12 ++++++------ libmultipath/structs.h | 12 ++++++------ libmultipath/structs_vec.c | 2 +- libmultipath/structs_vec.h | 2 +- libmultipath/valid.c | 10 +++++----- multipathd/cli.c | 4 ++-- multipathd/cli.h | 4 ++-- multipathd/cli_handlers.c | 6 +++--- multipathd/main.c | 4 ++-- tests/valid.c | 4 ++-- 30 files changed, 108 insertions(+), 108 deletions(-) diff --git a/libmpathutil/vector.c b/libmpathutil/vector.c index 7c3ce43..5392b37 100644 --- a/libmpathutil/vector.c +++ b/libmpathutil/vector.c @@ -30,7 +30,7 @@ vector vector_alloc(void) { - vector v = (vector) calloc(1, sizeof (struct _vector)); + vector v = (vector) calloc(1, sizeof (struct vector_s)); return v; } diff --git a/libmpathutil/vector.h b/libmpathutil/vector.h index 2df1505..8c5617b 100644 --- a/libmpathutil/vector.h +++ b/libmpathutil/vector.h @@ -26,11 +26,11 @@ #include /* vector definition */ -struct _vector { +struct vector_s { int allocated; void **slot; }; -typedef struct _vector *vector; +typedef struct vector_s *vector; #define VECTOR_DEFAULT_SIZE 1 #define VECTOR_SIZE(V) ((V) ? ((V)->allocated) / VECTOR_DEFAULT_SIZE : 0) @@ -53,7 +53,7 @@ typedef struct _vector *vector; */ #define vector_convert(new, vec, type, conv) \ ({ \ - const struct _vector *__v = (vec); \ + const struct vector_s *__v = (vec); \ vector __t = (new); \ type *__j; \ int __i; \ diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 5c8ac93..ea6c7b4 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -70,7 +70,7 @@ struct binding { * Perhaps one day we'll implement this more efficiently, thus use * an abstract type. */ -typedef struct _vector Bindings; +typedef struct vector_s Bindings; /* Protect global_bindings */ static pthread_mutex_t bindings_mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c index 75100b2..17e1b54 100644 --- a/libmultipath/blacklist.c +++ b/libmultipath/blacklist.c @@ -141,7 +141,7 @@ out: } static int -match_reglist (const struct _vector *blist, const char *str) +match_reglist (const struct vector_s *blist, const char *str) { int i; struct blentry * ble; @@ -154,7 +154,7 @@ match_reglist (const struct _vector *blist, const char *str) } static int -match_reglist_device (const struct _vector *blist, const char *vendor, +match_reglist_device (const struct vector_s *blist, const char *vendor, const char * product) { int i; @@ -175,7 +175,7 @@ match_reglist_device (const struct _vector *blist, const char *vendor, } static int -find_blacklist_device (const struct _vector *blist, const char *vendor, +find_blacklist_device (const struct vector_s *blist, const char *vendor, const char *product) { int i; @@ -316,7 +316,7 @@ log_filter (const char *dev, const char *vendor, const char *product, } int -filter_device (const struct _vector *blist, const struct _vector *elist, +filter_device (const struct vector_s *blist, const struct vector_s *elist, const char *vendor, const char * product, const char *dev) { int r = MATCH_NOTHING; @@ -333,7 +333,7 @@ filter_device (const struct _vector *blist, const struct _vector *elist, } int -filter_devnode (const struct _vector *blist, const struct _vector *elist, +filter_devnode (const struct vector_s *blist, const struct vector_s *elist, const char *dev) { int r = MATCH_NOTHING; @@ -350,7 +350,7 @@ filter_devnode (const struct _vector *blist, const struct _vector *elist, } int -filter_wwid (const struct _vector *blist, const struct _vector *elist, +filter_wwid (const struct vector_s *blist, const struct vector_s *elist, const char *wwid, const char *dev) { int r = MATCH_NOTHING; @@ -367,7 +367,7 @@ filter_wwid (const struct _vector *blist, const struct _vector *elist, } int -filter_protocol(const struct _vector *blist, const struct _vector *elist, +filter_protocol(const struct vector_s *blist, const struct vector_s *elist, const struct path *pp) { STRBUF_ON_STACK(buf); diff --git a/libmultipath/blacklist.h b/libmultipath/blacklist.h index 244c59d..f32b582 100644 --- a/libmultipath/blacklist.h +++ b/libmultipath/blacklist.h @@ -36,16 +36,16 @@ struct blentry_device { int setup_default_blist (struct config *); int alloc_ble_device (vector); -int filter_devnode (const struct _vector *, const struct _vector *, +int filter_devnode (const struct vector_s *, const struct vector_s *, const char *); -int filter_wwid (const struct _vector *, const struct _vector *, +int filter_wwid (const struct vector_s *, const struct vector_s *, const char *, const char *); -int filter_device (const struct _vector *, const struct _vector *, +int filter_device (const struct vector_s *, const struct vector_s *, const char *, const char *, const char *); int filter_path (const struct config *, const struct path *); int filter_property(const struct config *, struct udev_device *, int, const char*); -int filter_protocol(const struct _vector *, const struct _vector *, +int filter_protocol(const struct vector_s *, const struct vector_s *, const struct path *); int store_ble (vector, const char *, int); int set_ble_device (vector, const char *, const char *, int); diff --git a/libmultipath/config.c b/libmultipath/config.c index b742fb4..2d2b507 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -114,7 +114,7 @@ hwe_strmatch (const struct hwentry *hwe1, const struct hwentry *hwe2) } static struct hwentry * -find_hwe_strmatch (const struct _vector *hwtable, const struct hwentry *hwe) +find_hwe_strmatch (const struct vector_s *hwtable, const struct hwentry *hwe) { int i; struct hwentry *tmp, *ret = NULL; @@ -179,7 +179,7 @@ static void _log_match(const char *fn, const struct hwentry *h, #define log_match(h, v, p, r) _log_match(__func__, (h), (v), (p), (r)) int -find_hwe (const struct _vector *hwtable, +find_hwe (const struct vector_s *hwtable, const char * vendor, const char * product, const char * revision, vector result) { @@ -222,7 +222,7 @@ struct mpentry *find_mpe(vector mptable, char *wwid) return NULL; } -const char *get_mpe_wwid(const struct _vector *mptable, const char *alias) +const char *get_mpe_wwid(const struct vector_s *mptable, const char *alias) { int i; struct mpentry * mpe; @@ -1089,7 +1089,7 @@ out: const char *get_uid_attribute_by_attrs(const struct config *conf, const char *path_dev) { - const struct _vector *uid_attrs = &conf->uid_attrs; + const struct vector_s *uid_attrs = &conf->uid_attrs; int j; char *att, *col; diff --git a/libmultipath/config.h b/libmultipath/config.h index 181b78a..94cdf25 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -206,7 +206,7 @@ struct config { int auto_resize; char * selector; - struct _vector uid_attrs; + struct vector_s uid_attrs; char * uid_attribute; char * features; char * hwhandler; @@ -286,11 +286,11 @@ int libmultipath_init(void); */ void libmultipath_exit(void); -int find_hwe (const struct _vector *hwtable, +int find_hwe (const struct vector_s *hwtable, const char * vendor, const char * product, const char *revision, vector result); struct mpentry * find_mpe (vector mptable, char * wwid); -const char *get_mpe_wwid (const struct _vector *mptable, const char *alias); +const char *get_mpe_wwid (const struct vector_s *mptable, const char *alias); struct hwentry * alloc_hwe (void); struct mpentry * alloc_mpe (void); diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 34158e3..a725798 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -630,7 +630,7 @@ select_reload_action(struct multipath *mpp, const char *reason) condlog(3, "%s: set ACT_RELOAD (%s)", mpp->alias, reason); } -void select_action (struct multipath *mpp, const struct _vector *curmp, +void select_action (struct multipath *mpp, const struct vector_s *curmp, int force_reload) { struct multipath * cmpp; diff --git a/libmultipath/configure.h b/libmultipath/configure.h index ca34442..f98a3b2 100644 --- a/libmultipath/configure.h +++ b/libmultipath/configure.h @@ -53,7 +53,7 @@ enum { struct vectors; int setup_map (struct multipath * mpp, char **params, struct vectors *vecs); -void select_action (struct multipath *mpp, const struct _vector *curmp, +void select_action (struct multipath *mpp, const struct vector_s *curmp, int force_reload); int domap (struct multipath * mpp, char * params, int is_daemon); int reinstate_paths (struct multipath *mpp); diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index f130a5c..e94705b 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1523,7 +1523,7 @@ get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen) } static int -scsi_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) +scsi_sysfs_pathinfo (struct path *pp, const struct vector_s *hwtable) { struct udev_device *parent; const char *attr_path = NULL; @@ -1594,7 +1594,7 @@ scsi_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) } static int -nvme_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) +nvme_sysfs_pathinfo (struct path *pp, const struct vector_s *hwtable) { struct udev_device *parent; const char *attr_path = NULL; @@ -1653,7 +1653,7 @@ nvme_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) } static int -ccw_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) +ccw_sysfs_pathinfo (struct path *pp, const struct vector_s *hwtable) { struct udev_device *parent; char attr_buff[NAME_SIZE]; @@ -1714,7 +1714,7 @@ ccw_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) } static int -cciss_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable) +cciss_sysfs_pathinfo (struct path *pp, const struct vector_s *hwtable) { const char * attr_path = NULL; struct udev_device *parent; @@ -1872,7 +1872,7 @@ path_offline (struct path * pp) } static int -sysfs_pathinfo(struct path *pp, const struct _vector *hwtable) +sysfs_pathinfo(struct path *pp, const struct vector_s *hwtable) { int r = common_sysfs_pathinfo(pp); diff --git a/libmultipath/dm-generic.c b/libmultipath/dm-generic.c index 1b42fa0..e49f9bb 100644 --- a/libmultipath/dm-generic.c +++ b/libmultipath/dm-generic.c @@ -24,7 +24,7 @@ #include "config.h" #include "print.h" -static const struct _vector* +static const struct vector_s* dm_mp_get_pgs(const struct gen_multipath *gmp) { return vector_convert(NULL, gen_multipath_to_dm(gmp)->pg, @@ -33,12 +33,12 @@ dm_mp_get_pgs(const struct gen_multipath *gmp) static void dm_mp_rel_pgs(__attribute__((unused)) const struct gen_multipath *gmp, - const struct _vector* v) + const struct vector_s* v) { vector_free_const(v); } -static const struct _vector* +static const struct vector_s* dm_pg_get_paths(const struct gen_pathgroup *gpg) { return vector_convert(NULL, gen_pathgroup_to_dm(gpg)->paths, @@ -47,7 +47,7 @@ dm_pg_get_paths(const struct gen_pathgroup *gpg) static void dm_mp_rel_paths(__attribute__((unused)) const struct gen_pathgroup *gpg, - const struct _vector* v) + const struct vector_s* v) { vector_free_const(v); } diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c index 3d85e6e..1d0506d 100644 --- a/libmultipath/dmparser.c +++ b/libmultipath/dmparser.c @@ -117,7 +117,7 @@ err: * Call update_pathvec_from_dm() after this function to make sure * all data structures are in a sane state. */ -int disassemble_map(const struct _vector *pathvec, +int disassemble_map(const struct vector_s *pathvec, const char *params, struct multipath *mpp) { char * word; diff --git a/libmultipath/dmparser.h b/libmultipath/dmparser.h index 43454c3..181967b 100644 --- a/libmultipath/dmparser.h +++ b/libmultipath/dmparser.h @@ -2,7 +2,7 @@ #define DMPARSER_H_INCLUDED int assemble_map (struct multipath *, char **); -int disassemble_map (const struct _vector *, const char *, struct multipath *); +int disassemble_map (const struct vector_s *, const char *, struct multipath *); int disassemble_status (const char *, struct multipath *); #endif diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index d23439e..28d1b11 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -451,7 +451,7 @@ void foreign_path_layout(fieldwidth_t *width) pthread_cleanup_push(unlock_foreigns, NULL); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; fgn->lock(fgn->context); pthread_cleanup_push(fgn->unlock, fgn->context); @@ -482,7 +482,7 @@ void foreign_multipath_layout(fieldwidth_t *width) pthread_cleanup_push(unlock_foreigns, NULL); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; fgn->lock(fgn->context); pthread_cleanup_push(fgn->unlock, fgn->context); @@ -507,7 +507,7 @@ static int snprint_foreign_topology__(struct strbuf *buf, int verbosity, size_t initial_len = get_strbuf_len(buf); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; const struct gen_multipath *gm; int j; @@ -561,7 +561,7 @@ void print_foreign_topology(int verbosity) } pthread_cleanup_push(unlock_foreigns, NULL); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; fgn->lock(fgn->context); pthread_cleanup_push(fgn->unlock, fgn->context); @@ -590,7 +590,7 @@ int snprint_foreign_paths(struct strbuf *buf, const char *style, pthread_cleanup_push(unlock_foreigns, NULL); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; const struct gen_path *gp; int j, ret = 0; @@ -630,7 +630,7 @@ int snprint_foreign_multipaths(struct strbuf *buf, const char *style, pthread_cleanup_push(unlock_foreigns, NULL); vector_foreach_slot(foreigns, fgn, i) { - const struct _vector *vec; + const struct vector_s *vec; const struct gen_multipath *gm; int j, ret = 0; diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h index 809824d..485fb2d 100644 --- a/libmultipath/foreign.h +++ b/libmultipath/foreign.h @@ -155,7 +155,7 @@ struct foreign { * @returns a vector of "struct gen_multipath*" with the map devices * belonging to this library (see generic.h). */ - const struct _vector* (*get_multipaths)(const struct context *); + const struct vector_s* (*get_multipaths)(const struct context *); /** * method: release_multipaths(context, mpvec) @@ -165,7 +165,7 @@ struct foreign { * @param[in] mpvec the vector allocated with get_multipaths() */ void (*release_multipaths)(const struct context *ctx, - const struct _vector* mpvec); + const struct vector_s* mpvec); /** * method: get_paths @@ -176,7 +176,7 @@ struct foreign { * @returns a vector of "struct gen_path*" with the path devices * belonging to this library (see generic.h) */ - const struct _vector* (*get_paths)(const struct context *); + const struct vector_s* (*get_paths)(const struct context *); /** * release data structures obtained with get_multipaths (if any) @@ -185,7 +185,7 @@ struct foreign { * @param[in] ppvec the vector allocated with get_paths() */ void (*release_paths)(const struct context *ctx, - const struct _vector* ppvec); + const struct vector_s* ppvec); void *handle; struct context *context; diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index 40b88f7..0b7f4ea 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@ -45,7 +45,7 @@ const char *THIS; struct nvme_map; struct nvme_pathgroup { struct gen_pathgroup gen; - struct _vector pathvec; + struct vector_s pathvec; }; struct nvme_path { @@ -66,7 +66,7 @@ struct nvme_map { struct udev_device *udev; struct udev_device *subsys; dev_t devt; - struct _vector pgvec; + struct vector_s pgvec; int nr_live; int ana_supported; }; @@ -114,7 +114,7 @@ static void cleanup_nvme_map(struct nvme_map *map) free(map); } -static const struct _vector* +static const struct vector_s* nvme_mp_get_pgs(const struct gen_multipath *gmp) { const struct nvme_map *nvme = const_gen_mp_to_nvme(gmp); @@ -124,7 +124,7 @@ nvme_mp_get_pgs(const struct gen_multipath *gmp) { static void nvme_mp_rel_pgs(__attribute__((unused)) const struct gen_multipath *gmp, - __attribute__((unused)) const struct _vector *v) + __attribute__((unused)) const struct vector_s *v) { /* empty */ } @@ -201,7 +201,7 @@ static int snprint_nvme_map(const struct gen_multipath *gmp, return append_strbuf_str(buff, N_A); } -static const struct _vector* +static const struct vector_s* nvme_pg_get_paths(const struct gen_pathgroup *gpg) { const struct nvme_pathgroup *gp = const_gen_pg_to_nvme(gpg); @@ -211,7 +211,7 @@ nvme_pg_get_paths(const struct gen_pathgroup *gpg) { static void nvme_pg_rel_paths(__attribute__((unused)) const struct gen_pathgroup *gpg, - __attribute__((unused)) const struct _vector *v) + __attribute__((unused)) const struct vector_s *v) { /* empty */ } @@ -916,14 +916,14 @@ void check(struct context *ctx) /* * It's safe to pass our internal pointer, this is only used under the lock. */ -const struct _vector *get_multipaths(const struct context *ctx) +const struct vector_s *get_multipaths(const struct context *ctx) { condlog(5, "%s called for \"%s\"", __func__, THIS); return ctx->mpvec; } void release_multipaths(__attribute__((unused)) const struct context *ctx, - __attribute__((unused)) const struct _vector *mpvec) + __attribute__((unused)) const struct vector_s *mpvec) { condlog(5, "%s called for \"%s\"", __func__, THIS); /* NOP */ @@ -932,7 +932,7 @@ void release_multipaths(__attribute__((unused)) const struct context *ctx, /* * It's safe to pass our internal pointer, this is only used under the lock. */ -const struct _vector * get_paths(const struct context *ctx) +const struct vector_s * get_paths(const struct context *ctx) { vector paths = NULL; const struct gen_multipath *gm; @@ -948,7 +948,7 @@ const struct _vector * get_paths(const struct context *ctx) } void release_paths(__attribute__((unused)) const struct context *ctx, - const struct _vector *mpvec) + const struct vector_s *mpvec) { condlog(5, "%s called for \"%s\"", __func__, THIS); vector_free_const(mpvec); diff --git a/libmultipath/generic.h b/libmultipath/generic.h index c8fe31c..2e4673b 100644 --- a/libmultipath/generic.h +++ b/libmultipath/generic.h @@ -43,7 +43,7 @@ struct gen_multipath_ops { * @param gmp: generic multipath object to act on * @returns a vector of const struct gen_pathgroup* */ - const struct _vector* (*get_pathgroups)(const struct gen_multipath*); + const struct vector_s* (*get_pathgroups)(const struct gen_multipath*); /** * method: rel_pathgroups(gmp, v) * free data allocated by get_pathgroups(), if any @@ -51,7 +51,7 @@ struct gen_multipath_ops { * @param v the value returned by get_pathgroups() */ void (*rel_pathgroups)(const struct gen_multipath*, - const struct _vector*); + const struct vector_s*); /** * method: snprint(gmp, buf, len, wildcard) * prints the property of the multipath map matching @@ -89,14 +89,14 @@ struct gen_pathgroup_ops { * @param gpg: generic pathgroup object to act on * @returns a vector of const struct gen_path* */ - const struct _vector* (*get_paths)(const struct gen_pathgroup*); + const struct vector_s* (*get_paths)(const struct gen_pathgroup*); /** * method: rel_paths(gpg, v) * free data allocated by get_paths(), if any * @param gmp: generic pathgroup object to act on * @param v the value returned by get_paths() */ - void (*rel_paths)(const struct gen_pathgroup*, const struct _vector*); + void (*rel_paths)(const struct gen_pathgroup*, const struct vector_s*); /** * Method snprint() * see gen_multipath_ops->snprint() above diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 1c59445..4996c0b 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -619,9 +619,9 @@ static void process_async_ios_event(int timeout_nsecs, char *dev) static void service_paths(void) { - struct _vector _pathvec = { .allocated = 0 }; + struct vector_s _pathvec = { .allocated = 0 }; /* avoid gcc warnings that &_pathvec will never be NULL in vector ops */ - struct _vector * const tmp_pathvec = &_pathvec; + struct vector_s * const tmp_pathvec = &_pathvec; struct io_err_stat_path *pp; int i; diff --git a/libmultipath/print.c b/libmultipath/print.c index 190c823..e536c5c 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -946,7 +946,7 @@ reset_width(fieldwidth_t *width, enum layout_reset reset, const char *header) } } -void get_path_layout__ (const struct _vector *gpvec, enum layout_reset reset, +void get_path_layout__ (const struct vector_s *gpvec, enum layout_reset reset, fieldwidth_t *width) { unsigned int i, j; @@ -987,7 +987,7 @@ void get_multipath_layout (vector mpvec, int header, fieldwidth_t *width) { } void -get_multipath_layout__ (const struct _vector *gmvec, enum layout_reset reset, +get_multipath_layout__ (const struct vector_s *gmvec, enum layout_reset reset, fieldwidth_t *width) { unsigned int i, j; @@ -1230,7 +1230,7 @@ void print_multipath_topology__(const struct gen_multipath *gmp, int verbosity) STRBUF_ON_STACK(buff); fieldwidth_t *p_width __attribute__((cleanup(cleanup_ucharp))) = NULL; const struct gen_pathgroup *gpg; - const struct _vector *pgvec, *pathvec; + const struct vector_s *pgvec, *pathvec; int j; p_width = alloc_path_layout(); @@ -1271,7 +1271,7 @@ int snprint_multipath_topology__(const struct gen_multipath *gmp, const fieldwidth_t *p_width) { int j, i, rc; - const struct _vector *pgvec; + const struct vector_s *pgvec; const struct gen_pathgroup *gpg; STRBUF_ON_STACK(style); size_t initial_len = get_strbuf_len(buff); @@ -1304,7 +1304,7 @@ int snprint_multipath_topology__(const struct gen_multipath *gmp, goto out; vector_foreach_slot (pgvec, gpg, j) { - const struct _vector *pathvec; + const struct vector_s *pathvec; struct gen_path *gp; bool last_group = j + 1 == VECTOR_SIZE(pgvec); @@ -1482,7 +1482,7 @@ snprint_pcentry (const struct config *conf, struct strbuf *buff, static int snprint_pctable (const struct config *conf, struct strbuf *buff, - const struct _vector *pctable) + const struct vector_s *pctable) { int i, rc; struct pcentry *pce; @@ -1526,7 +1526,7 @@ snprint_hwentry (const struct config *conf, } static int snprint_hwtable(const struct config *conf, struct strbuf *buff, - const struct _vector *hwtable) + const struct vector_s *hwtable) { int i, rc; struct hwentry * hwe; @@ -1552,7 +1552,7 @@ static int snprint_hwtable(const struct config *conf, struct strbuf *buff, static int snprint_mpentry (const struct config *conf, struct strbuf *buff, - const struct mpentry * mpe, const struct _vector *mpvec) + const struct mpentry * mpe, const struct vector_s *mpvec) { int i, rc; struct keyword * kw; @@ -1587,7 +1587,7 @@ snprint_mpentry (const struct config *conf, struct strbuf *buff, } static int snprint_mptable(const struct config *conf, struct strbuf *buff, - const struct _vector *mpvec) + const struct vector_s *mpvec) { int i, rc; struct mpentry * mpe; @@ -1909,7 +1909,7 @@ static int snprint_blacklist_except(const struct config *conf, } int snprint_config__(const struct config *conf, struct strbuf *buff, - const struct _vector *hwtable, const struct _vector *mpvec) + const struct vector_s *hwtable, const struct vector_s *mpvec) { int rc; @@ -1930,7 +1930,7 @@ int snprint_config__(const struct config *conf, struct strbuf *buff, } char *snprint_config(const struct config *conf, int *len, - const struct _vector *hwtable, const struct _vector *mpvec) + const struct vector_s *hwtable, const struct vector_s *mpvec) { STRBUF_ON_STACK(buff); char *reply; diff --git a/libmultipath/print.h b/libmultipath/print.h index 9c2aea4..489f1e7 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -17,11 +17,11 @@ enum layout_reset { /* fieldwidth_t is defined in generic.h */ fieldwidth_t *alloc_path_layout(void); -void get_path_layout__ (const struct _vector *gpvec, enum layout_reset, +void get_path_layout__ (const struct vector_s *gpvec, enum layout_reset, fieldwidth_t *width); void get_path_layout (vector pathvec, int header, fieldwidth_t *width); fieldwidth_t *alloc_multipath_layout(void); -void get_multipath_layout__ (const struct _vector *gmvec, enum layout_reset, +void get_multipath_layout__ (const struct vector_s *gmvec, enum layout_reset, fieldwidth_t *width); void get_multipath_layout (vector mpvec, int header, fieldwidth_t *width); int snprint_path_header(struct strbuf *, const char *, const fieldwidth_t *); @@ -41,10 +41,10 @@ int snprint_multipath_topology__ (const struct gen_multipath *, struct strbuf *, snprint_multipath_topology__ (dm_multipath_to_gen(mpp), buf, v, w) int snprint_multipath_topology_json(struct strbuf *, const struct vectors *vecs); int snprint_config__(const struct config *conf, struct strbuf *buff, - const struct _vector *hwtable, const struct _vector *mpvec); + const struct vector_s *hwtable, const struct vector_s *mpvec); char *snprint_config(const struct config *conf, int *len, - const struct _vector *hwtable, - const struct _vector *mpvec); + const struct vector_s *hwtable, + const struct vector_s *mpvec); int snprint_multipath_map_json(struct strbuf *, const struct multipath *mpp); int snprint_blacklist_report(struct config *, struct strbuf *); int snprint_wildcards(struct strbuf *); diff --git a/libmultipath/structs.c b/libmultipath/structs.c index 232b423..61c8f32 100644 --- a/libmultipath/structs.c +++ b/libmultipath/structs.c @@ -433,7 +433,7 @@ store_adaptergroup(vector adapters, struct adapter_group * agp) } struct multipath * -find_mp_by_minor (const struct _vector *mpvec, unsigned int minor) +find_mp_by_minor (const struct vector_s *mpvec, unsigned int minor) { int i; struct multipath * mpp; @@ -452,7 +452,7 @@ find_mp_by_minor (const struct _vector *mpvec, unsigned int minor) } struct multipath * -find_mp_by_wwid (const struct _vector *mpvec, const char * wwid) +find_mp_by_wwid (const struct vector_s *mpvec, const char * wwid) { int i; struct multipath * mpp; @@ -468,7 +468,7 @@ find_mp_by_wwid (const struct _vector *mpvec, const char * wwid) } struct multipath * -find_mp_by_alias (const struct _vector *mpvec, const char * alias) +find_mp_by_alias (const struct vector_s *mpvec, const char * alias) { int i; size_t len; @@ -491,7 +491,7 @@ find_mp_by_alias (const struct _vector *mpvec, const char * alias) } struct multipath * -find_mp_by_str (const struct _vector *mpvec, const char * str) +find_mp_by_str (const struct vector_s *mpvec, const char * str) { int minor; char dummy; @@ -510,7 +510,7 @@ find_mp_by_str (const struct _vector *mpvec, const char * str) } struct path * -find_path_by_dev (const struct _vector *pathvec, const char *dev) +find_path_by_dev (const struct vector_s *pathvec, const char *dev) { int i; struct path * pp; @@ -527,7 +527,7 @@ find_path_by_dev (const struct _vector *pathvec, const char *dev) } struct path * -find_path_by_devt (const struct _vector *pathvec, const char * dev_t) +find_path_by_devt (const struct vector_s *pathvec, const char * dev_t) { int i; struct path * pp; diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 56fb74b..074faca 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -564,14 +564,14 @@ int store_hostgroup(vector hostgroupvec, struct host_group *hgp); int store_path (vector pathvec, struct path * pp); int add_pathgroup(struct multipath*, struct pathgroup *); -struct multipath * find_mp_by_alias (const struct _vector *mp, const char *alias); -struct multipath * find_mp_by_wwid (const struct _vector *mp, const char *wwid); -struct multipath * find_mp_by_str (const struct _vector *mp, const char *wwid); -struct multipath * find_mp_by_minor (const struct _vector *mp, +struct multipath * find_mp_by_alias (const struct vector_s *mp, const char *alias); +struct multipath * find_mp_by_wwid (const struct vector_s *mp, const char *wwid); +struct multipath * find_mp_by_str (const struct vector_s *mp, const char *wwid); +struct multipath * find_mp_by_minor (const struct vector_s *mp, unsigned int minor); -struct path * find_path_by_devt (const struct _vector *pathvec, const char *devt); -struct path * find_path_by_dev (const struct _vector *pathvec, const char *dev); +struct path * find_path_by_devt (const struct vector_s *pathvec, const char *devt); +struct path * find_path_by_dev (const struct vector_s *pathvec, const char *dev); struct path * first_path (const struct multipath *mpp); struct path *mp_find_path_by_devt(const struct multipath *mpp, const char *devt); diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 50b17e6..5df495b 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -891,7 +891,7 @@ void update_queue_mode_add_path(struct multipath *mpp) condlog(2, "%s: remaining active paths: %d", mpp->alias, active); } -vector get_used_hwes(const struct _vector *pathvec) +vector get_used_hwes(const struct vector_s *pathvec) { int i, j; struct path *pp; diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h index 541327d..03bf8ee 100644 --- a/libmultipath/structs_vec.h +++ b/libmultipath/structs_vec.h @@ -37,6 +37,6 @@ int update_multipath_table__ (struct multipath *mpp, vector pathvec, int flags, const char *params, const char *status); int update_multipath_table (struct multipath *mpp, vector pathvec, int flags); int update_multipath_status (struct multipath *mpp); -vector get_used_hwes(const struct _vector *pathvec); +vector get_used_hwes(const struct vector_s *pathvec); #endif /* STRUCTS_VEC_H_INCLUDED */ diff --git a/libmultipath/valid.c b/libmultipath/valid.c index 5df9b02..f23ee6b 100644 --- a/libmultipath/valid.c +++ b/libmultipath/valid.c @@ -120,7 +120,7 @@ static int check_holders(const char *syspath) return sr.n; } -static int check_all_holders(const struct _vector *parts) +static int check_all_holders(const struct vector_s *parts) { char syspath[PATH_MAX]; const char *sysname; @@ -168,7 +168,7 @@ static void cleanup_cache(void *arg) * check if any of the partitions in the vector is referenced in the table. * Note that mnt_table_find_srcpath() also resolves mounts by symlinks. */ -static int check_mnt_table(const struct _vector *parts, +static int check_mnt_table(const struct vector_s *parts, struct libmnt_table *tbl, const char *table_name) { @@ -188,7 +188,7 @@ static int check_mnt_table(const struct _vector *parts, return 0; } -static int check_mountinfo(const struct _vector *parts) +static int check_mountinfo(const struct vector_s *parts) { static const char mountinfo[] = "/proc/self/mountinfo"; struct libmnt_table *tbl; @@ -223,7 +223,7 @@ static int check_mountinfo(const struct _vector *parts) } #ifdef LIBMOUNT_SUPPORTS_SWAP -static int check_swaps(const struct _vector *parts) +static int check_swaps(const struct vector_s *parts) { struct libmnt_table *tbl; struct libmnt_cache *cache; @@ -248,7 +248,7 @@ static int check_swaps(const struct _vector *parts) return used; } #else -static int check_swaps(const struct _vector *parts __attribute__((unused))) +static int check_swaps(const struct vector_s *parts __attribute__((unused))) { return 0; } diff --git a/multipathd/cli.c b/multipathd/cli.c index 139a4c4..3458829 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -335,7 +335,7 @@ int get_cmdvec (char *cmd, vector *v, bool allow_incomplete) return r; } -uint32_t fingerprint(const struct _vector *vec) +uint32_t fingerprint(const struct vector_s *vec) { int i; uint32_t fp = 0; @@ -352,7 +352,7 @@ uint32_t fingerprint(const struct _vector *vec) return fp; } -struct handler *find_handler_for_cmdvec(const struct _vector *v) +struct handler *find_handler_for_cmdvec(const struct vector_s *v) { return find_handler(fingerprint(v)); } diff --git a/multipathd/cli.h b/multipathd/cli.h index dd26a2c..9fa5014 100644 --- a/multipathd/cli.h +++ b/multipathd/cli.h @@ -142,7 +142,7 @@ int set_handler_callback__ (uint32_t fp, cli_handler *fn, bool locked); #define set_unlocked_handler_callback(fp, fn) set_handler_callback__(fp, fn, false) int get_cmdvec (char *cmd, vector *v, bool allow_incomplete); -struct handler *find_handler_for_cmdvec(const struct _vector *v); +struct handler *find_handler_for_cmdvec(const struct vector_s *v); void genhelp_handler (const char *cmd, int error, struct strbuf *reply); int load_keys (void); @@ -152,7 +152,7 @@ void free_keys (vector vec); void free_handlers (void); int cli_init (void); void cli_exit(void); -uint32_t fingerprint(const struct _vector *vec); +uint32_t fingerprint(const struct vector_s *vec); vector get_keys(void); vector get_handlers(void); struct key *find_key (const char * str); diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 2efe23f..4260354 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -33,7 +33,7 @@ #include "cli_handlers.h" static struct path * -find_path_by_str(const struct _vector *pathvec, const char *str, +find_path_by_str(const struct vector_s *pathvec, const char *str, const char *action_str) { struct path *pp; @@ -157,8 +157,8 @@ show_map_json (struct strbuf *reply, struct multipath * mpp, } static int -show_config (struct strbuf *reply, const struct _vector *hwtable, - const struct _vector *mpvec) +show_config (struct strbuf *reply, const struct vector_s *hwtable, + const struct vector_s *mpvec) { struct config *conf; int rc; diff --git a/multipathd/main.c b/multipathd/main.c index 229b516..1b7fd04 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -3140,8 +3140,8 @@ void rcu_free_config(struct rcu_head *head) free_config(conf); } -static bool reconfigure_check_uid_attrs(const struct _vector *old_attrs, - const struct _vector *new_attrs) +static bool reconfigure_check_uid_attrs(const struct vector_s *old_attrs, + const struct vector_s *new_attrs) { int i; char *old; diff --git a/tests/valid.c b/tests/valid.c index cb56734..c5a1eac 100644 --- a/tests/valid.c +++ b/tests/valid.c @@ -106,14 +106,14 @@ const char *__wrap_udev_device_get_sysname(struct udev_device *udev_device) } /* called from pathinfo() */ -int __wrap_filter_devnode(struct config *conf, const struct _vector *elist, +int __wrap_filter_devnode(struct config *conf, const struct vector_s *elist, const char *vendor, const char * product, const char *dev) { return mock_type(int); } /* called from pathinfo() */ -int __wrap_filter_device(const struct _vector *blist, const struct _vector *elist, +int __wrap_filter_device(const struct vector_s *blist, const struct vector_s *elist, const char *vendor, const char * product, const char *dev) { return mock_type(int); From patchwork Thu Aug 8 15:26:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13757839 X-Patchwork-Delegate: christophe.varoqui@free.fr Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 280AF19149A for ; Thu, 8 Aug 2024 15:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130839; cv=none; b=DqT19UX5Oy0y9LKcnQLUI0E87S0U96osjCjcxETIQekQr/IoAqOy3PJDVrlDB/E22NByp+BQVTmTUisrh+vwM4Qp3W8y3/nOiTSJ5K9h0r7FAflWfw5WbROhNPMISdxRSAYKq6oti84bicJ6MbMu7qxVzq3P2pnhE1g9y3CR9nY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723130839; c=relaxed/simple; bh=KMh6jOHpznrGPn5hBBpsveX1kGU0fn18OXDXIXQ+R0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kmJFcS4fE0PWh/o/imnzIQo/gBMzb9IZDBccleT36qj3EohgUVuhlkCFlBbVHX0BBr9Rf7/LP/2NjJpVLltQMJJFNGsMAoM38jAahMzYLyLzV+t6HJp6VIa4/kGAxDMK/p+gmsq/aABRUZWBulPaVw22jL0BKKAhqnXZi2VYIH0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=YBZJ8KbK; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YBZJ8KbK" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5a1c496335aso406878a12.1 for ; Thu, 08 Aug 2024 08:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723130836; x=1723735636; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+FghxUhQ4dkJ6SUz2TWE4xZEXRmDMMFe70BL8EAfarA=; b=YBZJ8KbKcd1nBuEa6Av1jtVNJx98qxQimp+W92JptcSC7shI6lUcyEMVD4d8s+Bmim xgh6szAujZlP2wQg9eKzNaLARLVC2f8KtHHc2/TGU4GWpW8Ivb+Vin2ECe8vofTD8fbX /7dUqDrLThqKvzxUNFz6gfWBEhXNQjsnFPDYnvHEQehy795OniztTvl9kUGTef/PJFB2 eF8JcMCO/p+O9hvradAXhJD6FxEnWOUWj8hArRIsR6GuyxGKPt2N0TgT8R/8R7xeOqGH jokjVqiaThNAbRro0DLReIPgxvH8tchsrSxIKSPfyawNTwvG9lE5yYlVUw8V7goOVAjf GhzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723130836; x=1723735636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+FghxUhQ4dkJ6SUz2TWE4xZEXRmDMMFe70BL8EAfarA=; b=o5e+2hswzll2gev030f3ypcw3yNIH9sBG0N/WRUpI5Za2DAkqI9W9EyPUbKi5PexfA XAaTuUE4Zu4P+9lzNZYQpp5BaYyZJhNaSFtAERlSLJm4fko6XG63I419y8NXbx7u53Zg Tod+M4VNlNVgYO4in2Y4riprbsdubvnpP5OHvjzed23bwRHEfLRu+/sN2uep4OGZUiVU G25TD/Ai7Or/4eR4LcpAEHWcxNSSyFrKN42tK8m3HmjFBGV35GGmydGxoq9ip6ckHBwr bD2vqiuFiYaHVVZkMTnMSSIInrw1D5X/LbxoabiuahAgv954QmmZ6ewopqVA3BmGhdBc gmog== X-Gm-Message-State: AOJu0Yz+qvUCPj0d6vYaZc8kLOKkSkPiCXoL1V8l8AGndYT0d75jx+qw epZKFsZKb6TvVhQ8xsI3oxUQ6b6Hp4TTZ6/LFN4GNlz//I4P5GnTxdIVPN2ylcQ= X-Google-Smtp-Source: AGHT+IH39pRylZiWZEkIE/B/jdTQ7jWKLn6vOOgXuaH03H8znnko9zI2XrNCokZuTTzC/9kHOXRDvg== X-Received: by 2002:a05:6402:50d4:b0:5a2:80f:a6dd with SMTP id 4fb4d7f45d1cf-5bbb234551dmr2291630a12.14.1723130836104; Thu, 08 Aug 2024 08:27:16 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5bbb2bf8666sm733909a12.9.2024.08.08.08.27.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 08:27:15 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@lists.linux.dev Subject: [PATCH 41/41] libmultipath: don't define __user Date: Thu, 8 Aug 2024 17:26:20 +0200 Message-ID: <20240808152620.93965-42-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240808152620.93965-1-mwilck@suse.com> References: <20240808152620.93965-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This may have been necessary in the old days, but it isn't necessary any more now. Signed-off-by: Martin Wilck --- libmultipath/prioritizers/alua_rtpg.c | 1 - libmultipath/sg_include.h | 1 - 2 files changed, 2 deletions(-) diff --git a/libmultipath/prioritizers/alua_rtpg.c b/libmultipath/prioritizers/alua_rtpg.c index dd2224c..e53f447 100644 --- a/libmultipath/prioritizers/alua_rtpg.c +++ b/libmultipath/prioritizers/alua_rtpg.c @@ -21,7 +21,6 @@ #include #include -#define __user #include #include "../structs.h" diff --git a/libmultipath/sg_include.h b/libmultipath/sg_include.h index 43bff2d..443819b 100644 --- a/libmultipath/sg_include.h +++ b/libmultipath/sg_include.h @@ -1,6 +1,5 @@ #ifndef SG_INCLUDE_H_INCLUDED #define SG_INCLUDE_H_INCLUDED -#define __user #include #ifndef DID_OK