mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 05:32:13 -04:00
bcachefs: subvol_inum_eq()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -736,9 +736,6 @@ struct btree_trans_buf {
|
||||
struct btree_trans *trans;
|
||||
};
|
||||
|
||||
#define BCACHEFS_ROOT_SUBVOL_INUM \
|
||||
((subvol_inum) { BCACHEFS_ROOT_SUBVOL, BCACHEFS_ROOT_INO })
|
||||
|
||||
#define BCH_WRITE_REFS() \
|
||||
x(journal) \
|
||||
x(trans) \
|
||||
|
||||
@@ -191,11 +191,6 @@ int bch2_fs_quota_transfer(struct bch_fs *c,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool subvol_inum_eq(subvol_inum a, subvol_inum b)
|
||||
{
|
||||
return a.subvol == b.subvol && a.inum == b.inum;
|
||||
}
|
||||
|
||||
static u32 bch2_vfs_inode_hash_fn(const void *data, u32 len, u32 seed)
|
||||
{
|
||||
const subvol_inum *inum = data;
|
||||
|
||||
@@ -309,6 +309,14 @@ bch2_inode_rebalance_opts_get(struct bch_fs *c, struct bch_inode_unpacked *inode
|
||||
return io_opts_to_rebalance_opts(c, &io_opts);
|
||||
}
|
||||
|
||||
#define BCACHEFS_ROOT_SUBVOL_INUM \
|
||||
((subvol_inum) { BCACHEFS_ROOT_SUBVOL, BCACHEFS_ROOT_INO })
|
||||
|
||||
static inline bool subvol_inum_eq(subvol_inum a, subvol_inum b)
|
||||
{
|
||||
return a.subvol == b.subvol && a.inum == b.inum;
|
||||
}
|
||||
|
||||
int bch2_inode_rm_snapshot(struct btree_trans *, u64, u32);
|
||||
int bch2_delete_dead_inodes(struct bch_fs *);
|
||||
|
||||
|
||||
@@ -404,8 +404,7 @@ int bch2_rename_trans(struct btree_trans *trans,
|
||||
|
||||
src_hash = bch2_hash_info_init(c, src_dir_u);
|
||||
|
||||
if (dst_dir.inum != src_dir.inum ||
|
||||
dst_dir.subvol != src_dir.subvol) {
|
||||
if (!subvol_inum_eq(dst_dir, src_dir)) {
|
||||
ret = bch2_inode_peek(trans, &dst_dir_iter, dst_dir_u, dst_dir,
|
||||
BTREE_ITER_intent);
|
||||
if (ret)
|
||||
@@ -599,8 +598,7 @@ int bch2_inum_to_path(struct btree_trans *trans, subvol_inum inum, struct printb
|
||||
unsigned orig_pos = path->pos;
|
||||
int ret = 0;
|
||||
|
||||
while (!(inum.subvol == BCACHEFS_ROOT_SUBVOL &&
|
||||
inum.inum == BCACHEFS_ROOT_INO)) {
|
||||
while (!subvol_inum_eq(inum, BCACHEFS_ROOT_SUBVOL_INUM)) {
|
||||
struct bch_inode_unpacked inode;
|
||||
ret = bch2_inode_find_by_inum_trans(trans, inum, &inode);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user