Btrfs: comment for loop in tree_mod_log_insert_move
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Tue, 23 Oct 2012 13:02:12 +0000 (15:02 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Wed, 24 Oct 2012 10:36:40 +0000 (12:36 +0200)
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 <list.btrfs@jan-o-sch.net>
fs/btrfs/ctree.c

index f6739903d072273246c499b6935b91867272374d..eba44b0768295975864b679282f69d4bcf2fd5d6 100644 (file)
@@ -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);