Skip to content

Commit

Permalink
UBI: remove built-in gluebi
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Pervushin authored and Artem Bityutskiy committed Jun 2, 2009
1 parent 0e0ee1c commit 518ceef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 51 deletions.
1 change: 0 additions & 1 deletion drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
vol->corrupted = 1;
}
vol->checked = 1;
ubi_gluebi_updated(vol);
ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED);
revoke_exclusive(desc, UBI_READWRITE);
}
Expand Down
26 changes: 0 additions & 26 deletions drivers/mtd/ubi/ubi.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ struct ubi_volume_desc;
* @changing_leb: %1 if the atomic LEB change ioctl command is in progress
* @direct_writes: %1 if direct writes are enabled for this volume
*
* @gluebi_desc: gluebi UBI volume descriptor
* @gluebi_refcount: reference count of the gluebi MTD device
* @gluebi_mtd: MTD device description object of the gluebi MTD device
*
* The @corrupted field indicates that the volume's contents is corrupted.
* Since UBI protects only static volumes, this field is not relevant to
* dynamic volumes - it is user's responsibility to assure their data
Expand Down Expand Up @@ -278,17 +274,6 @@ struct ubi_volume {
unsigned int updating:1;
unsigned int changing_leb:1;
unsigned int direct_writes:1;

#ifdef CONFIG_MTD_UBI_GLUEBI
/*
* Gluebi-related stuff may be compiled out.
* Note: this should not be built into UBI but should be a separate
* ubimtd driver which works on top of UBI and emulates MTD devices.
*/
struct ubi_volume_desc *gluebi_desc;
int gluebi_refcount;
struct mtd_info gluebi_mtd;
#endif
};

/**
Expand Down Expand Up @@ -517,17 +502,6 @@ int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,
int ubi_check_volume(struct ubi_device *ubi, int vol_id);
void ubi_calculate_reserved(struct ubi_device *ubi);

/* gluebi.c */
#ifdef CONFIG_MTD_UBI_GLUEBI
int ubi_create_gluebi(struct ubi_device *ubi, struct ubi_volume *vol);
int ubi_destroy_gluebi(struct ubi_volume *vol);
void ubi_gluebi_updated(struct ubi_volume *vol);
#else
#define ubi_create_gluebi(ubi, vol) 0
#define ubi_destroy_gluebi(vol) 0
#define ubi_gluebi_updated(vol)
#endif

/* eba.c */
int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol,
int lnum);
Expand Down
26 changes: 2 additions & 24 deletions drivers/mtd/ubi/vmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,6 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
goto out_mapping;
}

err = ubi_create_gluebi(ubi, vol);
if (err)
goto out_cdev;

vol->dev.release = vol_release;
vol->dev.parent = &ubi->dev;
vol->dev.devt = dev;
Expand All @@ -330,7 +326,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
err = device_register(&vol->dev);
if (err) {
ubi_err("cannot register device");
goto out_gluebi;
goto out_cdev;
}

err = volume_sysfs_init(ubi, vol);
Expand Down Expand Up @@ -375,10 +371,6 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
do_free = 0;
get_device(&vol->dev);
volume_sysfs_close(vol);
out_gluebi:
if (ubi_destroy_gluebi(vol))
dbg_err("cannot destroy gluebi for volume %d:%d",
ubi->ubi_num, vol_id);
out_cdev:
cdev_del(&vol->cdev);
out_mapping:
Expand Down Expand Up @@ -433,10 +425,6 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl)
ubi->volumes[vol_id] = NULL;
spin_unlock(&ubi->volumes_lock);

err = ubi_destroy_gluebi(vol);
if (err)
goto out_err;

if (!no_vtbl) {
err = ubi_change_vtbl_record(ubi, vol_id, NULL);
if (err)
Expand Down Expand Up @@ -674,23 +662,18 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
return err;
}

err = ubi_create_gluebi(ubi, vol);
if (err)
goto out_cdev;

vol->dev.release = vol_release;
vol->dev.parent = &ubi->dev;
vol->dev.devt = dev;
vol->dev.class = ubi_class;
dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id);
err = device_register(&vol->dev);
if (err)
goto out_gluebi;
goto out_cdev;

err = volume_sysfs_init(ubi, vol);
if (err) {
cdev_del(&vol->cdev);
err = ubi_destroy_gluebi(vol);
volume_sysfs_close(vol);
return err;
}
Expand All @@ -699,8 +682,6 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
dbg_err("check failed while adding volume %d", vol_id);
return err;

out_gluebi:
err = ubi_destroy_gluebi(vol);
out_cdev:
cdev_del(&vol->cdev);
return err;
Expand All @@ -716,12 +697,9 @@ int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol)
*/
void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
{
int err;

dbg_gen("free volume %d", vol->vol_id);

ubi->volumes[vol->vol_id] = NULL;
err = ubi_destroy_gluebi(vol);
cdev_del(&vol->cdev);
volume_sysfs_close(vol);
}
Expand Down

0 comments on commit 518ceef

Please sign in to comment.