From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6EkO-0002fg-Iz for barebox@lists.infradead.org; Tue, 08 Dec 2015 09:40:15 +0000 From: Markus Pargmann Date: Tue, 8 Dec 2015 10:39:32 +0100 Message-Id: <1449567572-21758-10-git-send-email-mpa@pengutronix.de> In-Reply-To: <1449567572-21758-1-git-send-email-mpa@pengutronix.de> References: <1449567572-21758-1-git-send-email-mpa@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 9/9] fs: Add pstore filesystem To: barebox@lists.infradead.org cHN0b3JlIGlzIGEgcGVyc2lzdGVudCBzdG9yYWdlIGZpbGVzeXN0ZW0gdXNlZCBmb3IgUkFNT09Q Uy4gSXQgaXMgdXNlZAp0byBzdG9yZSBjb25zb2xlIGxvZ3MsIHBhbmljcywgZnRyYWNlIGFuZCBv dGhlciBpbmZvcm1hdGlvbiBpbiBjYXNlIG9mIGEKY3Jhc2gvcGFuaWMvb29wcy9yZWJvb3QuCgpw c3RvcmUgaXMgaW1wbGVtZW50ZWQgZm9yIGJhcmVib3ggYXMgYSByZWFkLW9ubHkgZmlsZXN5c3Rl bSBhdCB0aGUKbW9tZW50LiBJdCBtYXkgYmUgZXh0ZW5kZWQgbGF0ZXIgb24uIFRoZSBpZGVhIGlz IHRvIHByb3ZpZGUgYSB3YXkgdG8KZXh0cmFjdCBlc3NlbnRpYWwgZGF0YSBmcm9tIHRoZSBsYXN0 IHJ1bm5pbmcga2VybmVsLgoKTW9zdCBvZiB0aGUgY29kZSBpcyBjb3BpZWQgZnJvbSB0aGUga2Vy bmVsLiBIb3dldmVyIHRoaXMgaXMgb25seSBhCmxpZ2h0d2VpZ2h0IGltcGxlbWVudGF0aW9uIHdp dGhvdXQgcmVhbCB3cml0ZSBzdXBwb3J0IHlldC4KClNpZ25lZC1vZmYtYnk6IE1hcmt1cyBQYXJn bWFubiA8bXBhQHBlbmd1dHJvbml4LmRlPgotLS0KCk5vdGVzOgogICAgQ2hhbmdlcyBpbiB2MjoK ICAgIC0gTW92ZWQgdGhlIGNvbmZpZyBzeW1ib2wgZnJvbSB0aGUgcHN0b3JlIE1ha2VmaWxlIHRv IHRoZSB1cHBlciBsZXZlbCBNYWtlZmlsZQoKIGNvbW1vbi9zdGFydHVwLmMgICAgICAgICAgIHwg ICA1ICsKIGZzL0tjb25maWcgICAgICAgICAgICAgICAgIHwgICAyICsKIGZzL01ha2VmaWxlICAg ICAgICAgICAgICAgIHwgICAxICsKIGZzL3BzdG9yZS9LY29uZmlnICAgICAgICAgIHwgIDg2ICsr KysrKysrCiBmcy9wc3RvcmUvTWFrZWZpbGUgICAgICAgICB8ICAgOSArCiBmcy9wc3RvcmUvZnMu YyAgICAgICAgICAgICB8IDI4MCArKysrKysrKysrKysrKysrKysrKysrKysrCiBmcy9wc3RvcmUv aW50ZXJuYWwuaCAgICAgICB8ICAxOSArKwogZnMvcHN0b3JlL3BsYXRmb3JtLmMgICAgICAgfCAx MzggKysrKysrKysrKysrCiBmcy9wc3RvcmUvcmFtLmMgICAgICAgICAgICB8IDUwNyArKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIGZzL3BzdG9yZS9yYW1fY29y ZS5jICAgICAgIHwgNDI2ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIGlu Y2x1ZGUvbGludXgvcHN0b3JlLmggICAgIHwgIDkwICsrKysrKysrCiBpbmNsdWRlL2xpbnV4L3Bz dG9yZV9yYW0uaCB8ICA4NyArKysrKysrKwogMTIgZmlsZXMgY2hhbmdlZCwgMTY1MCBpbnNl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JuIE5VTEw7CisK KwlwcnogPSBwcnpzW2ldOworCWlmICghcHJ6KQorCQlyZXR1cm4gTlVMTDsKKworCS8qIFVwZGF0 ZSBvbGQvc2hhZG93ZWQgYnVmZmVyLiAqLworCWlmICh1cGRhdGUpCisJCXBlcnNpc3RlbnRfcmFt X3NhdmVfb2xkKHByeik7CisKKwlpZiAoIXBlcnNpc3RlbnRfcmFtX29sZF9zaXplKHByeikpCisJ CXJldHVybiBOVUxMOworCisJKnR5cGVwID0gdHlwZTsKKwkqaWQgPSBpOworCisJcmV0dXJuIHBy ejsKK30KKworc3RhdGljIGJvb2wgcHJ6X29rKHN0cnVjdCBwZXJzaXN0ZW50X3JhbV96b25lICpw cnopCit7CisJcmV0dXJuICEhcHJ6ICYmICEhKHBlcnNpc3RlbnRfcmFtX29sZF9zaXplKHByeikg KworCQkJICAgcGVyc2lzdGVudF9yYW1fZWNjX3N0cmluZyhwcnosIE5VTEwsIDApKTsKK30KKwor c3RhdGljIHNzaXplX3QgcmFtb29wc19wc3RvcmVfcmVhZCh1NjQgKmlkLCBlbnVtIHBzdG9yZV90 eXBlX2lkICp0eXBlLAorCQkJCSAgIGludCAqY291bnQsIGNoYXIgKipidWYsIGJvb2wgKmNvbXBy ZXNzZWQsCisJCQkJICAgc3RydWN0IHBzdG9yZV9pbmZvICpwc2kpCit7CisJc3NpemVfdCBzaXpl OworCXNzaXplX3QgZWNjX25vdGljZV9zaXplOworCXN0cnVjdCByYW1vb3BzX2NvbnRleHQgKmN4 dCA9IHBzaS0+ZGF0YTsKKwlzdHJ1Y3QgcGVyc2lzdGVudF9yYW1fem9uZSAqcHJ6OworCisJcHJ6 ID0gcmFtb29wc19nZXRfbmV4dF9wcnooY3h0LT5wcnpzLCAmY3h0LT5kdW1wX3JlYWRfY250LAor CQkJCSAgIGN4dC0+bWF4X2R1bXBfY250LCBpZCwgdHlwZSwKKwkJCQkgICBQU1RPUkVfVFlQRV9E TUVTRywgMCk7CisJaWYgKCFwcnpfb2socHJ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QDB4JWxseCk6ICVkXG4iLAorCQkJc3osICh1bnNpZ25lZCBsb25nIGxvbmcp KnBhZGRyLCBlcnIpOworCQlyZXR1cm4gZXJyOworCX0KKworCXBlcnNpc3RlbnRfcmFtX3phcCgq cHJ6KTsKKworCSpwYWRkciArPSBzejsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJh bW9vcHNfcHJvYmUoc3RydWN0IHJhbW9vcHNfcGxhdGZvcm1fZGF0YSAqcGRhdGEpCit7CisJc3Ry dWN0IHJhbW9vcHNfY29udGV4dCAqY3h0ID0gJm9vcHNfY3h0OworCXNpemVfdCBkdW1wX21lbV9z ejsKKwlwaHlzX2FkZHJfdCBwYWRkcjsKKwlpbnQgZXJyID0gLUVJTlZBTDsKKwljaGFyIGtlcm5l bGFyZ3NbNTEyXTsKKworCS8qIE9ubHkgYSBzaW5nbGUgcmFtb29wcyBhcmVhIGFsbG93ZWQgYXQg YSB0aW1lLCBzbyBmYWlsIGV4dHJhCisJICogcHJvYmVzLgorCSAqLworCWlmIChjeHQtPm1heF9k dW1wX2NudCkKKwkJZ290byBmYWlsX291dDsKKworCWlmICghcGRhdGEtPm1lbV9zaXplIHx8ICgh cGRhdGEtPnJlY29yZF9zaXplICYmICFwZGF0YS0+Y29uc29sZV9zaXplICYmCisJCQkhcGRhdGEt PmZ0cmFjZV9zaXplICYmICFwZGF0YS0+cG1zZ19zaXplKSkgeworCQlwcl9lcnIoIlRoZSBtZW1v cnkgc2l6ZSBhbmQgdGhlIHJlY29yZC9jb25zb2xlIHNpemUgbXVzdCBiZSAiCisJCQkibm9uLXpl cm9cbiIpOworCQlnb3RvIGZhaWxfb3V0OworCX0KKworCWlmIChwZGF0YS0+cmVjb3JkX3NpemUg JiYgIWlzX3Bvd2VyX29mXzIocGRhdGEtPnJlY29yZF9zaXplKSkKKwkJcGRhdGEtPnJlY29yZF9z aXplID0gcm91bmRkb3duX3Bvd19vZl90d28ocGRhdGEtPnJlY29yZF9zaXplKTsKKwlp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6ZSBjb3VudGVyIHVudGlsIGl0IGhpdHMgdGhlIG1heCBzaXplICovCitzdGF0aWMgdm9p ZCBidWZmZXJfc2l6ZV9hZGQoc3RydWN0IHBlcnNpc3RlbnRfcmFtX3pvbmUgKnByeiwgc2l6ZV90 IGEpCit7CisJc2l6ZV90IG9sZDsKKwlzaXplX3QgbmV3OworCisJb2xkID0gcHJ6LT5idWZmZXIt PnNpemU7CisJaWYgKG9sZCA9PSBwcnotPmJ1ZmZlcl9zaXplKQorCQlyZXR1cm47CisKKwluZXcg PSBvbGQgKyBhOworCWlmIChuZXcgPiBwcnotPmJ1ZmZlcl9zaXplKQorCQluZXcgPSBwcnotPmJ1 ZmZlcl9zaXplOworCXByei0+YnVmZmVyLT5zaXplID0gbmV3OworfQorCitzdGF0aWMgdm9pZCBu b3RyYWNlIHBlcnNpc3RlbnRfcmFtX2VuY29kZV9yczgoc3RydWN0IHBlcnNpc3RlbnRfcmFtX3pv bmUgKnByeiwKKwl1aW50OF90ICpkYXRhLCBzaXplX3QgbGVuLCB1aW50OF90ICplY2MpCit7CisJ aW50IGk7CisJdWludDE2X3QgcGFyW3Byei0+ZWNjX2luZm8uZWNjX3NpemVdOworCisJLyogSW5p dGlhbGl6ZSB0aGUgcGFyaXR5IGJ1ZmZlciAqLworCW1lbXNldChwYXIsIDAsIHNpemVvZihwYXIp KTsKKwllbmNvZGVfcnM4KHByei0+cnNfZGVjb2RlciwgZGF0YSwgbGVuLCBwYXIsIDApOworCWZv ciAoaSA9IDA7IGkgPCBwcnotPmVjY19pbmZvLmVjY19zaXplOyBpKyspCisJCWVjY1tpXSA9IHBh cltpXTsKK30KKworc3RhdGljIGludCBwZXJzaXN0ZW50X3JhbV9kZWNvZGVfcnM4KHN0cnVjdCBw ZXJzaXN0ZW50X3JhbV96b25lICpwcnosCisJdm9pZCAqZGF0YSwgc2l6ZV90IGxlbiwgdWludDhf dCAqZWNjKQoreworCWludCBpOworCXVpbnQxNl90IHBhcltwcnotPmVjY19pbm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ei0+ZWNjX2luZm8ucG9seSwKKwkJCQkgIDAs IDEsIHByei0+ZWNjX2luZm8uZWNjX3NpemUpOworCWlmIChwcnotPnJzX2RlY29kZXIgPT0gTlVM TCkgeworCQlwcl9pbmZvKCJpbml0X3JzIGZhaWxlZFxuIik7CisJCXJldHVybiAtRUlOVkFMOwor CX0KKworCXByei0+Y29ycmVjdGVkX2J5dGVzID0gMDsKKwlwcnotPmJhZF9ibG9ja3MgPSAwOwor CisJbnVtZXJyID0gcGVyc2lzdGVudF9yYW1fZGVjb2RlX3JzOChwcnosIGJ1ZmZlciwgc2l6ZW9m KCpidWZmZXIpLAorCQkJCQkgICBwcnotPnBhcl9oZWFkZXIpOworCWlmIChudW1lcnIgPiAwKSB7 CisJCXByX2luZm8oImVycm9yIGluIGhlYWRlciwgJWRcbiIsIG51bWVycik7CisJCXByei0+Y29y cmVjdGVkX2J5dGVzICs9IG51bWVycjsKKwl9IGVsc2UgaWYgKG51bWVyciA8IDApIHsKKwkJcHJf aW5mbygidW5jb3JyZWN0YWJsZSBlcnJvciBpbiBoZWFkZXJcbiIpOworCQlwcnotPmJhZF9ibG9j a3MrKzsKKwl9CisKKwlyZXR1cm4gMDsKK30KKworc3NpemVfdCBwZXJzaXN0ZW50X3JhbV9lY2Nf c3RyaW5nKHN0cnVjdCBwZXJzaXN0ZW50X3JhbV96b25lICpwcnosCisJY2hhciAqc3RyLCBzaXpl X3QgbGVuKQoreworCXNzaXplX3QgcmV0OworCisJaWYgKCFwcnotPmVjY19pbmZvLmVjY19zaXpl KQorCQlyZXR1cm4gMDsKKworCWlmIChwcnotPmNvcnJlY3RlZF9ieXRlcyB8fCBwcnotPmJhZF9i bG9ja3MpCisJCXJldCA9IHNucHJpbnRmKHN0ciwgbGVuLCAiIgorCQkJIlxuJWQgQ29ycmVjdGVk IGJ5dGVzLCAlZCB1bnJlY292ZXJhYmxlIGJsb2Nrc1xuIiwKKwkJCXByei0+Y29ycmVjdGVkX2J5 dGVzLCBwcnotPmJ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0+YnVmZmVyLT5zaWcp OworCX0KKworCXByei0+YnVmZmVyLT5zaWcgPSBzaWc7CisJcGVyc2lzdGVudF9yYW1femFwKHBy eik7CisKKwlyZXR1cm4gMDsKK30KKwordm9pZCBwZXJzaXN0ZW50X3JhbV9mcmVlKHN0cnVjdCBw ZXJzaXN0ZW50X3JhbV96b25lICpwcnopCit7CisJaWYgKCFwcnopCisJCXJldHVybjsKKworCWlm IChwcnotPnJlcykgeworCQlyZWxlYXNlX3NkcmFtX3JlZ2lvbihwcnotPnJlcyk7CisJCXByei0+ cmVzID0gTlVMTDsKKwl9CisKKwlwZXJzaXN0ZW50X3JhbV9mcmVlX29sZChwcnopOworCWtmcmVl KHByeik7Cit9CisKK3N0cnVjdCBwZXJzaXN0ZW50X3JhbV96b25lICpwZXJzaXN0ZW50X3JhbV9u ZXcocGh5c19hZGRyX3Qgc3RhcnQsIHNpemVfdCBzaXplLAorCQkJdTMyIHNpZywgc3RydWN0IHBl cnNpc3RlbnRfcmFtX2VjY19pbmZvICplY2NfaW5mbywKKwkJCXVuc2lnbmVkIGludCBtZW10eXBl KQoreworCXN0cnVjdCBwZXJzaXN0ZW50X3JhbV96b25lICpwcno7CisJaW50IHJldCA9IC1FTk9N RU07CisKKwlwcnogPSBremFsbG9jKHNpemVvZihzdHJ1Y3QgcGVyc2lzdGVudF9yYW1fem9uZSks IEdGUF9LRVJORUwpOworCWlmICghcHJ6KSB7CisJCXByX2VycigiZmFpbGVkIHRvIGFsbG9jYXRl IHBlcnNpc3RlbnQgcmFtIHpvbmVcbiIpOworCQlnb3RvIGVycjsKKwl9CisKKwlyZXQgPSBwZXJz aXN0ZW50X3JhbV9idWZmZXJfbWFwKHN0YXJ0LCBzaXplLCBwcnosIG1lbXR5cGUpOworCWlmIChy ZXQpCisJCWdvdG8gZXJyOworCisJcmV0ID0gcGVyc2lzdGVudF9yYW1fcG9zdF9pbml0KHByeiwg c2lnLCBlY2NfaW5mbyk7CisJaWYgKHJldCkKKwkJZ290by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