summaryrefslogtreecommitdiff
path: root/fs/bcachefs/chardev.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-03 17:48:23 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:29:22 -0400
commit4cd91e2f87a6b1f28806fc0082a9b31ce23d28b8 (patch)
tree170aa4e9e2e77714fd4e8d9da990407c7581aaee /fs/bcachefs/chardev.c
parentb07eb8252fb1455cc54bb306e253e193a7a39228 (diff)
bcachefs: Convert to bch2_dev_tryget_noerror()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/chardev.c')
-rw-r--r--fs/bcachefs/chardev.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/bcachefs/chardev.c b/fs/bcachefs/chardev.c
index ed1fe771a426..9e54323f0f5f 100644
--- a/fs/bcachefs/chardev.c
+++ b/fs/bcachefs/chardev.c
@@ -32,12 +32,7 @@ static struct bch_dev *bch2_device_lookup(struct bch_fs *c, u64 dev,
if (dev >= c->sb.nr_devices)
return ERR_PTR(-EINVAL);
- rcu_read_lock();
- ca = rcu_dereference(c->devs[dev]);
- if (ca)
- bch2_dev_get(ca);
- rcu_read_unlock();
-
+ ca = bch2_dev_tryget_noerror(c, dev);
if (!ca)
return ERR_PTR(-EINVAL);
} else {