Skip to content

Commit 95fafc0

Browse files
author
Kent Overstreet
committed
bcachefs: Kill un-reverted directory i_size code
Signed-off-by: Kent Overstreet <[email protected]>
1 parent d47db3e commit 95fafc0

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

fs/bcachefs/dirent.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ int bch2_dirent_read_target(struct btree_trans *trans, subvol_inum dir,
402402
}
403403

404404
int bch2_dirent_rename(struct btree_trans *trans,
405-
subvol_inum src_dir, struct bch_hash_info *src_hash, u64 *src_dir_i_size,
406-
subvol_inum dst_dir, struct bch_hash_info *dst_hash, u64 *dst_dir_i_size,
405+
subvol_inum src_dir, struct bch_hash_info *src_hash,
406+
subvol_inum dst_dir, struct bch_hash_info *dst_hash,
407407
const struct qstr *src_name, subvol_inum *src_inum, u64 *src_offset,
408408
const struct qstr *dst_name, subvol_inum *dst_inum, u64 *dst_offset,
409409
enum bch_rename_mode mode)
@@ -542,14 +542,6 @@ int bch2_dirent_rename(struct btree_trans *trans,
542542
new_src->v.d_type == DT_SUBVOL)
543543
new_src->v.d_parent_subvol = cpu_to_le32(src_dir.subvol);
544544

545-
if (old_dst.k)
546-
*dst_dir_i_size -= bkey_bytes(old_dst.k);
547-
*src_dir_i_size -= bkey_bytes(old_src.k);
548-
549-
if (mode == BCH_RENAME_EXCHANGE)
550-
*src_dir_i_size += bkey_bytes(&new_src->k);
551-
*dst_dir_i_size += bkey_bytes(&new_dst->k);
552-
553545
ret = bch2_trans_update(trans, &dst_iter, &new_dst->k_i, 0);
554546
if (ret)
555547
goto out;

fs/bcachefs/dirent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ enum bch_rename_mode {
8080
};
8181

8282
int bch2_dirent_rename(struct btree_trans *,
83-
subvol_inum, struct bch_hash_info *, u64 *,
84-
subvol_inum, struct bch_hash_info *, u64 *,
83+
subvol_inum, struct bch_hash_info *,
84+
subvol_inum, struct bch_hash_info *,
8585
const struct qstr *, subvol_inum *, u64 *,
8686
const struct qstr *, subvol_inum *, u64 *,
8787
enum bch_rename_mode);

fs/bcachefs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ int bch2_rename_trans(struct btree_trans *trans,
425425
}
426426

427427
ret = bch2_dirent_rename(trans,
428-
src_dir, &src_hash, &src_dir_u->bi_size,
429-
dst_dir, &dst_hash, &dst_dir_u->bi_size,
428+
src_dir, &src_hash,
429+
dst_dir, &dst_hash,
430430
src_name, &src_inum, &src_offset,
431431
dst_name, &dst_inum, &dst_offset,
432432
mode);

0 commit comments

Comments
 (0)