diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-10-23 15:02:12 +0200 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-10-24 12:36:40 +0200 |
commit | 01763a2e37425ae3f37a3dc051e0703fdade5956 (patch) | |
tree | 826924bbff1155c9edeec4f478cb43eb9d8930ea /fs | |
parent | d638108484d186bf97a838d037f165d9b404e6ee (diff) | |
download | lwn-01763a2e37425ae3f37a3dc051e0703fdade5956.tar.gz lwn-01763a2e37425ae3f37a3dc051e0703fdade5956.zip |
Btrfs: comment for loop in tree_mod_log_insert_move
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>
Diffstat (limited to 'fs')
-rw-r--r-- | 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 f6739903d072..eba44b076829 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); |