Lines Matching defs:subvol

32 	struct bkey_s_c_subvolume subvol;
42 subvol = bkey_s_c_to_subvolume(k);
43 snapid = le32_to_cpu(subvol.v->snapshot);
52 if (BCH_SUBVOLUME_UNLINKED(subvol.v)) {
58 if (fsck_err_on(subvol.k->p.offset == BCACHEFS_ROOT_SUBVOL &&
59 subvol.v->fs_path_parent,
64 bch2_bkey_make_mut_typed(trans, iter, &subvol.s_c, 0, subvolume);
72 if (subvol.v->fs_path_parent) {
97 (subvol_inum) { k.k->p.offset, le64_to_cpu(subvol.v->inode) },
106 k.k->p.offset, le64_to_cpu(subvol.v->inode),
107 le32_to_cpu(subvol.v->snapshot))) {
113 if (fsck_err_on(inode.bi_subvol != subvol.k->p.offset,
115 "subvol root %llu:%u has wrong bi_subvol field: got %u, should be %llu",
117 inode.bi_subvol, subvol.k->p.offset)) {
118 inode.bi_subvol = subvol.k->p.offset;
119 ret = __bch2_fsck_write_inode(trans, &inode, le32_to_cpu(subvol.v->snapshot));
124 if (!BCH_SUBVOLUME_SNAP(subvol.v)) {
125 u32 snapshot_root = bch2_snapshot_root(c, le32_to_cpu(subvol.v->snapshot));
141 if (fsck_err_on(le32_to_cpu(st.master_subvol) != subvol.k->p.offset,
146 bch2_bkey_make_mut_typed(trans, iter, &subvol.s_c, 0, subvolume);
265 int bch2_subvol_has_children(struct btree_trans *trans, u32 subvol)
269 bch2_trans_iter_init(trans, &iter, BTREE_ID_subvolume_children, POS(subvol, 0), 0);
273 return bkey_err(k) ?: k.k && k.k->p.inode == subvol
279 bch2_subvolume_get_inlined(struct btree_trans *trans, unsigned subvol,
284 int ret = bch2_bkey_get_val_typed(trans, BTREE_ID_subvolumes, POS(0, subvol),
288 trans->c, "missing subvolume %u", subvol);
292 int bch2_subvolume_get(struct btree_trans *trans, unsigned subvol,
297 return bch2_subvolume_get_inlined(trans, subvol, inconsistent_if_not_found, iter_flags, s);
300 int bch2_subvol_is_ro_trans(struct btree_trans *trans, u32 subvol)
303 int ret = bch2_subvolume_get_inlined(trans, subvol, true, 0, &s);
312 int bch2_subvol_is_ro(struct bch_fs *c, u32 subvol)
315 bch2_subvol_is_ro_trans(trans, subvol));
319 struct bch_subvolume *subvol)
324 bch2_subvolume_get(trans, le32_to_cpu(snap.subvol), true, 0, subvol);
331 struct bkey_s_c_subvolume subvol;
334 subvol = bch2_bkey_get_iter_typed(trans, &iter,
338 ret = bkey_err(subvol);
343 *snapid = le32_to_cpu(subvol.v->snapshot);
401 struct bkey_s_c_subvolume subvol;
405 subvol = bch2_bkey_get_iter_typed(trans, &iter,
409 ret = bkey_err(subvol);
415 snapid = le32_to_cpu(subvol.v->snapshot);
464 u32 subvol;
475 if (!snapshot_list_has_id(&c->snapshots_unlinked, h->subvol))
476 ret = snapshot_list_add(c, &c->snapshots_unlinked, h->subvol);
503 h->subvol = subvolid;
614 root_snapshot.v.subvol = cpu_to_le32(BCACHEFS_ROOT_SUBVOL);