From patchwork Wed Jan 23 07:25:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Sheng-Hui X-Patchwork-Id: 2022551 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9504CDF280 for ; Wed, 23 Jan 2013 07:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157Ab3AWHZv (ORCPT ); Wed, 23 Jan 2013 02:25:51 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:62251 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752985Ab3AWHZu (ORCPT ); Wed, 23 Jan 2013 02:25:50 -0500 Received: by mail-ie0-f174.google.com with SMTP id k11so7215320iea.5 for ; Tue, 22 Jan 2013 23:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=cecHJ2RgcK+kyS0v4+WniueHcvxB89Ozj5iO2zidEKs=; b=yFuug+QGR8952bk+HzyUr0Rmm2/thEPpaG28Pg2GXumfFCnGnMufmhIvCcT/Th9ZxG nCL27Lfff3Lc6B40Mqf2icN5CugvjujZkGfYUKPWUchrZSlICcVO+/yxlQH8S05XmnVi gcq9E0QEpPwtxRsvhYF12hsPfKvTdika9TZwhbOR5KJZ9QZ80/+e3YfNWZJtGiyC44mc i7G0dTPfVyzMZJYgQQRhgsdWxx4DZOU0+PzKZBci8glyRnKqvTSJuf/6zOiPMY/VjUND 8qF43RdR08bbbHuv24oCH/jeh45MbLRVgUKVp79pg1Si2z/mgIfeIKtkteU5ofVJgick I33Q== X-Received: by 10.50.207.67 with SMTP id lu3mr14264965igc.12.1358925950198; Tue, 22 Jan 2013 23:25:50 -0800 (PST) Received: from [9.115.125.174] ([202.108.130.138]) by mx.google.com with ESMTPS id c3sm14776597igj.1.2013.01.22.23.25.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 23:25:49 -0800 (PST) Message-ID: <50FF905D.80805@gmail.com> Date: Wed, 23 Jan 2013 15:25:17 +0800 From: Wang Sheng-Hui User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Josef Bacik , chris.mason@fusionio.com, linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: cleanup for btrfs_extend_item Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Two cleanups: * The data_size is the new added size, not the new size after extend. Make the description more clear. * The var data_end is not used anymore after the data shift. Remove the useless assignment. Signed-off-by: Wang Sheng-Hui --- fs/btrfs/ctree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index eea5da7..c4f295e 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -4376,7 +4376,8 @@ void btrfs_truncate_item(struct btrfs_trans_handle *trans, } /* - * make the item pointed to by the path bigger, data_size is the new size. + * make the item pointed to by the path bigger. + * data_size is the to be extended size. */ void btrfs_extend_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, @@ -4432,7 +4433,6 @@ void btrfs_extend_item(struct btrfs_trans_handle *trans, data_end - data_size, btrfs_leaf_data(leaf) + data_end, old_data - data_end); - data_end = old_data; old_size = btrfs_item_size_nr(leaf, slot); item = btrfs_item_nr(leaf, slot); btrfs_set_item_size(leaf, item, old_size + data_size);