From patchwork Tue Oct 23 13:55:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Schmidt X-Patchwork-Id: 1630881 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 94AFE3FD4E for ; Tue, 23 Oct 2012 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933049Ab2JWNzj (ORCPT ); Tue, 23 Oct 2012 09:55:39 -0400 Received: from xp-ob.rzone.de ([81.169.146.137]:61607 "EHLO xp-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757041Ab2JWNz3 (ORCPT ); Tue, 23 Oct 2012 09:55:29 -0400 X-RZG-CLASS-ID: xp Received: from pizpot.store ([192.168.43.236]) by josoe.store (josoe xp4) (RZmta 30.20 OK) with ESMTP id 603f58o9NDZBmi ; Tue, 23 Oct 2012 15:55:27 +0200 (CEST) From: Jan Schmidt To: chris.mason@fusionio.com Cc: linux-btrfs@vger.kernel.org, bo.li.liu@oracle.com Subject: [PATCH 6/6] Btrfs: comment for loop in tree_mod_log_insert_move Date: Tue, 23 Oct 2012 15:55:27 +0200 Message-Id: <1351000527-24952-7-git-send-email-list.btrfs@jan-o-sch.net> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1351000527-24952-1-git-send-email-list.btrfs@jan-o-sch.net> References: <1351000527-24952-1-git-send-email-list.btrfs@jan-o-sch.net> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Emphasis the way tree_mod_log_insert_move avoids adding MOD_LOG_KEY_REMOVE_WHILE_MOVING operations, depending on the direction of the move operation. Signed-off-by: Jan Schmidt Reviewed-by: Liu Bo --- fs/btrfs/ctree.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index bed06e8..c608b3c 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -596,6 +596,11 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, if (tree_mod_dont_log(fs_info, eb)) return 0; + /* + * When we override something during the move, we log these removals. + * This can only happen when we move towards the beginning of the + * buffer, i.e. dst_slot < src_slot. + */ for (i = 0; i + dst_slot < src_slot && i < nr_items; i++) { ret = tree_mod_log_insert_key_locked(fs_info, eb, i + dst_slot, MOD_LOG_KEY_REMOVE_WHILE_MOVING);