From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web10.5210.1608159030877360735 for ; Wed, 16 Dec 2020 14:50:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DoTiIXz/; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608159030; 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=IK2nsElxYkCLEpYbVAZcJxb2hHXemYTEaYVuLZ8+OLk=; b=DoTiIXz/9c/jmNUdIyCfdDD9m85yb7TPMTZoEt8ZfQ3W0U/zfF+sVqSthnOP6oFmS3A7wE vplY1gDkBXOxyZmSTniUycccH/jlRrjJBrUmr6oqkVQyH76woS1s1HFq2sX4JvMILNTzlH nTlbISBKyq9uEvbiPJWKW69ic5QApFg= 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-504-NOVOlD7zN2qY9sXxjMWpgA-1; Wed, 16 Dec 2020 17:50:28 -0500 X-MC-Unique: NOVOlD7zN2qY9sXxjMWpgA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B7C51842143; Wed, 16 Dec 2020 22:50:27 +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 C142018017; Wed, 16 Dec 2020 22:50:21 +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 47/48] OvmfPkg/VirtioFsDxe: add helper for determining file mode bits update Date: Wed, 16 Dec 2020 22:11:24 +0100 Message-Id: <20201216211125.19496-48-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.16 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 QWRkIHRoZSBWaXJ0aW9Gc0dldEZ1c2VNb2RlVXBkYXRlKCkgZnVuY3Rpb24sIGZvciBkZXRlcm1p bmluZyB3aGV0aGVyIGFuCkVGSV9GSUxFX1BST1RPQ09MLlNldEluZm8oKSBpbnZvY2F0aW9uIHJl cXVlc3RzIGFuIHVwZGF0ZSB0byB0aGUgZmlsZSBtb2RlCmJpdHMuCgpDYzogQXJkIEJpZXNoZXV2 ZWwgPGFyZC5iaWVzaGV1dmVsQGFybS5jb20+CkNjOiBKb3JkYW4gSnVzdGVuIDxqb3JkYW4ubC5q dXN0ZW5AaW50ZWwuY29tPgpDYzogUGhpbGlwcGUgTWF0aGlldS1EYXVkw6kgPHBoaWxtZEByZWRo YXQuY29tPgpSZWY6IGh0dHBzOi8vYnVnemlsbGEudGlhbm9jb3JlLm9yZy9zaG93X2J1Zy5jZ2k/ aWQ9MzA5NwpTaWduZWQtb2ZmLWJ5OiBMYXN6bG8gRXJzZWsgPGxlcnNla0ByZWRoYXQuY29tPgot LS0KIE92bWZQa2cvSW5jbHVkZS9JbmR1c3RyeVN0YW5kYXJkL1ZpcnRpb0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9ERV9QRVJNX1JVU1IgfA0KKyAgICAgICAg ICAgICAgIFZJUlRJT19GU19GVVNFX01PREVfUEVSTV9XVVNSIHwNCisgICAgICAgICAgICAgICBW SVJUSU9fRlNfRlVTRV9NT0RFX1BFUk1fUkdSUCB8DQorICAgICAgICAgICAgICAgVklSVElPX0ZT X0ZVU0VfTU9ERV9QRVJNX1dHUlAgfA0KKyAgICAgICAgICAgICAgIFZJUlRJT19GU19GVVNFX01P REVfUEVSTV9ST1RIIHwNCisgICAgICAgICAgICAgICBWSVJUSU9fRlNfRlVTRV9NT0RFX1BFUk1f V09USCk7DQorICAgIH0gZWxzZSB7DQorICAgICAgKk1vZGUgPSAoVklSVElPX0ZTX0ZVU0VfTU9E RV9QRVJNX1JVU1IgfA0KKyAgICAgICAgICAgICAgIFZJUlRJT19GU19GVVNFX01PREVfUEVSTV9S R1JQIHwNCisgICAgICAgICAgICAgICBWSVJUSU9fRlNfRlVTRV9NT0RFX1BFUk1fUk9USCk7DQor ICAgIH0NCisgIH0NCisgICpVcGRhdGUgPSBUUlVFOw0KKyAgcmV0dXJuIEVGSV9TVUNDRVNTOw0K K30NCi0tIAoyLjE5LjEuMy5nMzAyNDdhYTVkMjAxCgoK