Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9433843ybi; Wed, 10 Jul 2019 10:10:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwts+OYNW+DAQtteAKzujMPVDNiAzIPQ566bAaiq3x8XBmnNjLv9naJKscQodSbL1Afx4Z+ X-Received: by 2002:a65:508c:: with SMTP id r12mr35609480pgp.1.1562778631011; Wed, 10 Jul 2019 10:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562778630; cv=none; d=google.com; s=arc-20160816; b=qkIpIMrGTVbVHwJID8vAQL7Cn4InqpmDgtp0K4/WGNxeAZJ6o1dD/x0Lgr/YPUlJWK yBW7mqHEcFqc+zAwnrhNKYmRtRWyOYbpJsKbKXomebT651ZcooI1ithmmhy8+SIbWPF9 aIyo1qie3gcKDwPbbHgbua3RnXcKUEbdjSj5BUrpTVJdm8zBLyYh5dZ/hYDPMWqGJXQZ zXI5CyHZHce7p2SPR1j3tblWK7y5mE2QiO4HCfUCPJr2d+zHrm/pQJPuTP60fRQ4A25f 6loyeTXsUUKMTAxoNKjjJiUUZLsP0DZI6K3DMbo63npnsyu0RE4NV5HMCTDJCDAkzPCo 0KSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=vXuzk0Qcuhxr8c06sxqa6ZbusGIX89pmQAmxD+CbmRI=; b=qx5kvXSY7QuiIIo+6UHe9VuC07JXC9MbI9tNunJ7mYjybCfW3X9oYpKGf6JDWl4Gtn c/W8nZK+vLdJmmns0hQWEuu2WVWKzWhVayhyTveM+AixMOf7qJGcIsSfjGA+XFsTwHni /n8oWIucfbe+lWCZrtXxpR+L6tE4VSBLBjpYJmhSSHVD9jyRUkmlzFDSPBk5RcoJl0J2 Y5+C+8fJZBM9jpPUowSLvv/lCFKVtHpS+dyEAW/O2fBi0K8MHIV6ykhcmdCMU3fQnMlV aCuppLwnx0l992W0eW1YM57pcYjccfKloHKxmMNC8fqhOZFbFi2gMf8KsxOj0Bn6R7oQ pmyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y187si2690076pgd.66.2019.07.10.10.10.01; Wed, 10 Jul 2019 10:10:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727538AbfGJQxk (ORCPT + 99 others); Wed, 10 Jul 2019 12:53:40 -0400 Received: from mga03.intel.com ([134.134.136.65]:24932 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726957AbfGJQxj (ORCPT ); Wed, 10 Jul 2019 12:53:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 09:53:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,475,1557212400"; d="p7s'?scan'208";a="193111080" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by fmsmga002.fm.intel.com with ESMTP; 10 Jul 2019 09:53:38 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 09:53:38 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.44]) by ORSMSX153.amr.corp.intel.com ([169.254.12.99]) with mapi id 14.03.0439.000; Wed, 10 Jul 2019 09:53:37 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" CC: "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [PATCH BlueZ 6/9] mesh: Define storage format specific read/write routines Thread-Topic: [PATCH BlueZ 6/9] mesh: Define storage format specific read/write routines Thread-Index: AQHVNt3Aor4cw0IYJkqr20V9gkOC2KbD8IiAgACXHoA= Date: Wed, 10 Jul 2019 16:53:37 +0000 Message-ID: References: <20190710050959.7321-1-inga.stotland@intel.com> <20190710050959.7321-7-inga.stotland@intel.com> <20190710075245.2koao3eyj22wbj7s@mlowasrzechonek2133> In-Reply-To: <20190710075245.2koao3eyj22wbj7s@mlowasrzechonek2133> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.254.108.59] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-mBygGUXl9RgBMH910b83" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-mBygGUXl9RgBMH910b83 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Wed, 2019-07-10 at 09:52 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > On 07/09, Inga Stotland wrote: > > This adds the following generic APIs to mesh-config.h > > void *mesh_config_create_config(void); > > void mesh_config_release_config(void *config); > > void *mesh_config_get_config(const char *dir); > > void *mesh_config_get_config_backup(const char *dir); > > bool mesh_config_restore_backup(const char *dir); > > bool mesh_config_save_config(const char *dir, void *cfg); > >=20 > > The implementation of these API routines depends on the > > underlying storage directory structure and can be specific to > > a chosen configuration file format. >=20 > I don't like the assumption that each node is stored in a separate > file, > and there needs to be a backup file. >=20 > One of the storage formats I had in mind is a single transactional > database (some flavor of berkeley db, or maybe even sqlite) that > would > hold all the nodes. >=20 > With this in mind, how about: >=20 > union mesh_config *mesh_config_create_config(const uint8_t > uuid[16]); > bool mesh_config_save(union mesh_config *cfg); >=20 > and to iterate over saved nodes: > typedef struct mesh_node *(*mesh_node_load_cb)(union mesh_config > *cfg, > const uint8_t > uuid[16], > void *user_data); >=20 > void mesh_config_load_nodes(mesh_node_load_cb cb, void > *user_data); >=20 > and move file/directory handling from storage.c to mesh-config- > json.c? >=20 >=20 > regards If we do away with the notion that each node has its own directory, this means that entire node parsing procedure needs to be pushed into the corresponding mesh-config- implementation and storage.c becomes obsolete. =20 --=-mBygGUXl9RgBMH910b83 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxMLU2Fu dGEgQ2xhcmExGjAYBgNVBAoTEUludGVsIENvcnBvcmF0aW9uMSswKQYDVQQDEyJJbnRlbCBFeHRl cm5hbCBCYXNpYyBJc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