mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
bcachefs: Simplify code in bch2_dev_alloc()
- Remove unnecessary variable 'ret'. - Remove unnecessary bch2_dev_free() operations. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
924e81c530
commit
385d1a3c81
|
|
@ -1369,7 +1369,6 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx)
|
|||
{
|
||||
struct bch_member member = bch2_sb_member_get(c->disk_sb.sb, dev_idx);
|
||||
struct bch_dev *ca = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (bch2_fs_init_fault("dev_alloc"))
|
||||
goto err;
|
||||
|
|
@ -1381,10 +1380,8 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx)
|
|||
ca->fs = c;
|
||||
|
||||
bch2_dev_attach(c, ca, dev_idx);
|
||||
return ret;
|
||||
return 0;
|
||||
err:
|
||||
if (ca)
|
||||
bch2_dev_free(ca);
|
||||
return -BCH_ERR_ENOMEM_dev_alloc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user