From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.4308.1608156000834250013 for ; Wed, 16 Dec 2020 14:00:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K2lQjsV/; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608156000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8vMrduA96lFY7utRU0H5WUNjTrGeCciygAaoEdKaZS4=; b=K2lQjsV/toMEzH+gBxplvZfyU368pFnpbOVWOVWyoc9lBiKRFoUmmMbWnS6NTAMHT2oXJu A0XIFOhGpO4GJIjGao+DyDxt4pvVapIDginsaDPLc26f8Q7CLeoUp1+PHoS7UwX5iaYrxw Izyv0U1XVF8VW9ov5pq9fTpPLHbJpuU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-BXBfViN_MsCuPNZ9B4h-tA-1; Wed, 16 Dec 2020 16:59:57 -0500 X-MC-Unique: BXBfViN_MsCuPNZ9B4h-tA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80CFC801817; Wed, 16 Dec 2020 21:59:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-152.ams2.redhat.com [10.36.114.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBB8C60C15; Wed, 16 Dec 2020 21:59:51 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io, virtio-fs@redhat.com, lersek@redhat.com Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2 PATCH 23/48] OvmfPkg/VirtioFsDxe: split canon. path into last parent + last component Date: Wed, 16 Dec 2020 22:11:00 +0100 Message-Id: <20201216211125.19496-24-lersek@redhat.com> In-Reply-To: <20201216211125.19496-1-lersek@redhat.com> References: <20201216211125.19496-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 R2l2ZW4gYSBjYW5vbmljYWwgcGF0aG5hbWUgKGFzIGRlZmluZWQgYnkgVmlydGlvRnNBcHBlbmRQ YXRoKCkpLCBkaWZmZXJlbnQKZnJvbSAiLyIsIGludHJvZHVjZSBhIGhlbHBlciBmdW5jdGlvbiBm b3I6CgotIGxvb2tpbmcgdXAgdGhlIE5vZGVJZCBvZiB0aGUgbW9zdCBzcGVjaWZpYyBwYXJlbnQg ZGlyZWN0b3J5LCBhbmQKCi0gZXhwb3NpbmcgdGhlIGxhc3QgY29tcG9uZW50IHN0YW5kLWFsb25l ICh3aGljaCBpcyB0aGVyZWZvcmUgYSBkaXJlY3QKICBjaGlsZCBvZiBzYWlkIHBhcmVudCBkaXJl Y3RvcnkpLgoKVGhpcyBzcGxpdHRpbmcgb3BlcmF0aW9uIHdpbGwgYmUgbmVjZXNzYXJ5IGluIG11 bHRpcGxlIHN1YnNlcXVlbnQgcGF0Y2hlcy4KCkNjOiBBcmQgQmllc2hldXZlbCA8YXJkLmJpZXNo ZXV2ZWxAYXJtLmNvbT4KQ2M6IEpvcmRhbiBKdXN0ZW4gPGpvcmRhbi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AgICAgICAgICAgICAgICAgIFBhdGggaXMgbW9k aWZpZWQgaW4tcGxhY2UgdGVtcG9yYXJpbHk7IGhvd2V2ZXIsIG9uDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByZXR1cm4gKHN1Y2Nlc3NmdWwgb3Igb3RoZXJ3aXNlKSwgUGF0aCByZWFz c3VtZXMNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0cyBvcmlnaW5hbCBjb250ZW50 cy4NCisNCisgIEBwYXJhbVtvdXRdIERpck5vZGVJZCAgICAgIFRoZSBOb2RlSWQgb2YgdGhlIG1v c3Qgc3BlY2lmaWMgcGFyZW50IGRpcmVjdG9yeQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaWRlbnRpZmllZCBieSBQYXRoLiBUaGUgY2FsbGVyIGlzIHJlc3BvbnNpYmxlIGZvcg0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZGluZyBhIEZVU0VfRk9SR0VUIHJlcXVlc3Qg dG8gdGhlIFZpcnRpbw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZXN5c3RlbSBk ZXZpY2UgZm9yIERpck5vZGVJZCAtLSB1bmxlc3MNCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIERpck5vZGVJZCBlcXVhbHMgVklSVElPX0ZTX0ZVU0VfUk9PVF9ESVJfTk9ERV9JRA0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0sIHdoZW4gRGlyTm9kZUlkJ3MgdXNlIGVuZHMu DQorDQorICBAcGFyYW1bb3V0XSBMYXN0Q29tcG9uZW50ICBBIHBvaW50ZXIgaW50byBQYXRoLCBw b2ludGluZyBhdCB0aGUgc3RhcnQgb2YgdGhlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBsYXN0IHBhdGhuYW1lIGNvbXBvbmVudC4NCisNCisgIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAg ICAgICAgICBTcGxpdHRpbmcgc3VjY2Vzc2Z1bC4NCisNCisgIEByZXR2YWwgRUZJX0lOVkFMSURf UEFSQU1FVEVSICBQYXRoIGlzICIvIi4NCisNCisgIEByZXR2YWwgRUZJX0FDQ0VTU19ERU5JRUQg ICAgICBPbmUgb2YgdGhlIGNvbXBvbmVudHMgb24gUGF0aCBiZWZvcmUgdGhlIGxhc3QNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcyBub3QgYSBkaXJlY3RvcnkuDQorDQorICBA cmV0dXJuICAgICAgICAgICAgICAgICAgICAgICAgRXJyb3IgY29kZXMgcHJvcGFnYXRlZCBmcm9t DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlydGlvRnNGdXNlTG9va3VwKCkg YW5kDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlydGlvRnNGdXNlQXR0clRv RWZpRmlsZUluZm8oKS4NCisqKi8NCitFRklfU1RBVFVTDQorVmlydGlvRnNMb29rdXBNb3N0U3Bl Y2lmaWNQYXJlbnREaXIgKA0KKyAgSU4gT1VUIFZJUlRJT19GUyAqVmlydGlvRnMsDQorICBJTiBP VVQgQ0hBUjggICAgICpQYXRoLA0KKyAgICAgT1VUIFVJTlQ2NCAgICAqRGlyTm9kZUlkLA0KKyAg ICAgT1VUIENIQVI4ICAgICAqKkxhc3RDb21wb25lbnQNCisgICkNCit7DQorICBVSU5UNjQgICAg IFBhcmVudERpck5vZGVJZDsNCisgIENIQVI4ICAgICAgKlNsYXNoOw0KKyAgRUZJX1NUQVRVUyBT dGF0dXM7DQorICBVSU5UNjQgICAgIE5leHREaXJOb2RlSWQ7DQorDQorICBpZiAoQXNjaWlTdHJD bXAgKFBhdGgsICIvIikgPT0gMCkgew0KKyAgICByZXR1cm4gRUZJX0lOVkFMSURfUEFSQU1FVEVS Ow0KKyAgfQ0KKw0KKyAgUGFyZW50RGlyTm9kZUlkID0gVklSVElPX0ZTX0ZVU0VfUk9PVF9ESVJf Tk9ERV9J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HdhcyB0aGUgYmFzaXMgZm9yIHRoZSBs b29rdXAuDQorICAgIC8vDQorICAgIGlmIChQYXJlbnREaXJOb2RlSWQgIT0gVklSVElPX0ZTX0ZV U0VfUk9PVF9ESVJfTk9ERV9JRCkgew0KKyAgICAgIFZpcnRpb0ZzRnVzZUZvcmdldCAoVmlydGlv RnMsIFBhcmVudERpck5vZGVJZCk7DQorICAgIH0NCisNCisgICAgLy8NCisgICAgLy8gSWYgd2Ug Y291bGRuJ3QgbG9vayB1cCB0aGUgbmV4dCAqbm9uLWZpbmFsKiBwYXRobmFtZSBjb21wb25lbnQs IGJhaWwuDQorICAgIC8vDQorICAgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgICBy ZXR1cm4gU3RhdHVzOw0KKyAgICB9DQorDQorICAgIC8vDQorICAgIC8vIExvb2t1cCBzdWNjZXNz ZnVsOyBub3cgY2hlY2sgaWYgdGhlIG5leHQgKG5vbi1maW5hbCkgY29tcG9uZW50IGlzIGENCisg ICAgLy8gZGlyZWN0b3J5LiBJZiBub3QsIGJhaWwuDQorICAgIC8vDQorICAgIFN0YXR1cyA9IFZp cnRpb0ZzRnVzZUF0dHJUb0VmaUZpbGVJbmZvICgmRnVzZUF0dHIsICZGaWxlSW5mbyk7DQorICAg IGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgICBnb3RvIEZvcmdldE5leHREaXJOb2Rl SWQ7DQorICAgIH0NCisgICAgaWYgKChGaWxlSW5mby5BdHRyaWJ1dGUgJiBFRklfRklMRV9ESVJF Q1RPUlkpID09IDApIHsNCisgICAgICBTdGF0dXMgPSBFRklfQUNDRVNTX0RFTklFRDsNCisgICAg ICBnb3RvIEZvcmdldE5leHREaXJOb2RlSWQ7DQorICAgIH0NCisNCisgICAgLy8NCisgICAgLy8g QWR2YW5jZS4NCisgICAgLy8NCisgICAgUGFyZW50RGlyTm9kZUlkID0gTmV4dERpck5vZGVJZDsN CisgICAgU2xhc2ggICAgICAgICAgID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