]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Kill un-reverted directory i_size code
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 31 May 2025 22:32:37 +0000 (18:32 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 2 Jun 2025 16:16:35 +0000 (12:16 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/dirent.c
fs/bcachefs/dirent.h
fs/bcachefs/namei.c

index 37d7cf69ae1ddb22253742cbcee3fcf5ae84625f..066134145721546031e96c54eae268f2b8c14229 100644 (file)
@@ -402,8 +402,8 @@ int bch2_dirent_read_target(struct btree_trans *trans, subvol_inum dir,
 }
 
 int bch2_dirent_rename(struct btree_trans *trans,
-               subvol_inum src_dir, struct bch_hash_info *src_hash, u64 *src_dir_i_size,
-               subvol_inum dst_dir, struct bch_hash_info *dst_hash, u64 *dst_dir_i_size,
+               subvol_inum src_dir, struct bch_hash_info *src_hash,
+               subvol_inum dst_dir, struct bch_hash_info *dst_hash,
                const struct qstr *src_name, subvol_inum *src_inum, u64 *src_offset,
                const struct qstr *dst_name, subvol_inum *dst_inum, u64 *dst_offset,
                enum bch_rename_mode mode)
@@ -542,14 +542,6 @@ int bch2_dirent_rename(struct btree_trans *trans,
            new_src->v.d_type == DT_SUBVOL)
                new_src->v.d_parent_subvol = cpu_to_le32(src_dir.subvol);
 
-       if (old_dst.k)
-               *dst_dir_i_size -= bkey_bytes(old_dst.k);
-       *src_dir_i_size -= bkey_bytes(old_src.k);
-
-       if (mode == BCH_RENAME_EXCHANGE)
-               *src_dir_i_size += bkey_bytes(&new_src->k);
-       *dst_dir_i_size += bkey_bytes(&new_dst->k);
-
        ret = bch2_trans_update(trans, &dst_iter, &new_dst->k_i, 0);
        if (ret)
                goto out;
index 1f600dedafe1d3bfa06b97ad16605d6e1beb7a8e..f94d589cab6fb1ab4cec5560a35875ba73897892 100644 (file)
@@ -80,8 +80,8 @@ enum bch_rename_mode {
 };
 
 int bch2_dirent_rename(struct btree_trans *,
-                      subvol_inum, struct bch_hash_info *, u64 *,
-                      subvol_inum, struct bch_hash_info *, u64 *,
+                      subvol_inum, struct bch_hash_info *,
+                      subvol_inum, struct bch_hash_info *,
                       const struct qstr *, subvol_inum *, u64 *,
                       const struct qstr *, subvol_inum *, u64 *,
                       enum bch_rename_mode);
index 7ba3dee7eb2de024c7d6f5a79cf8320e4f40d1da..ee6fe35cec8075ec6e33d19da6fa9f00e7ff9d4a 100644 (file)
@@ -425,8 +425,8 @@ int bch2_rename_trans(struct btree_trans *trans,
        }
 
        ret = bch2_dirent_rename(trans,
-                                src_dir, &src_hash, &src_dir_u->bi_size,
-                                dst_dir, &dst_hash, &dst_dir_u->bi_size,
+                                src_dir, &src_hash,
+                                dst_dir, &dst_hash,
                                 src_name, &src_inum, &src_offset,
                                 dst_name, &dst_inum, &dst_offset,
                                 mode);