From c9b1d94a2196fcfd1985ff8728b22abda400b1ac Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 18 Apr 2025 14:56:09 -0400 Subject: bcachefs: bch_fs.writes -> enumerated_refs Drop the single-purpose write ref code in bcachefs.h, and convert to enumarated refs. Signed-off-by: Kent Overstreet --- fs/bcachefs/io_write.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/io_write.c') diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index 38086c1a8e28..e95a535ad44a 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -15,6 +15,7 @@ #include "compress.h" #include "debug.h" #include "ec.h" +#include "enumerated_ref.h" #include "error.h" #include "extent_update.h" #include "inode.h" @@ -531,7 +532,7 @@ static void bch2_write_done(struct closure *cl) bch2_disk_reservation_put(c, &op->res); if (!(op->flags & BCH_WRITE_move)) - bch2_write_ref_put(c, BCH_WRITE_REF_write); + enumerated_ref_put(&c->writes, BCH_WRITE_REF_write); bch2_keylist_free(&op->insert_keys, op->inline_keys); EBUG_ON(cl->parent); @@ -1679,7 +1680,7 @@ CLOSURE_CALLBACK(bch2_write) } if (!(op->flags & BCH_WRITE_move) && - !bch2_write_ref_tryget(c, BCH_WRITE_REF_write)) { + !enumerated_ref_tryget(&c->writes, BCH_WRITE_REF_write)) { op->error = -BCH_ERR_erofs_no_writes; goto err; } -- cgit v1.2.3