From patchwork Mon Jan 4 21:13:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jim owens X-Patchwork-Id: 70741 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o04LDM6L024937 for ; Mon, 4 Jan 2010 21:13:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754120Ab0ADVNK (ORCPT ); Mon, 4 Jan 2010 16:13:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754108Ab0ADVNJ (ORCPT ); Mon, 4 Jan 2010 16:13:09 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:5908 "EHLO g1t0026.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754109Ab0ADVNH (ORCPT ); Mon, 4 Jan 2010 16:13:07 -0500 Received: from g1t0039.austin.hp.com (g1t0039.austin.hp.com [16.236.32.45]) by g1t0026.austin.hp.com (Postfix) with ESMTP id 5E5FAC101 for ; Mon, 4 Jan 2010 21:13:07 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g1t0039.austin.hp.com (Postfix) with ESMTP id 5209034018 for ; Mon, 4 Jan 2010 21:13:07 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 2E444CF0011; Mon, 4 Jan 2010 14:13:07 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tt+7J63nln+1; Mon, 4 Jan 2010 14:13:07 -0700 (MST) Received: from [192.168.0.99] (squirrel.fc.hp.com [15.11.146.57]) (Authenticated sender: owens@fc.hp.com) by ldl (Postfix) with ESMTPA id B090BCF000E; Mon, 4 Jan 2010 14:13:06 -0700 (MST) Message-ID: <4B4259E1.6080703@hp.com> Date: Mon, 04 Jan 2010 16:13:05 -0500 From: jim owens User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: linux-btrfs Subject: [RFC 04/12 RESEND PATCH] Btrfs: btrfs_discard_extent must use WRITE with btrfs_map_block. Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index b610557..185d273 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1594,7 +1594,7 @@ static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, return 0; /* Tell the block device(s) that the sectors can be discarded */ - ret = btrfs_map_block(&root->fs_info->mapping_tree, READ, + ret = btrfs_map_block(&root->fs_info->mapping_tree, WRITE, bytenr, &map_length, &multi, 0); if (!ret) { struct btrfs_bio_stripe *stripe = multi->stripes;