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.web09.5037.1608158904335987723 for ; Wed, 16 Dec 2020 14:48:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WJ+jNsMm; 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=1608158903; 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=GXAdSf8kjlVglIaxZ99N2HvCkMndh2p0a2gpEpsGPM8=; b=WJ+jNsMmB98YgcDsHfXYvMR7UCTk+0iAeTKO/3OrypdIXJWg5u3zExCwpn9zzmn48oOK3l ddfBeK9tPhIoi+pVcC3ghOkqqkh4AwindYBa/qMwlVfm1Zq+e4cA610RBwAOCh98GawqVM KyPinTD8rVmhZO0wMJaB3QKzccndn6w= 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-525-Fc5hQJCdM-qk9WAdGxvtUg-1; Wed, 16 Dec 2020 17:48:21 -0500 X-MC-Unique: Fc5hQJCdM-qk9WAdGxvtUg-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 8FF55800D55; Wed, 16 Dec 2020 22:48:20 +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 BAAEC17577; Wed, 16 Dec 2020 22:48:15 +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 46/48] OvmfPkg/VirtioFsDxe: add helper for determining access time updates Date: Wed, 16 Dec 2020 22:11:23 +0100 Message-Id: <20201216211125.19496-47-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 QWRkIHRoZSBWaXJ0aW9Gc0dldEZ1c2VUaW1lVXBkYXRlcygpIGZ1bmN0aW9uLCBmb3IgZGV0ZXJt aW5pbmcgd2hldGhlciBhbgpFRklfRklMRV9QUk9UT0NPTC5TZXRJbmZvKCkgaW52b2NhdGlvbiBy ZXF1ZXN0cyBhY2Nlc3MgdGltZSB1cGRhdGVzLgoKQ2M6IEFyZCBCaWVzaGV1dmVsIDxhcmQuYmll c2hldXZlbEBhcm0uY29tPgpDYzogSm9yZGFuIEp1c3RlbiA8am9yZGFuLmwuanVzdGVuQGludGVs LmNvbT4KQ2M6IFBoaWxpcHBlIE1hdGhpZXUtRGF1ZMOpIDxwaGlsbWRAcmVkaGF0LmNvbT4KUmVm OiBodHRwczovL2J1Z3ppbGxhLnRpYW5vY29yZS5vcmcvc2hvd19idWcuY2dpP2lkPTMwOTcKU2ln bmVkLW9mZi1ieTogTGFzemxvIEVyc2VrIDxsZXJzZWtAcmVkaGF0LmNvbT4KLS0tCiBPdm1mUGtn L1ZpcnRpb0ZzRHhlL1ZpcnRpb0ZzRHhlLmggfCAgMTAgKysKIE92bWZQa2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sYXN0IG1v ZGlmaWNhdGlvbiB0aW1lDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZHMgdG8gYmUg dXBkYXRlZC4gU2V0IHRvIEZBTFNFIG90aGVyd2lzZS4NCisNCisgIEBwYXJhbVtvdXRdIEF0aW1l ICAgICAgICBJZiBVcGRhdGVBdGltZSBpcyBzZXQgdG8gVFJVRSwgdGhlbiBBdGltZSBwcm92aWRl cw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBsYXN0IGFjY2VzcyB0aW1lc3RhbXAg dG8gc2V0IChhcyBzZWNvbmRzIHNpbmNlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhl IEVwb2NoKS4gT3RoZXJ3aXNlLCBBdGltZSBpcyBub3Qgd3JpdHRlbiB0by4NCisNCisgIEBwYXJh bVtvdXRdIE10aW1lICAgICAgICBJZiBVcGRhdGVNdGltZSBpcyBzZXQgdG8gVFJVRSwgdGhlbiBN dGltZSBwcm92aWRlcw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBsYXN0IG1vZGlm aWNhdGlvbiB0aW1lc3RhbXAgdG8gc2V0IChhcyBzZWNvbmRzDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgc2luY2UgdGhlIEVwb2NoKS4gT3RoZXJ3aXNlLCBNdGltZSBpcyBub3Qgd3JpdHRl bg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvLg0KKw0KKyAgQHJldHZhbCBFRklfU1VD Q0VTUyAgICAgICAgT3V0cHV0IHBhcmFtZXRlcnMgaGF2ZSBiZWVuIHNldCBzdWNjZXNzZnVsbHku DQorDQorICBAcmV0dmFsIEVGSV9BQ0NFU1NfREVOSUVEICBOZXdJbmZvIHJlcXVlc3RzIGNoYW5n aW5nIGJvdGggQ3JlYXRlVGltZSBhbmQNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1v ZGlmaWNhdGlvblRpbWUsIGJ1dCB0byB2YWx1ZXMgdG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