From patchwork Mon Jun 21 07:36:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jeff.liu" X-Patchwork-Id: 107140 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5L7bLZ0002340 for ; Mon, 21 Jun 2010 07:37:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751Ab0FUHhE (ORCPT ); Mon, 21 Jun 2010 03:37:04 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:20493 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696Ab0FUHhC (ORCPT ); Mon, 21 Jun 2010 03:37:02 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o5L7awCZ025168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Jun 2010 07:37:00 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o5L6REN5004335; Mon, 21 Jun 2010 07:36:57 GMT Received: from abhmt010.oracle.com by acsmt354.oracle.com with ESMTP id 342686251277105789; Mon, 21 Jun 2010 00:36:29 -0700 Received: from [10.182.121.3] (/10.182.121.3) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Jun 2010 00:36:29 -0700 Message-ID: <4C1F167D.3040908@oracle.com> Date: Mon, 21 Jun 2010 15:36:29 +0800 From: "jeff.liu" User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Chris Mason , Tao Ma CC: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] btrfs: Don't return extent in fiemap if we meet with a hole. References: <1277102222-3310-1-git-send-email-tao.ma@oracle.com> In-Reply-To: <1277102222-3310-1-git-send-email-tao.ma@oracle.com> X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090203.4C1F169D.0215:SCFMA922111,ss=1,fgs=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 07:37:37 +0000 (UTC) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index a4080c2..e68fd61 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3005,6 +3005,8 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, } if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) flags |= FIEMAP_EXTENT_ENCODED; + if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) + flags |= FIEMAP_EXTENT_UNWRITTEN; emflags = em->flags; free_extent_map(em);