From: Jiaying Zhang Subject: Re: Question on fallocate/ftruncate sequence Date: Fri, 2 Oct 2009 16:21:23 -0700 Message-ID: <5df78e1d0910021621r5c973713hffed161bf92647cf@mail.gmail.com> References: <1248389165.17459.3.camel@bobble.smo.corp.google.com> <5df78e1d0908311633k1f16a096t701e0cdab54b174c@mail.gmail.com> <20090902084134.GO4197@webber.adilger.int> <5df78e1d0909022220m1152b313o92f6cb7cc8858298@mail.gmail.com> <5df78e1d0909232227y2cb52abew827d7732a3bc9040@mail.gmail.com> <4AC25CCB.8050805@redhat.com> <5df78e1d0909291238q44bbf9e8q98205ffa9b6b2518@mail.gmail.com> <4AC26630.6030509@redhat.com> <5df78e1d0910021510g3f32485bva30e08cf00c8682a@mail.gmail.com> <4AC67EAC.2090008@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=000e0cd21218b7f7e10474fc0541 Cc: Andreas Dilger , Theodore Tso , Frank Mayhar , Curt Wohlgemuth , ext4 development To: Eric Sandeen Return-path: Received: from smtp-out.google.com ([216.239.33.17]:3712 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbZJBXVY (ORCPT ); Fri, 2 Oct 2009 19:21:24 -0400 Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id n92NLQJY024868 for ; Sat, 3 Oct 2009 00:21:26 +0100 Received: from pxi15 (pxi15.prod.google.com [10.243.27.15]) by zps35.corp.google.com with ESMTP id n92NLNHu025157 for ; Fri, 2 Oct 2009 16:21:23 -0700 Received: by pxi15 with SMTP id 15so1448338pxi.26 for ; Fri, 02 Oct 2009 16:21:23 -0700 (PDT) In-Reply-To: <4AC67EAC.2090008@redhat.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: --000e0cd21218b7f7e10474fc0541 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Oct 2, 2009 at 3:29 PM, Eric Sandeen wrote: > Jiaying Zhang wrote: >> >> FYI, here is my patch synced with the latest ext4-git tree: > > The patch came through pretty mangled, if you could post it in plain text w/ > no wrapping, or maybe as an attachment, it'd be great. Hmm. I guess my email client re-formated it somehow. Sorry about the problem. Patch attached in this email. Jiaying > > Thanks, > -Eric > --000e0cd21218b7f7e10474fc0541 Content-Type: text/x-patch; charset=US-ASCII; name="fallocate_keepsizse.patch" Content-Disposition: attachment; filename="fallocate_keepsizse.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g0bk0gg70 ZGlmZiAtLWdpdCBhL2ZzL2V4dDQvZXh0NC5oIGIvZnMvZXh0NC9leHQ0LmgKaW5kZXggOWE5OTY3 Mi4uMmEzZDA0MyAxMDA2NDQKLS0tIGEvZnMvZXh0NC9leHQ0LmgKKysrIGIvZnMvZXh0NC9leHQ0 LmgKQEAgLTI4NCwxMCArMjg0LDExIEBAIHN0cnVjdCBmbGV4X2dyb3VwcyB7CiAjZGVmaW5lIEVY VDRfVE9QRElSX0ZMCQkJMHgwMDAyMDAwMCAvKiBUb3Agb2YgZGlyZWN0b3J5IGhpZXJhcmNoaWVz Ki8KICNkZWZpbmUgRVhUNF9IVUdFX0ZJTEVfRkwgICAgICAgICAgICAgICAweDAwMDQwMDAwIC8q IFNldCB0byBlYWNoIGh1Z2UgZmlsZSAqLwogI2RlZmluZSBFWFQ0X0VYVEVOVFNfRkwJCQkweDAw MDgwMDAwIC8qIElub2RlIHVzZXMgZXh0ZW50cyAqLworI2RlZmluZSBFWFQ0X0VPRkJMT0NLU19G TAkJMHgwMDQwMDAwMCAvKiBCbG9ja3MgYWxsb2NhdGVkIGJleW9uZCBFT0YgKGJpdCByZXNlcnZl ZCBpbiBmcy5oKSAqLwogI2RlZmluZSBFWFQ0X1JFU0VSVkVEX0ZMCQkweDgwMDAwMDAwIC8qIHJl c2VydmVkIGZvciBleHQ0IGxpYiAqLwogCi0jZGVmaW5lIEVYVDRfRkxfVVNFUl9WSVNJQkxFCQkw eDAwMEJERkZGIC8qIFVzZXIgdmlzaWJsZS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