Lines Matching refs:dif

172 			     struct erofs_device_info *dif, erofs_off_t *pos)  in erofs_init_device()  argument
185 if (!sbi->devs->flatdev && !dif->path) { in erofs_init_device()
190 dif->path = kmemdup_nul(dis->tag, sizeof(dis->tag), GFP_KERNEL); in erofs_init_device()
191 if (!dif->path) in erofs_init_device()
196 fscache = erofs_fscache_register_cookie(sb, dif->path, 0); in erofs_init_device()
199 dif->fscache = fscache; in erofs_init_device()
201 bdev = blkdev_get_by_path(dif->path, BLK_OPEN_READ, sb->s_type, in erofs_init_device()
205 dif->bdev = bdev; in erofs_init_device()
206 dif->dax_dev = fs_dax_get_by_bdev(bdev, &dif->dax_part_off, in erofs_init_device()
210 dif->blocks = le32_to_cpu(dis->blocks); in erofs_init_device()
211 dif->mapped_blkaddr = le32_to_cpu(dis->mapped_blkaddr); in erofs_init_device()
212 sbi->total_blocks += dif->blocks; in erofs_init_device()
224 struct erofs_device_info *dif; in erofs_scan_devices() local
249 idr_for_each_entry(&sbi->devs->tree, dif, id) { in erofs_scan_devices()
250 err = erofs_init_device(&buf, sb, dif, &pos); in erofs_scan_devices()
256 dif = kzalloc(sizeof(*dif), GFP_KERNEL); in erofs_scan_devices()
257 if (!dif) { in erofs_scan_devices()
262 err = idr_alloc(&sbi->devs->tree, dif, 0, 0, GFP_KERNEL); in erofs_scan_devices()
264 kfree(dif); in erofs_scan_devices()
269 err = erofs_init_device(&buf, sb, dif, &pos); in erofs_scan_devices()
453 struct erofs_device_info *dif; in erofs_fc_parse_param() local
497 dif = kzalloc(sizeof(*dif), GFP_KERNEL); in erofs_fc_parse_param()
498 if (!dif) in erofs_fc_parse_param()
500 dif->path = kstrdup(param->string, GFP_KERNEL); in erofs_fc_parse_param()
501 if (!dif->path) { in erofs_fc_parse_param()
502 kfree(dif); in erofs_fc_parse_param()
506 ret = idr_alloc(&ctx->devs->tree, dif, 0, 0, GFP_KERNEL); in erofs_fc_parse_param()
509 kfree(dif->path); in erofs_fc_parse_param()
510 kfree(dif); in erofs_fc_parse_param()
750 struct erofs_device_info *dif = ptr; in erofs_release_device_info() local
752 fs_put_dax(dif->dax_dev, NULL); in erofs_release_device_info()
753 if (dif->bdev) in erofs_release_device_info()
754 blkdev_put(dif->bdev, &erofs_fs_type); in erofs_release_device_info()
755 erofs_fscache_unregister_cookie(dif->fscache); in erofs_release_device_info()
756 dif->fscache = NULL; in erofs_release_device_info()
757 kfree(dif->path); in erofs_release_device_info()
758 kfree(dif); in erofs_release_device_info()