diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-17 14:03:47 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:07 -0400 |
commit | 4e1ec2cc0d82f1d4344e7b5a53229c9ccde8437d (patch) | |
tree | c6ecae302aa4a7bc3450b1e7bc984453a50a7b63 /fs/bcachefs/fs-io.c | |
parent | af1c6871814eb3088bcd3c2afd2fc4b7d4e4df97 (diff) | |
download | lwn-4e1ec2cc0d82f1d4344e7b5a53229c9ccde8437d.tar.gz lwn-4e1ec2cc0d82f1d4344e7b5a53229c9ccde8437d.zip |
bcachefs: Simplify bch2_write_inode_trans, fix lockdep splat
ei_update_lock isn't currently needed for write inode (but it will be
needed again when deferred btree updates are used for inode updates)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io.c')
-rw-r--r-- | fs/bcachefs/fs-io.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index b53fbdc15c87..29d289b0dfa5 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -355,8 +355,6 @@ bchfs_extent_update_hook(struct extent_insert_hook *hook, h->inode_u.bi_size = offset; do_pack = true; - inode->ei_inode.bi_size = offset; - spin_lock(&inode->v.i_lock); if (offset > inode->v.i_size) { if (h->op->is_dio) @@ -478,6 +476,7 @@ static int bchfs_write_index_update(struct bch_write_op *wop) &hook.hook, op_journal_seq(wop), BTREE_INSERT_NOFAIL| BTREE_INSERT_ATOMIC| + BTREE_INSERT_NOUNLOCK| BTREE_INSERT_USE_RESERVE, BTREE_INSERT_ENTRY(extent_iter, k)); } @@ -493,6 +492,9 @@ err: if (ret) break; + if (hook.need_inode_update) + op->inode->ei_inode = hook.inode_u; + BUG_ON(bkey_cmp(extent_iter->pos, k->k.p) < 0); bch2_keylist_pop_front(keys); } while (!bch2_keylist_empty(keys)); |