Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

UBI: remove built-in gluebi

Remove built-in gluebi support. This is a preparation for a
standalone glubi module support

Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

authored by

Dmitry Pervushin and committed by
Artem Bityutskiy
518ceef0 0e0ee1cc

+2 -51
-1
drivers/mtd/ubi/cdev.c
··· 395 395 vol->corrupted = 1; 396 396 } 397 397 vol->checked = 1; 398 - ubi_gluebi_updated(vol); 399 398 ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED); 400 399 revoke_exclusive(desc, UBI_READWRITE); 401 400 }
-26
drivers/mtd/ubi/ubi.h
··· 231 231 * @changing_leb: %1 if the atomic LEB change ioctl command is in progress 232 232 * @direct_writes: %1 if direct writes are enabled for this volume 233 233 * 234 - * @gluebi_desc: gluebi UBI volume descriptor 235 - * @gluebi_refcount: reference count of the gluebi MTD device 236 - * @gluebi_mtd: MTD device description object of the gluebi MTD device 237 - * 238 234 * The @corrupted field indicates that the volume's contents is corrupted. 239 235 * Since UBI protects only static volumes, this field is not relevant to 240 236 * dynamic volumes - it is user's responsibility to assure their data ··· 274 278 unsigned int updating:1; 275 279 unsigned int changing_leb:1; 276 280 unsigned int direct_writes:1; 277 - 278 - #ifdef CONFIG_MTD_UBI_GLUEBI 279 - /* 280 - * Gluebi-related stuff may be compiled out. 281 - * Note: this should not be built into UBI but should be a separate 282 - * ubimtd driver which works on top of UBI and emulates MTD devices. 283 - */ 284 - struct ubi_volume_desc *gluebi_desc; 285 - int gluebi_refcount; 286 - struct mtd_info gluebi_mtd; 287 - #endif 288 281 }; 289 282 290 283 /** ··· 501 516 int length); 502 517 int ubi_check_volume(struct ubi_device *ubi, int vol_id); 503 518 void ubi_calculate_reserved(struct ubi_device *ubi); 504 - 505 - /* gluebi.c */ 506 - #ifdef CONFIG_MTD_UBI_GLUEBI 507 - int ubi_create_gluebi(struct ubi_device *ubi, struct ubi_volume *vol); 508 - int ubi_destroy_gluebi(struct ubi_volume *vol); 509 - void ubi_gluebi_updated(struct ubi_volume *vol); 510 - #else 511 - #define ubi_create_gluebi(ubi, vol) 0 512 - #define ubi_destroy_gluebi(vol) 0 513 - #define ubi_gluebi_updated(vol) 514 - #endif 515 519 516 520 /* eba.c */ 517 521 int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol,
+2 -24
drivers/mtd/ubi/vmt.c
··· 317 317 goto out_mapping; 318 318 } 319 319 320 - err = ubi_create_gluebi(ubi, vol); 321 - if (err) 322 - goto out_cdev; 323 - 324 320 vol->dev.release = vol_release; 325 321 vol->dev.parent = &ubi->dev; 326 322 vol->dev.devt = dev; ··· 326 330 err = device_register(&vol->dev); 327 331 if (err) { 328 332 ubi_err("cannot register device"); 329 - goto out_gluebi; 333 + goto out_cdev; 330 334 } 331 335 332 336 err = volume_sysfs_init(ubi, vol); ··· 371 375 do_free = 0; 372 376 get_device(&vol->dev); 373 377 volume_sysfs_close(vol); 374 - out_gluebi: 375 - if (ubi_destroy_gluebi(vol)) 376 - dbg_err("cannot destroy gluebi for volume %d:%d", 377 - ubi->ubi_num, vol_id); 378 378 out_cdev: 379 379 cdev_del(&vol->cdev); 380 380 out_mapping: ··· 424 432 } 425 433 ubi->volumes[vol_id] = NULL; 426 434 spin_unlock(&ubi->volumes_lock); 427 - 428 - err = ubi_destroy_gluebi(vol); 429 - if (err) 430 - goto out_err; 431 435 432 436 if (!no_vtbl) { 433 437 err = ubi_change_vtbl_record(ubi, vol_id, NULL); ··· 662 674 return err; 663 675 } 664 676 665 - err = ubi_create_gluebi(ubi, vol); 666 - if (err) 667 - goto out_cdev; 668 - 669 677 vol->dev.release = vol_release; 670 678 vol->dev.parent = &ubi->dev; 671 679 vol->dev.devt = dev; ··· 669 685 dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); 670 686 err = device_register(&vol->dev); 671 687 if (err) 672 - goto out_gluebi; 688 + goto out_cdev; 673 689 674 690 err = volume_sysfs_init(ubi, vol); 675 691 if (err) { 676 692 cdev_del(&vol->cdev); 677 - err = ubi_destroy_gluebi(vol); 678 693 volume_sysfs_close(vol); 679 694 return err; 680 695 } ··· 682 699 dbg_err("check failed while adding volume %d", vol_id); 683 700 return err; 684 701 685 - out_gluebi: 686 - err = ubi_destroy_gluebi(vol); 687 702 out_cdev: 688 703 cdev_del(&vol->cdev); 689 704 return err; ··· 697 716 */ 698 717 void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol) 699 718 { 700 - int err; 701 - 702 719 dbg_gen("free volume %d", vol->vol_id); 703 720 704 721 ubi->volumes[vol->vol_id] = NULL; 705 - err = ubi_destroy_gluebi(vol); 706 722 cdev_del(&vol->cdev); 707 723 volume_sysfs_close(vol); 708 724 }