Commit 3e8b4b3a authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Inline bch2_inode_pack()

It's mainly used from bch2_inode_write(), so inline it there.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent adf16c6d
...@@ -60,9 +60,9 @@ static int inode_decode_field(const u8 *in, const u8 *end, ...@@ -60,9 +60,9 @@ static int inode_decode_field(const u8 *in, const u8 *end,
return bytes; return bytes;
} }
void bch2_inode_pack(struct bch_fs *c, static inline void bch2_inode_pack_inlined(struct bch_fs *c,
struct bkey_inode_buf *packed, struct bkey_inode_buf *packed,
const struct bch_inode_unpacked *inode) const struct bch_inode_unpacked *inode)
{ {
struct bkey_i_inode_v2 *k = &packed->inode; struct bkey_i_inode_v2 *k = &packed->inode;
u8 *out = k->v.fields; u8 *out = k->v.fields;
...@@ -130,6 +130,13 @@ void bch2_inode_pack(struct bch_fs *c, ...@@ -130,6 +130,13 @@ void bch2_inode_pack(struct bch_fs *c,
} }
} }
void bch2_inode_pack(struct bch_fs *c,
struct bkey_inode_buf *packed,
const struct bch_inode_unpacked *inode)
{
bch2_inode_pack_inlined(c, packed, inode);
}
static noinline int bch2_inode_unpack_v1(struct bkey_s_c_inode inode, static noinline int bch2_inode_unpack_v1(struct bkey_s_c_inode inode,
struct bch_inode_unpacked *unpacked) struct bch_inode_unpacked *unpacked)
{ {
...@@ -288,7 +295,7 @@ int bch2_inode_write(struct btree_trans *trans, ...@@ -288,7 +295,7 @@ int bch2_inode_write(struct btree_trans *trans,
if (IS_ERR(inode_p)) if (IS_ERR(inode_p))
return PTR_ERR(inode_p); return PTR_ERR(inode_p);
bch2_inode_pack(trans->c, inode_p, inode); bch2_inode_pack_inlined(trans->c, inode_p, inode);
inode_p->inode.k.p.snapshot = iter->snapshot; inode_p->inode.k.p.snapshot = iter->snapshot;
return bch2_trans_update(trans, iter, &inode_p->inode.k_i, 0); return bch2_trans_update(trans, iter, &inode_p->inode.k_i, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment