diff options
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/alloc_background.c | 4 | ||||
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/btree_update_leaf.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/ec.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/fs-io.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/io.c | 4 | ||||
-rw-r--r-- | fs/bcachefs/reflink.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/subvolume.c | 4 | ||||
-rw-r--r-- | fs/bcachefs/sysfs.c | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 012607cefb6f..3084081966b6 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1072,7 +1072,7 @@ static void bch2_do_discards_work(struct work_struct *work) void bch2_do_discards(struct bch_fs *c) { - if (percpu_ref_tryget(&c->writes) && + if (percpu_ref_tryget_live(&c->writes) && !queue_work(system_long_wq, &c->discard_work)) percpu_ref_put(&c->writes); } @@ -1192,7 +1192,7 @@ static void bch2_do_invalidates_work(struct work_struct *work) void bch2_do_invalidates(struct bch_fs *c) { - if (percpu_ref_tryget(&c->writes)) + if (percpu_ref_tryget_live(&c->writes)) queue_work(system_long_wq, &c->invalidate_work); } diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index a4f66e7cbb45..eeaea292bd80 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -1897,7 +1897,7 @@ void bch2_btree_node_rewrite_async(struct bch_fs *c, struct btree *b) { struct async_btree_rewrite *a; - if (!percpu_ref_tryget(&c->writes)) + if (!percpu_ref_tryget_live(&c->writes)) return; a = kmalloc(sizeof(*a), GFP_NOFS); diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index 3425e3c007dd..c6fe24f424de 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -1108,7 +1108,7 @@ int __bch2_trans_commit(struct btree_trans *trans) } if (!(trans->flags & BTREE_INSERT_NOCHECK_RW) && - unlikely(!percpu_ref_tryget(&c->writes))) { + unlikely(!percpu_ref_tryget_live(&c->writes))) { ret = bch2_trans_commit_get_rw_cold(trans); if (ret) goto out_reset; diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index faabaa64dcdb..6ce352c526f0 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -939,7 +939,7 @@ static void ec_stripe_create(struct ec_stripe_new *s) BUG_ON(!s->allocated); - if (!percpu_ref_tryget(&c->writes)) + if (!percpu_ref_tryget_live(&c->writes)) goto err; ec_generate_ec(&s->new_stripe); diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index ad51483ad764..c0dda29dabb4 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -3105,7 +3105,7 @@ long bch2_fallocate_dispatch(struct file *file, int mode, struct bch_fs *c = inode->v.i_sb->s_fs_info; long ret; - if (!percpu_ref_tryget(&c->writes)) + if (!percpu_ref_tryget_live(&c->writes)) return -EROFS; inode_lock(&inode->v); diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 91789185c78e..ca72a31da502 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -1397,7 +1397,7 @@ void bch2_write(struct closure *cl) } if (c->opts.nochanges || - !percpu_ref_tryget(&c->writes)) { + !percpu_ref_tryget_live(&c->writes)) { op->error = -EROFS; goto err; } @@ -1527,7 +1527,7 @@ static struct promote_op *__promote_alloc(struct bch_fs *c, unsigned pages = DIV_ROUND_UP(sectors, PAGE_SECTORS); int ret; - if (!percpu_ref_tryget(&c->writes)) + if (!percpu_ref_tryget_live(&c->writes)) return NULL; op = kzalloc(sizeof(*op) + sizeof(struct bio_vec) * pages, GFP_NOIO); diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index 4e589c02a93b..2038e3502d8c 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -282,7 +282,7 @@ s64 bch2_remap_range(struct bch_fs *c, u32 dst_snapshot, src_snapshot; int ret = 0, ret2 = 0; - if (!percpu_ref_tryget(&c->writes)) + if (!percpu_ref_tryget_live(&c->writes)) return -EROFS; bch2_check_set_feature(c, BCH_FEATURE_reflink); diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index 8f41a06c3e11..60b60de83f3e 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -729,7 +729,7 @@ err: static void bch2_delete_dead_snapshots(struct bch_fs *c) { - if (unlikely(!percpu_ref_tryget(&c->writes))) + if (unlikely(!percpu_ref_tryget_live(&c->writes))) return; if (!queue_work(system_long_wq, &c->snapshot_delete_work)) @@ -931,7 +931,7 @@ int bch2_subvolume_wait_for_pagecache_and_delete_hook(struct btree_trans *trans, if (ret) return ret; - if (unlikely(!percpu_ref_tryget(&c->writes))) + if (unlikely(!percpu_ref_tryget_live(&c->writes))) return -EROFS; if (!queue_work(system_long_wq, &c->snapshot_wait_for_pagecache_and_delete_work)) diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 173289c34de0..4e2b6285cf3a 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -676,7 +676,7 @@ STORE(bch2_fs_opts_dir) * We don't need to take c->writes for correctness, but it eliminates an * unsightly error message in the dmesg log when we're RO: */ - if (unlikely(!percpu_ref_tryget(&c->writes))) + if (unlikely(!percpu_ref_tryget_live(&c->writes))) return -EROFS; tmp = kstrdup(buf, GFP_KERNEL); |