Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030209AbWHRBng (ORCPT ); Thu, 17 Aug 2006 21:43:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030264AbWHRBng (ORCPT ); Thu, 17 Aug 2006 21:43:36 -0400 Received: from py-out-1112.google.com ([64.233.166.179]:50470 "EHLO py-out-1112.google.com") by vger.kernel.org with ESMTP id S1030209AbWHRBnf (ORCPT ); Thu, 17 Aug 2006 21:43:35 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type; b=FtKLI5NZsSdKEnKy1lC6RBca/hlrI6ifrDamCv2aCXGXT6wo0TxddTQynKSggWqne1xzFdJZeciN5DZMYZaWSv4WlbmhHVECbi5uIRJEBjlnp2qrC2JV5ewqTyENF+fijv6ts/tsRDQV7oH12xXn7M/tOwItkpjEBKu+uPBuvws= Message-ID: <4745278c0608171843j5b3d28bbx16ddf472e1bdb329@mail.gmail.com> Date: Thu, 17 Aug 2006 21:43:33 -0400 From: "Vishal Patil" To: "Linux Kernel Mailing List" Subject: Page cache using B-trees benchmark results Cc: "Andrea Arcangeli" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_17202_32626162.1155865413814" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 81824 Lines: 1090 ------=_Part_17202_32626162.1155865413814 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Folks I am attaching the benchmark results for Page Cache Implementation using B-trees. I basically ran the tio (threaded i/o) benchmark against my kernel (with the B-tree implementation) and the Linux kernel shipped with FC5. Radix tree implementation is definately better however the B-tree implementation did not suck that bad :) Also I attaching a new patch which was used for measuring the benchmarks. Also henceforth changes to the page will be tracked using the projected hosted at http://code.google.com/p/btreepc Thanks - Vishal -- Motivation will almost always beat mere talent. ------=_Part_17202_32626162.1155865413814 Content-Type: text/x-patch; name=btree.linux2.6.16.2.patch; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_eqzw92kb Content-Disposition: attachment; filename="btree.linux2.6.16.2.patch" ZGlmZiAtdXJOIGxpbnV4LTIuNi4xNi4yL21tL2ZpbGVtYXAuYyBsaW51eC0yLjYuMTYuMi1idHJl ZS9tbS9maWxlbWFwLmMKLS0tIGxpbnV4LTIuNi4xNi4yL21tL2ZpbGVtYXAuYwkyMDA2LTA0LTA3 IDEyOjU2OjQ3LjAwMDAwMDAwMCAtMDQwMAorKysgbGludXgtMi42LjE2LjItYnRyZWUvbW0vZmls ZW1hcC5jCTIwMDYtMDgtMTcgMjE6MTE6MjEuMDAwMDAwMDAwIC0wNDAwCkBAIC0xMTIsMTAgKzEx MiwxNiBAQAogICovCiB2b2lkIF9fcmVtb3ZlX2Zyb21fcGFnZV9jYWNoZShzdHJ1Y3QgcGFnZSAq cGFnZSkKIHsKKwlzdHJ1Y3QgcGFnZSAqIGJwYWdlOwogCXN0cnVjdCBhZGRyZXNzX3NwYWNlICpt YXBwaW5nID0gcGFnZS0+bWFwcGluZzsKKwl1bnNpZ25lZCBsb25nIGluZGV4ID0gcGFnZS0+aW5k ZXg7CQogCi0JcmFkaXhfdHJlZV9kZWxldGUoJm1hcHBpbmctPnBhZ2VfdHJlZSwgcGFnZS0+aW5k ZXgpOwotCXBhZ2UtPm1hcHBpbmcgPSBOVUxMOworCWJwYWdlID0gYnRyZWVfZGVsZXRlKCZtYXBw aW5nLT5idHJlZSxtYXBwaW5nLT5idHJlZS5yb290LGluZGV4KS52YWw7CisJaWYgKCBicGFnZSAh PSBwYWdlKSB7CisJCXBhbmljKCJERUJVRzogRGVsZXRpbmcgd3JvbmcgcGFnZSBpbiByZW1vdmUg ZnJvbSBwYWdlIiAKKwkJCSJjYWNoZSAlZCwweCV4XG4iLGluZGV4LGJwYWdlKTsKKwl9IAorICAg ICAJcGFnZS0+bWFwcGluZ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RSRUVfSU5JVChHRlBfQVRP TUlDfF9fR0ZQX05PV0FSTiksIAogCS50cmVlX2xvY2sJPSBSV19MT0NLX1VOTE9DS0VELAogCS5h X29wcwkJPSAmc3dhcF9hb3BzLAogCS5pX21tYXBfbm9ubGluZWFyID0gTElTVF9IRUFEX0lOSVQo c3dhcHBlcl9zcGFjZS5pX21tYXBfbm9ubGluZWFyKSwKQEAgLTcxLDE2ICs3MiwyMSBAQAogc3Rh dGljIGludCBfX2FkZF90b19zd2FwX2NhY2hlKHN0cnVjdCBwYWdlICpwYWdlLCBzd3BfZW50cnlf dCBlbnRyeSwKIAkJCSAgICAgICBnZnBfdCBnZnBfbWFzaykKIHsKLQlpbnQgZXJyb3I7CisJaW50 IGJ0cmVlX2Vycm9yOwogCiAJQlVHX09OKFBhZ2VTd2FwQ2FjaGUocGFnZSkpOwogCUJVR19PTihQ YWdlUHJpdmF0ZShwYWdlKSk7Ci0JZXJyb3IgPSByYWRpeF90cmVlX3ByZWxvYWQoZ2ZwX21hc2sp OwotCWlmICghZXJyb3IpIHsKKworICAgICAgICBidHJlZV9lcnJvciA9IGJ0cmVlX3ByZWxvYWQo Z2ZwX21hc2spOworCQorCWlmICghYnRyZWVfZXJyb3IpIHsKIAkJd3JpdGVfbG9ja19pcnEoJnN3 YXBwZXJfc3BhY2UudHJlZV9sb2NrKTsKLQkJZXJyb3IgPSByYWRpeF90cmVlX2luc2VydCgmc3dh cHBlcl9zcGFjZS5wYWdlX3RyZWUsCisgICAgICAgICAgICAgICAgaWYgKCFidHJlZV9lcnJvcikg eworICAgICAgICAgICAgICAgICAgICAgICBidHJlZV9lcnJvciA9IGJ0cmVlX2luc2VydCgmc3dh cHBlcl9zcGFjZS5idHJlZSwKIAkJCQkJCWVudHJ5LnZhbCwgcGFnZSk7Ci0JCWlmICghZXJyb3Ip IHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIAorCQlpZiAo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fbm9kZV9jdG9yKHZvaWQgKm5vZGUsIGttZW1fY2FjaGVfdCAqY2FjaGVwLCB1bnNp Z25lZCBsb25nIGZsYWdzKSB7CisgICAgICAgIG1lbXNldChub2RlLCAwLCBzaXplb2Yoc3RydWN0 IGJ0cmVlX25vZGUpKTsKK30KKwordm9pZCBfX2luaXQgYnRyZWVfaW5pdCh2b2lkKSB7CisgICAg ICAgIGJ0cmVlX25vZGVfY2FjaGVwID0ga21lbV9jYWNoZV9jcmVhdGUoImJ0cmVlX25vZGUiLAor ICAgICAgICAgICAgICAgIHNpemVvZihidHJlZV9ub2RlKSwgMCwKKyAgICAgICAgICAgICAgICBT TEFCX1BBTklDLCBidHJlZV9ub2RlX2N0b3IsIE5VTEwpOworfQorCit1bnNpZ25lZCBsb25nIGJ0 cmVlX2tleV9mbiAodm9pZCAqIHBhZ2UpIHsKKyAgICAgICAgcmV0dXJuICgoKHN0cnVjdCBwYWdl KilwYWdlKS0+aW5kZXgpOworfQorCit1bnNpZ25lZCBsb25nIGJ0cmVlX3ZhbHVlX2ZuICh1bnNp Z25lZCBsb25nIGtleSkgeworICAgICAgICByZXR1cm4gKigodW5zaWduZWQgbG9uZyopa2V5KTsK K30KKwordm9pZCBidHJlZV9wcmludF9mbiAodW5zaWduZWQgbG9uZyBrZXkpIHsKKyAgICAgICAg cHJpbnRrKCIlbHUgIiwgKigodW5zaWduZWQgbG9uZyopa2V5KSk7Cit9CisKK3N0YXRpYyBpbmxp bmUgdm9pZCB0YWdfc2V0KHN0cnVjdCBidHJlZV9ub2RlICpub2RlLCBpbnQgdGFnLCBpbnQgb2Zm c2V0KQoreworICAgICAgICBfX3NldF9iaXQob2Zmc2V0LCBub2RlLT50YWdzW3RhZ10pOworfQor CitzdGF0aWMgaW5saW5lIHZvaWQgdGFnX2NsZWFyKHN0cnVjdCBidHJlZV9ub2RlICpub2RlLCBp bnQgdGFnLCBpbnQgb2Zmc2V0KQoreworICAgICAgICBfX2NsZWFyX2JpdChvZmZzZXQsIG5vZGUt PnRhZ3NbdGFnXSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgaW50IHRhZ19nZXQoc3RydWN0IGJ0cmVl X25vZGUgKm5vZGUsIGludCB0YWcsIGludCBvZmZzZXQpCit7CisgICAgICAgIHJldHVybiB0ZXN0 X2JpdChvZmZzZXQsIG5vZGUtPnRhZ3NbdGFnXSk7Cit9CisKKy8qCisgKiBBIG1vZGlmaWVkIGZv cm0gb2YgYmluYXJ5IHNlYXJjaCB0aGF0IHNlYXJjaGVzIGZvciBpbmRleCBwb3NpdGlvbiBvZiB0 aGUga2V5CisgKiBJbiBjYXNlIHRoZSBrZXkgaXMgbm90IGZvdW5kIHRoZSBpbmRleCBvZiB0aGUg a2V5IGxlc3NlciB0aGFuIHRoZSBzZWFyY2gga2V5CisgKiBpcyByZXR1cm5lZAorICovCitzdGF0 aWMgaW5saW5lIGludCBzZWFyY2hfa2V5KGJ0cmVlX25vZGUgKiBub2RlLCBsb25nIGtleSkgewor ICAgICAgaW50IGxlZnRfaW5kZXggPSAwOworICAgICAgaW50IHJpZ2h0X2luZGV4ID0gbm9kZS0+ bnJfYWN0aXZlIC0gMTsKKyAgICAgIGludCBtaWRfaW5kZXggPSAtMTsKKworICAgICAgaWYgKGtl eSA+IG5vZGUtPmtleV92YWxzW3JpZ2h0X2luZGV4XS5rZXkpIHsKKyAgICAgICAgICAgICAgIHJl dHVybiByaWdodF9pbmRleCArIDE7CisgICAgICB9CisKKyAgICAgIHdoaWxlIChsZWZ0X2luZGV4 IDw9IHJpZ2h0X2luZGV4KSB7CisgICAgICAgICAgICAgIG1pZF9pbmRleCA9IGxlZnRfaW5kZXgg KyAocmlnaHRfaW5kZXggLSBsZWZ0X2luZGV4KS8yOworCisgICAgICAgICAgICAgIGlmIChrZXkg PCBub2RlLT5rZXlfdmFsc1ttaWRfaW5kZXhdLmtleSkgeworICAgICAgICAgICAgICAgICAgICAg IHJpZ2h0X2luZGV4ID0gbWlkX2luZGV4IC0gMTsKKyAgICAgICAgICAgICAgfSBlbHNlCisgICAg ICAgICAgICAgIGlmIChrZXkgPiBub2RlLT5rZXlfdmFsc1ttaWRfaW5kZXhdLmtleSkgeworICAg ICAgICAgICAgICAgICAgICAgIGxlZnRfaW5kZXggPSBtaWRfaW5kZXggKyAxOworICAgICAgICAg ICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtaWRfaW5kZXg7Cisg ICAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHJldHVybiByaWdodF9pbmRleCArIDE7Cit9 CisKKworCisvKgorICogTG9hZCB1cCB0aGlzIENQVSdzIGJ0cmVlX25vZGUgYnVmZmVyIHdpdGgg c3VmZmljaWVudCBvYmplY3RzIHRvCisgKiBlbnN1cmUgdGhhdCB0aGUgYWRkaXRpb24gb2YgYSBz aW5nbGUgZWxlbWVudCBpbiB0aGUgdHJlZSBjYW5ub3QgZmFpbC4gIE9uCisgKiBzdWNjZXNzLCBy ZXR1cm4gemVybywgd2l0aCBwcmVlbXB0aW9uIGRpc2FibGVkLiAgT24gZXJyb3IsIHJldHVybiAt RU5PTUVNCisgKiB3aXRoIHByZWVtcHRpb24gbm90IGRpc2FibGVkLgorICovCitpbnQgYnRyZWVf cHJlbG9hZChnZnBfdCBnZnBfbWFzaykgeworICAgICAgICBzdHJ1Y3QgYnRyZWVfcHJlbG9hZCAq YnRwOworICAgICAgICBzdHJ1Y3QgYnRyZWVfbm9kZSAqbm9kZTsKKyAgICAgICAgaW50IHJldCA9 IC1FTk9NRU07CisKKyAgICAgICAgcHJlZW1wdF9kaXNhYmxlKCk7CisgICAgICAgIGJ0cCA9ICZf X2dldF9jcHVfdmFyKGJ0cmVlX3ByZWxvYWRzKTsKKyAgICAgICAgd2hpbGUgKGJ0cC0+bnIgPCBB UlJBWV9TSVpFKGJ0cC0+bm9kZXMpKSB7CisgICAgICAgICAgICAgICAgcHJlZW1wdF9lbmFibGUo KTsKKyAgICAgICAgICAgICAgICBub2RlID0ga21lbV9jYWNoZV9hbGxvYyhidHJlZV9ub2RlX2Nh Y2hlcCwgZ2ZwX21hc2spOworICAgICAgICAgICAgICAgIGlmIChub2RlID09IE5VTEwpCisgICAg ICAgICAgICAgICAgICAgICAgICBnb3RvIG91dDsKKyAgICAgICAgICAgICAgICBwcmVlbXB0X2Rp c2FibGUoKTsKKyAgICAgICAgICAgICAgICBidHAgPSAmX19nZXRfY3B1X3ZhcihidHJlZV9wcmVs b2Fkcyk7CisgICAgICAgICAgICAgICAgaWYgKGJ0cC0+bnIgPCBBUlJBWV9TSVpFKGJ0cC0+bm9k ZXMpKQorICAgICAgICAgICAgICAgICAgICAgICAgYnRwLT5ub2Rlc1tidHAtPm5yKytdID0gbm9k ZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBrbWVtX2Nh Y2hlX2ZyZWUoYnRyZWVfbm9kZV9jYWNoZXAsIG5vZGUpOworICAgICAgICB9CisgICAgICAgIHJl dCA9IDA7CitvdXQ6CisgICAgICAgIHJldHVybiByZXQ7Cit9CisKKy8qKgorKiAgICAgICBGdW5j dGlvbiB1c2VkIHRvIGFsbG9jYXRlIG1lbW9yeSBmb3IgdGhlIGJ0cmVlIG5vZGUKKyogICAgICAg QHBhcmFtIGJ0cmVlIFRoZSBidHJlZQorKiAgICAgICBAcGFyYW0gb3JkZXIgT3JkZXIgb2YgdGhl IEItVHJlZQorKiAgICAgICBAcmV0dXJuIFRoZSBhbGxvY2F0ZWQgQi10cmVlIG5vZGUKKyovCitz dGF0aWMgYnRyZWVfbm9kZSAqIGFsbG9jYXRlX2J0cmVlX25vZGUgKGJ0cmVlICogYnRyZWUsdW5z aWduZWQgaW50IG9yZGVyKSB7CisgICAgICAgIGJ0cmVlX25vZGUgKiBub2RlOworCisgICAgICAg IC8vIEFsbG9jYXRlIG1lbW9yeSBmb3IgdGhlIG5vZGUKKyAgICAgICAgbm9kZSA9IGttZW1fY2Fj aGVfYWxsb2MoYnRyZWVfbm9kZV9jYWNoZXAsYnRyZWUtPmdmcF9tYXNrKTsKKworICAgICAgICAv LyBJZiB0aGlzIGlzIE5VTEwgZ2V0IHByZWxvYWRlZCBub2RlCisgICAgICAgIGlmIChub2RlICA9 PSBOVUxMICYmICEoYnRyZWUtPmdmcF9tYXNrICYgX19HRlBfV0FJVCkpIHsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgYnRyZWVfcHJlbG9hZCAqYnRwOworCisgICAgICAgICAgICAgICAgYnRwID0g Jl9fZ2V0X2NwdV92YXIoYnRyZWVfcHJlbG9hZHMpOworICAgICAgICAgICAgICAgIGlmIChidHAt Pm5yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBub2RlID0gYnRwLT5ub2Rlc1tidHAtPm5y IC0gMV07CisgICAgICAgICAgICAgICAgICAgICAgICBidHAtPm5vZGVzW2J0cC0+bnIgLSAxXSA9 IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICBidHAtPm5yLS07CisgICAgICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICAgCisgICAgICAgIC8vIEluaXRpYWxpemUgdGhlIG51bWJl ciBvZiBhY3RpdmUgbm9kZXMKKyAgICAgICAgbm9kZS0+bnJfYWN0aXZlID0gMDsKKworCS8vIFVz ZSB0byBkZXRlcm1pbmUgd2hldGhlciBpdCBpcyBhIGxlYWYKKwlub2RlLT5sZWFmID0gdHJ1ZTsK KworCS8vIFVzZSB0byBkZXRlcm1pbmUgdGhlIGxldmVsIGluIHRoZSB0cmVlCisJbm9kZS0+bGV2 ZWwgPSAwOworCisJLy9Jbml0aWFsaXplIHRoZSBsaW5rZWQgbGlzdCBwb2ludGVyIHRvIE5VTEwK Kwlub2RlLT5uZXh0ID0gTlVMTDsKKworICAgICAgICByZXR1cm4gbm9kZTsKK30KKworLyoqCisq ICAgICAgIEZ1bmN0aW9uIHVzZWQgdG8gZnJlZSB0aGUgbWVtb3J5IGFsbG9jYXRlZCB0byB0aGUg Yi10cmVlIAor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xXS52YWwgPSBrZXlfdmFsLT52YWw7CisKKwkJLy8gSWRlbnRpY2FsIGtl eSBmb3VuZAorICAgICAgICAgIAlpZiAoaSA+PSAwICYmIAorCQkJa2V5ID09IG5vZGUtPmtleV92 YWxzW2ldLmtleSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gaSArIDE7IGog PG5vZGUtPm5yX2FjdGl2ZTsgaisrICkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBub2RlLT5rZXlfdmFsc1tqXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbm9kZS0+a2V5X3ZhbHNbaiArIDFdOworCQkJCXRyYW5zZmVyX3RhZ3Mobm9kZSxqLG5v ZGUsaiArIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCQkJcmV0dXJuIC1FRVhJU1Q7 CisgICAgICAgICAgICAgICAgfSBlbHNlCisJCW5vZGUtPm5yX2FjdGl2ZSsrOyAKKwl9IGVsc2Ug eworCQl3aGlsZSAoaSA+PSAwICYmIGtleSA8IG5vZGUtPmtleV92YWxzW2ldLmtleSkgeworCQkJ aS0tOworCQl9CisKKyAgICAgICAgICAgICAgICAvLyBJZGVudGljYWwga2V5IGZvdW5kICAKKyAg ICAgICAgICAgICAgICBpZiAoaSA+PSAwICYmIGtleSA9PSBub2RlLT5rZXlfdmFsc1tpXS5rZXkp IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUVYSVNUOworICAgICAgICAgICAg ICAgIH0KKworCQlpKys7CisJCWNoaWxkID0gbm9kZS0+Y2hpbGRyZW5baV07IAorCQkKKwkJaWYo Y2hpbGQtPm5yX2FjdGl2ZSA9PSAyKmJ0cmVlLT5vcmRlciAtIDEpIHsKKworIAkJCS8vIENoZWNr IGZvciBpZGVudGljYWwga2V5IGhlcmUKKwkJCWluZGV4ID0gc2VhcmNoX2tleShjaGlsZCwga2V5 KTsKKwkJCWlmIChrZXkgPT0gY2hpb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lID09IDAgKSB7CisgICAgICAgICAg ICAgICAgaWYgKGJ0cmVlLT5yb290ID09IG5vZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IGJ0cmVlLT5yb290ID0gTlVMTDsKKyAgICAgICAgICAgICAgICB9CisJCWZyZWVfYnRyZWVfbm9k ZShub2RlKTsKKwl9CisJcmV0dXJuIGtleV92YWw7Cit9CisKKy8qKgorKiAgICAgICBGdW5jdGlv biB1c2VkIHRvIHJlbW92ZSBhIG5vZGUgZnJvbSBhICBCLVRyZWUKKyogICAgICAgQHBhcmFtIGJ0 cmVlIFRoZSBCLVRyZWUKKyogICAgICAgQHBhcmFtIGtleSBLZXkgb2YgdGhlIG5vZGUgdG8gYmUg cmVtb3ZlZAorKiAgICAgICBAcGFyYW0gdmFsdWUgZnVuY3Rpb24gdG8gbWFwIHRoZSBrZXkgdG8g YW4gdW5pcXVlIGludGVnZXIgdmFsdWUgICAgICAgIAorKiAgICAgICBAcGFyYW0gY29tcGFyZSBG dW5jdGlvbiB1c2VkIHRvIGNvbXBhcmUgdGhlIHR3byBub2RlcyBvZiB0aGUgdHJlZQorKiAgICAg ICBAcmV0dXJuIFRoZSByZW1vdmVkIGtleSB2YWx1ZSBwYWlyIAorKi8KKworYnRfa2V5X3ZhbCBi dHJlZV9kZWxldGUoYnRyZWUgKiBidHJlZSxidHJlZV9ub2RlICogc3VidHJlZSx1bnNpZ25lZCBs b25nIGtleSkgeworCXVuc2lnbmVkIGludCBpLGluZGV4OworCWJ0cmVlX25vZGUgKiBub2RlID0g TlVMTCwgKiByc2libGluZywgKmxzaWJsaW5nOworCWJ0cmVlX25vZGUgKiBjb21iX25vZGUsICog cGFyZW50OworCW5vZGVfcG9zIHN1Yl9ub2RlX3BvczsKKwlub2RlX3BvcyBub2RlX3BvczsKKwli dF9rZXlfdmFsIGtleV92YWwsIHJlbW92ZWRfa3YsdG9fcmVtb3ZlX2t2OworCXVuc2lnbmVkIGxv bmcga3YgPSBrZXk7CQorCisJbm9kZSA9IHN1YnRyZWU7CisJcGFyZW50ID0gTlVMTDsKKwlyZW1v dmVkX2t2LmtleSA9IC0xOworCXJlbW92ZWRfa3YudmFsID0gTlVMTDsJCisKKwkvLyBFbXB0eSBz dWJ0cmVlCisJaWYgKG5vZGUgPT0gTlVMTCkgeworCQlyZXR1cm4gcmVtb3ZlZF9rdjsKKwl9CisK K2RlbF9sb29wOmZvciAoaSA9IDA7O2kgPSAwKSB7CisgICAgICAgICAgICAgCisgICAgICAgICAg ICAvL0lmIHRoZXJlIGFyZSBubyBrZXlzIHNpbXBseSByZXR1cm4KKyAgICAgICAgICAgIGlmKCFu b2RlLT5ucl9hY3RpdmUpCisgICAgICAgICAgICAgICAgcmV0dXJuIHJlbW92ZWRfa3Y7CisKKwkg ICAgLy8gRml4IHRoZSBpbmRleCBvZiB0aGUga2V5IGdyZWF0ZXIgdGhhbiBvciBlcXVhbAorCSAg ICAvLyB0byB0aGUga2V5IHRoYXQgd2Ugd291bGQgbGlrZSB0byBzZWFyY2gKKwkgICAgaSA9IHNl YXJjaF9rZXkobm9kZSxrdik7CisJICAgIGluZGV4ID0gaTsKKworCSAgICAvLyBJZiB3ZSBmaW5k IHN1Y2gga2V5IGJyZWFrCQkgICAgCisJICAgIGlmKGkgPCBub2RlLT5ucl9hY3RpdmUgJiYgCisJ CQlrdiA9PSBub2RlLT5rZXlfdmFsc1tpXS5rZXkpIHsKKwkJCWJyZWFrOworCSAgICB9CisgICAg ICAgICAgICBpZihub2RlLT5sZWFmKQorICAgICAgICAgICAgICAgIHJldHVybiByZW1vdmVkX2t2 OworICAgICAgICAgICAgICAgIAorICAgIAkgICAgLy9TdG9yZSB0aGUgcGFyZW50IG5vZGUKKwkg ICAgcGFyZW50ID0gbm9kZTsKKworCSAgICAvLyBUbyBnZXQgYSBjaGlsZCBub2RlIAorCSAgICBu b2RlID0gbm9kZS0+Y2hpbGRyZW5baV07CisKKyAgICAgICAgICAgIC8vSWYgTlVMTCBub3QgZm91 bmQKKyAgICAgICAgICAgIGlmIChub2RlID09IE5VTEwpCisgICAgICAgICAgICAgICAgcmV0dXJu IHJlbW92ZWRfa3Y7CisKKyAgICAgICAgICAgIGlmIChpbmRleCA9PSAocGFyZW50LT5ucl9hY3Rp dmUpKSB7ICAgCisgICAgICAgICAgICAgICAgbHNpYmxpbmcgPSAgcGFyZW50LT5jaGlsZHJlbltw YXJlbnQtPm5yX2FjdGl2ZSAtIDFdOworCSAgICAJcnNpYmxpbmcgPSBOVUxMOyAKKyAgICAgICAg ICAgIH0gZWxzZSBpZiAoaW5kZXggPT0gMCkgeworICAgICAgICAgICAgICAgIGxzaWJsaW5nID0g TlVMTDsKKyAgICAgICAgICAgICAgICByc2libGluZyA9IHBhcmVudC0+Y2hpbGRyZW5bMV07Cisg ICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAJbHNpYmxpbmcgPSBwYXJlbnQtPmNoaWxkcmVu W2kgLSAxXTsKKwkgICAgCXJzaWJsaW5nID0gcGFyZW50LT5jaGlsZHJlbltpICsgMV07CisgICAg ICAgICAgICB9CisKKwkgICAgaWYgKG5vZGUtPm5yX2FjdGl2ZSA9PSBidHJlZS0+b3JkZXIgLSAx ICYmIHBhcmVudCkgeworCQkvLyBUaGUgY3VycmVudCBub2RlIGhhcyAodCAtIDEpIGtleXMgYnV0 IHRoZSByaWdodCBzaWJsaW5nIGhhcyA+ICh0IC0gMSkKKwkJLy8ga2V5cworCQlpZiAocnNpYmxp bmcgJiYgKHJzaWJsaW5nLT5ucl9hY3RpdmUgPiBidHJlZS0+b3JkZXIgLSAxKSkgeworCQkJbW92 ZV9rZXkoYnRyZWUscGFyZW50LGksbGVmdCk7CisJCX0gZWxzZQorCQkvLyBUaGUgY3VycmVudCBu b2RlIGhhcyAodCAtIDEpIGtleXMgYnV0IHRoZSBsZWZ0IHNpYmxpbmcgaGFzICh0IC0gMSkKKwkJ Ly8ga2V5cworCQlpZiAobHNpYmxpbmcgJiYgKGxzaWJsaW5nLT5ucl9hY3Rpd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3JlbW92ZV9rdjsKKyAgICAgICAg ICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLT5jaGlsZHJlbltpbmRleF07CisgICAgICAgICAg ICAgICAgICAgICAgICBnb3RvIGRlbF9sb29wOworICAgICAgICAgICAgICAgCisJCX0gZWxzZSBp ZiAoKG5vZGUtPmNoaWxkcmVuW2luZGV4ICsgMV0tPm5yX2FjdGl2ZSA+IGJ0cmVlLT5vcmRlciAt IDEpICkgeworCQkJdG9fcmVtb3ZlX2t2ID0gbm9kZS0+a2V5X3ZhbHNbaW5kZXhdOworCisJCQlz dWJfbm9kZV9wb3MgPSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0X21pbl9r ZXlfcG9zKGJ0cmVlLG5vZGUtPmNoaWxkcmVuW2luZGV4ICsgMV0pOworICAgICAgICAgICAgICAg ICAgICAgICAga2V5X3ZhbCA9IHN1Yl9ub2RlX3Bvcy5ub2RlLT5rZXlfdmFsc1tzdWJfbm9kZV9w b3MuaW5kZXhdOworICAgICAgICAJCW5vZGUtPmtleV92YWxzW2luZGV4XSA9IGtleV92YWw7CQor ICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmZXJfdGFncyhub2RlLGluZGV4LHN1Yl9ub2Rl X3Bvcy5ub2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJfbm9kZV9wb3Mu aW5kZXgpOworCisJCQlzdWJfbm9kZV9wb3Mubm9kZS0+a2V5X3ZhbHNbc3ViX25vZGVfcG9zLmlu ZGV4XSA9IAorCQkJCXRvX3JlbW92ZV9rdjsKKworICAgICAgICAgICAgICAgICAgICAgICAgbm9k ZSA9IG5vZGUtPmNoaWxkcmVuW2luZGV4ICsgMV07CisgICAgICAgICAgICAgICAgICAgICAgICBn b3RvIGRlbF9sb29wOworICAgICAgICAgICAgICAKKwkJfSBlbHNlIGlmICggCisJCQlub2RlLT5j aGlsZHJlbltpbmRleF0tPm5yX2FjdGl2ZSA9PSBidHJlZS0+b3JkZXIgLSAxICYmCisJCQlub2Rl LT5jaGlsZHJlbltpbmRleCArIDFdLT5ucl9hY3RpdmUgPT0gYnRyZWUtPm9yZGVyIC0gMSkgewor CisJCQljb21iX25vZGUgPSBtZXJnZV9ub2RlcyhidHJlZSxub2RlLT5jaGlsZHJlbltpbmRleF0s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUtPmtleV92YWxzW2luZGV4XSwK KwkJCQlub2RlLT5jaGlsZHJlbltpbmRleCArIDFdKTsKKwkJCW5vZGUtPmNoaWxkcmVuW2luZGV4 XSA9IGNvbWJfbm9kZTsKKwkJCQorCQkJZm9yKGk9aW5kZXggKyAxO2k8bm9kZS0+bnJfYWN0aXZl O2krKykgeworCQkJCW5vZGUtPmNoaWxkcmVuW2ldID0gbm9kZS0+Y2hpbGRyZW5baSArIDFdOwor CQkJCW5vZGUtPmtleV92YWxzW2kgLSAxXSA9IG5vZGUtPmtleV92YWxzW2ldOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2Zlcl90YWdzKG5vZGUsaSxub2RlLGkgLSAxKTsK KwkJCX0KKwkJCW5vZGUtPm5yX2FjdGl2ZS0tOworICAgICAgICAgICAgICAgICAgICAgICAgaWYg KG5vZGUtPm5yX2FjdGl2ZSA9PSAwICYmIGJ0cmVlLT5yb290ID09IG5vZGUpIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZnJlZV9idHJlZV9ub2RlKG5vZGUpOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBidHJlZS0+cm9vdCA9IGNvbWJfbm9kZTsgICAgICAgIAor ICAgICAgICAgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUg PSBjb21iX25vZGU7CisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGRlbF9sb29wOworCQl9 CQkKKyAgICAgICAgICB9CisJCisJLy8gQ2FzZSAzOgorCS8vIEluIHRoaX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gdW5zaWduZWQgaW50IGN1cnJlbnRf bGV2ZWw7CisKKyAgICAgICBidHJlZV9ub2RlICogaGVhZCwgKiB0YWlsLCAqIG5vZGU7CisgICAg ICAgYnRyZWVfbm9kZSAqIGNoaWxkLCAqIGRlbF9ub2RlOworCisgICAgICAgbm9kZSA9IGJ0cmVl LT5yb290OworICAgICAgIGN1cnJlbnRfbGV2ZWwgPSBub2RlLT5sZXZlbDsKKyAgICAgICBoZWFk ID0gbm9kZTsKKyAgICAgICB0YWlsID0gbm9kZTsKKworICAgICAgIHdoaWxlKHRydWUpIHsKKyAg ICAgICAgICAgICAgIGlmKGhlYWQgPT0gTlVMTCkgeworICAgICAgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGlmIChoZWFkLT5sZXZlbCA8 IGN1cnJlbnRfbGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9sZXZlbCA9 IGhlYWQtPmxldmVsOworICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICBpZihoZWFk LT5sZWFmID09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgIGZvcihpID0gMCA7IGkg PCBoZWFkLT5ucl9hY3RpdmUgKyAxOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjaGlsZCA9IGhlYWQtPmNoaWxkcmVuW2ldOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHRhaWwtPm5leHQgPSBjaGlsZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB0YWlsID0gY2hpbGQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQtPm5l eHQgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICBkZWxfbm9kZSA9IGhlYWQ7CisgICAgICAgICAgICAgICBoZWFkID0gaGVh ZC0+bmV4dDsKKyAgICAgICAgICAgICAgIGZyZWVfYnRyZWVfbm9kZShkZWxfbm9kZSk7CisgICAg ICAgfQorCit9CisKK2ludCBidHJlZV90YWdnZWQoYnRyZWUgKiBidHJlZSwgaW50IHRhZykgewor ICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgIGJ0cmVlX25vZGUgKiBoZWFkLCAqIHRhaWw7Cisg ICAgICAgIGJ0cmVlX25vZGUgKiBjaGlsZDsKKworICAgICAgICBoZWFkID0gYnRyZWUtPnJvb3Q7 CisgICAgICAgIHRhaWwgPSBidHJlZS0+cm9vdDsKKworICAgICAgICB3aGlsZSh0cnVlKSB7Cisg ICAgICAgICAgICAgICAgaWYoaGVhZCA9PSBOVUxMKSB7CisgICAgICAgICAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmb3IgKGkgPSAw OyBpIDwgaGVhZC0+bnJfYWN0aXZlOyBpKysgKSB7CisgICAgICAgICAgICAgICAgICAKKyAgICAg ICAgICAgICAgICAgIGlmICh0YWcgIT0gLTEgJiYgdGFnX2dldChoZWFkLHRhZyxpKSkgCisgICAg ICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICAgIAorICAgICAgICAg ICAgICAgIH0gICAgIAorCisgICAgICAgICAgICAgICAgaWYoaGVhZC0+bGVhZiA9PSBmYWxzZSkg eworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGkgPSAwIDsgaSA8IGhlYWQtPm5yX2FjdGl2 ZSArIDE7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IGhl YWQtPmNoaWxkcmVuW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWlsLT5u ZXh0ID0gY2hpbGQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwgPSBjaGls ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQtPm5leHQgPSBOVUxMOwor ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBoZWFkID0gaGVhZC0+bmV4dDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKK30K K0VYUE9SVF9TWU1CT0woYnRyZWVfdGFnZ2VkKTsKKworLyoKKyAqIFJldHVybnMgMSBpZiBhbnkg c2xvdCBpbiB0aGUgbm9kZSBoYXMgdGhpcyB0YWcgc2V0LgorICogT3RoZXJ3aXNlIHJldHVybnMg MC4KKyAqLworc3RhdGljIGlubGluZSBpbnQgYW55X3RhZ19zZXQoc3RydWN0IGJ0cmVlX25vZGUg Km5vZGUsIGludCB0YWcpCit7CisgICAgICAgIGludCBpZHg7CisgICAgICAgIGZvciAoaWR4ID0g MDsgaWR4IDwgQlRSRUVfVEFHX0xPTkdTOyBpZHgrKykgeworICAgICAgICAgICAgICAgIGlmIChu b2RlLT50YWdzW3RhZ11baWR4XSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOwor ICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgdm9pZCBjbGVhcl90YWdz KGJ0cmVlX25vZGUgKiBub2RlLCBpbnQgaW5kZXgpIHsKKwkgaW50IHRhZzsKKyAgICAgICAgZm9y ICh0YWcgPSAwO3RhZzwgQlRSRUVfVEFHUzsgdGFnKyspIHsKKwkJdGFnX2NsZWFyKG5vZGUsdGFn LGluZGV4KTsKKyAgICAgICAgfQorfQorCitzdGF0aWMgdm9pZCB0cmFuc2Zlcl90YWdzKGJ0cmVl X25vZGUgKiBzb3VyY2Vfbm9kZSwgaW50IHNvdXJjZV9pbmRleCwKKyAgICAgICAgICAgICAgICBi dHJlZV9ub2RlICogZGVzdF9ub2RlLGludCBkZXN0X2luZGV4KSB7CisKKyAgICAgICAgaW50IHRh ZzsKKyAgICAgICAgZm9yICh0YWcgPSAwO3RhZzwgQlRSRUVfVEFHUzsgdGFnKyspIHsKKyAgICAg ICAgICAgICAgICBpZiAodGFnX2dldChzb3VyY2Vfbm9kZSx0YWcsc291cmNlX2luZGV4KSkgewor ICAgICAgICAgICAgICAgICAgICAgICAgdGFnX3NldChkZXN0X25vZGUsdGFnLGRlc3RfaW5kZXgp OworICAgICAgICAgICAgICAgICAgICAgICAgdGFnX2NsZWFyKHNvdXJjZV9ub2RlLHRhZyxzb3Vy Y2VfaW5kZXgpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAg ICAgICB0YWdfY2xlYXIoZGVzdF9ub2RlLHRhZyxkZXN0X2luZGV4KTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgIH0KK30KKworc3RhdGljIHVuc2lnbmVkIGludCBfX2xvb2t1cChidHJlZSAq IGJ0cmVlLCB2b2lkICoqIHJlc3VsdHMsCisgICAgICAgIHVuc2lnbmVkIGxvbmcgZmlyc3RfaW5k ZXgsdW5zaWduZWQgaW50IG1heF9pdGVtcywgaW50IHRhZykgeworCisgICAgICAgIGludCBpID0g MCwgaiA9IDA7CisgICAgICAgIGludCByZXQgPSAwOworICAgICAgICB1bnNpZ25lZCBsb25nIGtl eTsKKyAgICAgICAgYnRyZWVfbm9kZSAqIGhlYWQsICogdGFpbDsKKyAgICAgICAgYnRyZWVfbm9k ZSAqIGNoaWxkOworCisgICAgICAgIGhlYWQgPSBidHJlZS0+cm9vdDsKKyAgICAgICAgdGFpbCA9 IGJ0cmVlLT5yb290OworCisgICAgICAgIHdoaWxlKHRydWUpIHsKKyAgICAgICAgICAgICAgICBp ZihoZWFkID09IE5VTEwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgoaGVhZC0+a2V5X3ZhbHNbaGVhZC0+ bnJfYWN0aXZlIC0gMV0ua2V5IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PSBm aXJzdF9pbmRleCkgJiYgKHJldCA8IG1heF9pdGVtcykpIHsKKyAgICAgICAgICAgICAgICAgICBm b3IgKGkgPSAwOyBpIDwgaGVhZC0+bnJfYWN0aXZlOyBpKysgKSB7CisgICAgICAgICAgICAgICAg ICAgICAKKyAgICAgICAgICAgICAgICAgICAgIGlmICh0YWcgIT0gLTEgJiYgIXRhZ19nZXQoaGVh ZCx0YWcsaSkpIAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAg ICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgIGlmICgoa2V5ID0gaGVhZC0+a2V5X3Zh bHNbaV0ua2V5KSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID49IGZpcnN0X2luZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v IEluc2VydGlvbiBzb3J0ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBmb3IgKGogPSAocmV0IC0gMSk7aj49MDtqLS0pIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaWYgKGJ0cmVlLT5rZXkocmVzdWx0c1tqXSkgPiBrZXkpIHsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNb aiArIDFdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByZXN1bHRzW2pdOyAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0c1srK2pdID0gaGVh ZC0+a2V5X3ZhbHNbaV0udmFsOyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0 Kys7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmV0ID09IG1heF9pdGVt cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB9ICAg ICAgICAgICAKKyAgICAgICAgICAgICAgICAgICB9ICAgICAKKyAgICAgICAgICAgICAgICB9CisK KyAgICAgICAgICAgICAgICBpZihoZWFkLT5sZWFmID09IGZhbHNlKSB7CisgICAgICAgICAgICAg ICAgICAgICAgICBmb3IoaSA9IDAgOyBpIDwgaGVhZC0+bnJfYWN0aXZlICsgMTsgaSsrKSB7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkID0gaGVhZC0+Y2hpbGRyZW5baV07 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwtPm5leHQgPSBjaGlsZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFpbCA9IGNoaWxkOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjaGlsZC0+bmV4dCA9IE5VTEw7CisgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFk LT5uZXh0OworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXQ7Cit9CisKKy8qKgorKiAgICAg ICBQZXJmb3JtIG11bHRpcGxlIGxvb2t1cCBvbiB0aGUgQi1UcmVlCisqICAgICAgIEBwYXJhbSBi dHJlZSBUaGUgYnRyZWUKKyogICAgICAgQHBhcmFtIHJlc3VsdHMgd2hlcmUgdGhlIHJlc3VsdHMg d2lsbCBi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cC5pbmRleCk7CisJfQorICAg ICAgICBCVUdfT04oa2V5X3ZhbCA9PSBOVUxMKTsKKwlyZXR1cm4ga2V5X3ZhbDsgCit9CitFWFBP UlRfU1lNQk9MKGJ0cmVlX3RhZ19jbGVhcik7CisKKy8qKgorKiAgICAgICBVc2VkIHRvIHZlcmlm eSB3aGV0aGVyIGEgdGFnIGlzIHNldAorKiAgICAgICBAcGFyYW0gYnRyZWUgVGhlIGJ0cmVlCisq ICAgICAgIEBwYXJhbSBrZXkgVGhlIGtleQorKiAgICAgICBAcGFyYW0gdGFnIFRoZSB0YWcKKyog ICAgICAgQHJldHVybgorKiAgICAgICAwOiB0YWcgbm90IHByZXNlbnQKKyogICAgICAgMTogdGFn IHByZXNlbnQsIHNldAorKiAgICAgICAtMTogdGFnIHByZXNlbnQsIHVuc2V0IAorKi8KK2ludCBi dHJlZV90YWdfZ2V0KGJ0cmVlICogYnRyZWUsdW5zaWduZWQgbG9uZyBrZXksIGludCB0YWcpIHsK KyAgICAgICAgaW50IHJldCA9IDA7CisgICAgICAgIGJ0X2tleV92YWwgKiBrZXlfdmFsID0gTlVM TDsKKwlub2RlX3BvcyBrcCA9IGdldF9idHJlZV9ub2RlKGJ0cmVlLGtleSk7CisKKwlpZihrcC5u b2RlKSB7CisJCWtleV92YWwgPSAma3Aubm9kZS0+a2V5X3ZhbHNba3AuaW5kZXhdOworICAgICAg ICAgICAgICAgIHJldCA9IHRhZ19nZXQoa3Aubm9kZSx0YWcsa3AuaW5kZXgpOworICAgICAgICAg ICAgICAgIHJldHVybiByZXQ/IDEgOiAtMTsKKwl9CisgICAgICAgIEJVR19PTihrZXlfdmFsID09 IE5VTEwpOworCXJldHVybiByZXQ7IAorfQorRVhQT1JUX1NZTUJPTChidHJlZV90YWdfZ2V0KTsK KworCisvKioKKyoJR2V0IHRoZSBtYXgga2V5IGluIHRoZSBidHJlZQorKglAcGFyYW0gYnRyZWUg VGhlIGJ0cmVlCisqCUByZXR1cm4gVGhlIG1heCBr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JlZSx1bnNpZ25lZCBsb25nIGtleSwgaW50IHRhZyk7Citl eHRlcm4gdm9pZCBidHJlZV9kZXN0cm95KGJ0cmVlICogYnRyZWUpOworZXh0ZXJuIHVuc2lnbmVk IGxvbmcgYnRyZWVfZ2V0X21heF9rZXkoYnRyZWUgKiBidHJlZSk7CitleHRlcm4gdW5zaWduZWQg bG9uZyBidHJlZV9nZXRfbWluX2tleShidHJlZSAqIGJ0cmVlKTsKK2V4dGVybiB1bnNpZ25lZCBs b25nIGJ0cmVlX3ZhbHVlX2ZuKHVuc2lnbmVkIGxvbmcga2V5KTsKK2V4dGVybiB1bnNpZ25lZCBs b25nIGJ0cmVlX2tleV9mbih2b2lkICogcGFnZSk7CitleHRlcm4gdm9pZCBidHJlZV9wcmludF9m bih1bnNpZ25lZCBsb25nIGtleSk7CitleHRlcm4gaW50IGJ0cmVlX3ByZWxvYWQoZ2ZwX3QgZ2Zw X21hc2spOworZXh0ZXJuIGludCBidHJlZV90YWdnZWQoYnRyZWUgKiBidHJlZSwgaW50IHRhZyk7 CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBidHJlZV9wcmVsb2FkX2VuZCh2b2lkKQoreworICAgICAg ICBwcmVlbXB0X2VuYWJsZSgpOworfQorCisjZGVmaW5lIEJUUkVFX0lOSVQobWFzaykgeyBcCisg ICAgICAgIC5vcmRlciAgICAgICAgICA9IEJUUkVFX09SREVSLCAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCisgICAgICAgIC5yb290ICAgICAgICAgICA9IE5VTEwsICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIC52YWx1ZSAgICAgICAgICA9IGJ0cmVlX3Zh bHVlX2ZuLCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIC5rZXkgICAgICAgICAg ICA9IGJ0cmVlX2tleV9mbiwgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIC5w cmludF9rZXkgICAgICA9IGJ0cmVlX3ByaW50X2ZuLCAgICAgICAgICAgICAgICAgICAgICAgICBc CisgICAgICAgIC5nZnBfbWFzayAgICAgICA9IChtYXNrKSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCit9CisKKyNkZWZpbmUgSU5JVF9CVFJFRShidHJlZSxtYXNrKSAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCitkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAoYnRyZWUpLT5vcmRlciA9IEJUUkVF X09SREVSOyAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgKGJ0cmVlKS0+cm9vdCA9IE5V TEw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIChidHJlZSktPnZhbHVl ICAgICAgICAgICAgPSBidHJlZV92YWx1ZV9mbjsgICAgICAgXAorICAgICAgICAoYnRyZWUpLT5r ZXkgICAgICAgICAgICAgID0gYnRyZWVfa2V5X2ZuOyAgICAgICAgIFwKKyAgICAgICAgKGJ0cmVl KS0+cHJpbnRfa2V5ICAgICAgICA9IGJ0cmVlX3ByaW50X2ZuOyAgICAgICBcCisgICAgICAgIChi dHJlZSktPmdmcF9tYXNrICAgICAgICAgPSAobWFzayk7ICAgICAgICAgICAgICAgXAorfSB3aGls ZSAoMCkKKworCitleHRlcm4gdm9pZCBwcmludF9zdWJ0cmVlKGJ0cmVlICogYnRyZWUsYnRyZWVf bm9kZSAqIG5vZGUpOworCisjZW5kaWYKZGlmZiAtdXJOIGxpbnV4LTIuNi4xNi4yL2luY2x1ZGUv bGludXgvZnMuaCBsaW51eC0yLjYuMTYuMi1idHJlZS9pbmNsdWRlL2xpbnV4L2ZzLmgKLS0tIGxp bnV4LTIuNi4xNi4yL2luY2x1ZGUvbGludXgvZnMuaAkyMDA2LTA0LTA3IDEyOjU2OjQ3LjAwMDAw MDAwMCAtMDQwMAorKysgbGludXgtMi42LjE2LjItYnRyZWUvaW5jbHVkZS9saW51eC9mcy5oCTIw MDYtMDgtMTcgMjE6MTE6MjEuMDAwMDAwMDAwIC0wNDAwCkBAIC0yMTQsNiArMjE0LDcgQEAKICNp bmNsdWRlIDxsaW51eC9rb2JqZWN0Lmg+CiAjaW5jbHVkZSA8bGludXgvbGlzdC5oPgogI2luY2x1 ZGUgPGxpbnV4L3JhZGl4LXRyZWUuaD4KKyNpbmNsdWRlIDxsaW51eC9idHJlZS5oPgogI2luY2x1 ZGUgPGxpbnV4L3ByaW9fdHJlZS5oPgogI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4KICNpbmNsdWRl IDxsaW51eC9zY2hlZC5oPgpAQCAtMzcyLDYgKzM3Myw3IEBACiBzdHJ1Y3QgYWRkcmVzc19zcGFj ZSB7CiAJc3RydWN0IGlub2RlCQkqaG9zdDsJCS8qIG93bmVyOiBpbm9kZSwgYmxvY2tfZGV2aWNl ICovCiAJc3RydWN0IHJhZGl4X3RyZWVfcm9vdAlwYWdlX3RyZWU7CS8qIHJhZGl4IHRyZWUgb2Yg YWxsIHBhZ2VzICovCisgICAgICAgIHN0cnVjdCBidHJlZSAgICAgICAgICAgIGJ0cmVlOyAgICAg ICAgICAvKiBCVHJlZSBvZiBhbGwgcGFnZXMqLwogCXJ3bG9ja190CQl0cmVlX2xvY2s7CS8qIGFu ZCByd2xvY2sgcHJvdGVjdGluZyBpdCAqLwogCXVuc2lnbmVkIGludAkJaV9tbWFwX3dyaXRhYmxl Oy8qIGNvdW50IFZNX1NIQVJFRCBtYXBwaW5ncyAqLwogCXN0cnVjdCBwcmlvX3RyZWVfcm9vdAlp X21tYXA7CQkvKiB0cmVlIG9mIHByaXZhdGUgYW5kIHNoYXJlZCBtYXBwaW5ncyAqLwo= ------=_Part_17202_32626162.1155865413814 Content-Type: text/plain; name=btree.txt; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_eqzw9zbk Content-Disposition: attachment; filename="btree.txt" ICAgICAgICAgICAgICA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 NTQlICAgICAwLjY2OCAgICAxMjUuNzggICAwLjAwMDAwICAwLjAwMDAwICAgIDUyCjIuNi4xNi4y LWJ0cmVlICAgICAgMTAwNCAgNDA5NiAgICA0ICAgIDAuOTYgMi45MDQlICAgICAwLjYyMCAgICAx MTMuNjYgICAwLjAwMDAwICAwLjAwMDAwICAgIDMzCjIuNi4xNi4yLWJ0cmVlICAgICAgMTAwNCAg NDA5NiAgICA4ICAgIDEuMDQgNC42MzIlICAgICAwLjQ2MSAgICAxNzUuNDkgICAwLjAwMDAwICAw LjAwMDAwICAgIDIyCg== ------=_Part_17202_32626162.1155865413814 Content-Type: text/plain; name=radixtree.txt; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_eqzwa6su Content-Disposition: attachment; filename="radixtree.txt" ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZSAgQmxrICAgTnVtICAgICAgICAgICAg ICAgICAgIEF2ZyAgICAgIE1heGltdW0gICAgICBMYXQlICAgICBMYXQlICAgIENQVQpJZGVudGlm aWVyICAgICAgICAgICAgICAgICAgICBTaXplICBTaXplICBUaHIgICBSYXRlICAoQ1BVJSkgIExh dGVuY3kgICAgTGF0ZW5jeSAgICAgID4ycyAgICAgID4xMHMgICAgRWZmCi0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gLS0tLS0tIC0tLS0tIC0tLSAgLS0tLS0tIC0tLS0tLSAtLS0tLS0tLS0g LS0tLS0tLS0tLS0gIC0tLS0tLS0tIC0tLS0tLS0tIC0tLS0tClNlcXVlbnRpYWwgUmVhZHMKMi42 LjE1LTEuMjA1NF9GQzVzbXAgICAgICAgICAgMTAwNCAgNDA5NiAgICAxICAgNTQuMzEgOS4zNzAl ICAgICAwLjA3MSAgICAgMjkuOTggICAwLjAwMDAwICAwLjAwMDAwICAgNTgwCjIuNi4xNS0xLjIw NTRfRkM1c21wICAgICAgICAgIDEwMDQgIDQwOTYgICAgMiAgIDM5LjY2IDExL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AwMDAgICAxOTgKMi42LjE1LTEuMjA1NF9GQzVzbXAgICAgICAgICAgMTAwNCAgNDA5NiAg ICAyICAgNDUuODIgNTEuNTklICAgICAwLjEzNSAgIDI3NDIuMjcgICAwLjAwMDc4ICAwLjAwMDAw ICAgIDg5CjIuNi4xNS0xLjIwNTRfRkM1c21wICAgICAgICAgIDEwMDQgIDQwOTYgICAgNCAgIDQ0 LjM0IDk5LjgxJSAgICAgMC4yOTEgICAzMTkwLjY1ICAgMC4wMDI3MiAgMC4wMDAwMCAgICA0NAoy LjYuMTUtMS4yMDU0X0ZDNXNtcCAgICAgICAgICAxMDA0ICA0MDk2ICAgIDggICA0Mi41NyAxODEu MSUgICAgIDAuNDU1ICAgNDQ2My44MSAgIDAuMDAyMzQgIDAuMDAwMDAgICAgMjQKClJhbmRvbSBX cml0ZXMKMi42LjE1LTEuMjA1NF9GQzVzbXAgICAgICAgICAgMTAwNCAgNDA5NiAgICAxICAgIDEu NDYgMC41NjElICAgICAwLjA4NiAgICAgMjkuMDggICAwLjAwMDAwICAwLjAwMDAwICAgMjYwCjIu Ni4xNS0xLjIwNTRfRkM1c21wICAgICAgICAgIDEwMDQgIDQwOTYgICAgMiAgICAxLjQ0IDEuNTQ3 JSAgICAgMC4wNzIgICAgIDQyLjg0ICAgMC4wMDAwMCAgMC4wMDAwMCAgICA5MwoyLjYuMTUtMS4y MDU0X0ZDNXNtcCAgICAgICAgICAxMDA0ICA0MDk2ICAgIDQgICAgMS40NyAyLjcwNyUgICAgIDAu MDE1ICAgICAgMC41NSAgIDAuMDAwMDAgIDAuMDAwMDAgICAgNTQKMi42LjE1LTEuMjA1NF9GQzVz bXAgICAgICAgICAgMTAwNCAgNDA5NiAgICA4ICAgIDEuNDMgNy4zMTMlICAgICAwLjAxNSAgICAg IDAuNjAgICAwLjAwMDAwICAwLjAwMDAwICAgIDIwCg== ------=_Part_17202_32626162.1155865413814-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/