Lines Matching refs:dif

160 			     struct erofs_device_info *dif, erofs_off_t *pos)  in erofs_init_device()  argument
171 if (!sbi->devs->flatdev && !dif->path) { in erofs_init_device()
176 dif->path = kmemdup_nul(dis->tag, sizeof(dis->tag), GFP_KERNEL); in erofs_init_device()
177 if (!dif->path) in erofs_init_device()
182 fscache = erofs_fscache_register_cookie(sb, dif->path, 0); in erofs_init_device()
185 dif->fscache = fscache; in erofs_init_device()
188 filp_open(dif->path, O_RDONLY | O_LARGEFILE, 0) : in erofs_init_device()
189 bdev_file_open_by_path(dif->path, in erofs_init_device()
195 dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file), in erofs_init_device()
196 &dif->dax_part_off, NULL, NULL); in erofs_init_device()
201 dif->file = file; in erofs_init_device()
204 dif->blocks = le32_to_cpu(dis->blocks); in erofs_init_device()
205 dif->mapped_blkaddr = le32_to_cpu(dis->mapped_blkaddr); in erofs_init_device()
206 sbi->total_blocks += dif->blocks; in erofs_init_device()
218 struct erofs_device_info *dif; in erofs_scan_devices() local
243 idr_for_each_entry(&sbi->devs->tree, dif, id) { in erofs_scan_devices()
244 err = erofs_init_device(&buf, sb, dif, &pos); in erofs_scan_devices()
250 dif = kzalloc(sizeof(*dif), GFP_KERNEL); in erofs_scan_devices()
251 if (!dif) { in erofs_scan_devices()
256 err = idr_alloc(&sbi->devs->tree, dif, 0, 0, GFP_KERNEL); in erofs_scan_devices()
258 kfree(dif); in erofs_scan_devices()
263 err = erofs_init_device(&buf, sb, dif, &pos); in erofs_scan_devices()
448 struct erofs_device_info *dif; in erofs_fc_parse_param() local
492 dif = kzalloc(sizeof(*dif), GFP_KERNEL); in erofs_fc_parse_param()
493 if (!dif) in erofs_fc_parse_param()
495 dif->path = kstrdup(param->string, GFP_KERNEL); in erofs_fc_parse_param()
496 if (!dif->path) { in erofs_fc_parse_param()
497 kfree(dif); in erofs_fc_parse_param()
501 ret = idr_alloc(&sbi->devs->tree, dif, 0, 0, GFP_KERNEL); in erofs_fc_parse_param()
504 kfree(dif->path); in erofs_fc_parse_param()
505 kfree(dif); in erofs_fc_parse_param()
756 struct erofs_device_info *dif = ptr; in erofs_release_device_info() local
758 fs_put_dax(dif->dax_dev, NULL); in erofs_release_device_info()
759 if (dif->file) in erofs_release_device_info()
760 fput(dif->file); in erofs_release_device_info()
761 erofs_fscache_unregister_cookie(dif->fscache); in erofs_release_device_info()
762 dif->fscache = NULL; in erofs_release_device_info()
763 kfree(dif->path); in erofs_release_device_info()
764 kfree(dif); in erofs_release_device_info()