btrfs: update comments at btrfs_record_unlink_dir() to be more clear
authorFilipe Manana <fdmanana@suse.com>
Wed, 17 May 2023 11:02:14 +0000 (12:02 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:26 +0000 (13:59 +0200)
Update the comments at btrfs_record_unlink_dir() so that they mention
where new names are logged and where old names are removed. Also, while
at it make the width of the comments closer to 80 columns and capitalize
the sentences and finish them with punctuation.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c

index 82da38109b16014169c36772f031df2b65cf98fe..95d01a122b3f638aaaa357e0df64f63951076c29 100644 (file)
@@ -7326,15 +7326,19 @@ void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,
        mutex_unlock(&inode->log_mutex);
 
        /*
-        * if this directory was already logged any new
-        * names for this file/dir will get recorded
+        * If this directory was already logged, any new names will be logged
+        * with btrfs_log_new_name() and old names will be deleted from the log
+        * tree with btrfs_del_dir_entries_in_log() or with
+        * btrfs_del_inode_ref_in_log().
         */
        if (inode_logged(trans, dir, NULL) == 1)
                return;
 
        /*
-        * if the inode we're about to unlink was logged,
-        * the log will be properly updated for any new names
+        * If the inode we're about to unlink was logged before, the log will be
+        * properly updated with the new name with btrfs_log_new_name() and the
+        * old name removed with btrfs_del_dir_entries_in_log() or with
+        * btrfs_del_inode_ref_in_log().
         */
        if (inode_logged(trans, inode, NULL) == 1)
                return;