From patchwork Wed Aug 10 23:20:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 1055192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7ANOh6g004784 for ; Wed, 10 Aug 2011 23:24:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755431Ab1HJXYf (ORCPT ); Wed, 10 Aug 2011 19:24:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42460 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755425Ab1HJXYb (ORCPT ); Wed, 10 Aug 2011 19:24:31 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D4C868C5DF for ; Thu, 11 Aug 2011 01:24:30 +0200 (CEST) Message-Id: <20110810232123.300532775@suse.com> User-Agent: quilt/0.48-18.3 Date: Wed, 10 Aug 2011 19:20:34 -0400 From: Jeff Mahoney To: linux-btrfs@vger.kernel.org Subject: [patch 7/9] btrfs: Make pin_down_extent return void References: <20110810232027.129702612@suse.com> Content-Disposition: inline; filename=btrfs-make-pin_down_extent-return-void 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 10 Aug 2011 23:24:43 +0000 (UTC) pin_down_extent performs some operations which can't fail and then calls set_extent_dirty, which has two failure cases via set_extent_bit: 1) Return -EEXIST if exclusive bits are set - Since it doesn't use any exclusive bits, this failure case can't occur. 2) Return -ENOMEM if memory can't be allocated - Since it's called with gfp_flags & __GFP_NOFAIL, this failure case can't occur. With no failure cases, it can return void. Signed-off-by: Jeff Mahoney --- fs/btrfs/extent-tree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4175,9 +4175,9 @@ static u64 first_logical_byte(struct btr return bytenr; } -static int pin_down_extent(struct btrfs_root *root, - struct btrfs_block_group_cache *cache, - u64 bytenr, u64 num_bytes, int reserved) +static void pin_down_extent(struct btrfs_root *root, + struct btrfs_block_group_cache *cache, + u64 bytenr, u64 num_bytes, int reserved) { spin_lock(&cache->space_info->lock); spin_lock(&cache->lock); @@ -4194,7 +4194,6 @@ static int pin_down_extent(struct btrfs_ /* __GFP_NOFAIL means it can't return -ENOMEM */ set_extent_dirty(root->fs_info->pinned_extents, bytenr, bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL); - return 0; } /*