diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-07 11:24:14 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-18 05:28:25 -0400 |
commit | e1cf7e6dd4ffd4391391e4e08b0fd44681b0e74d (patch) | |
tree | a80c1063b918485c037c4c1267296642ca6fabbf /drivers/mtd/ubi | |
parent | f089c0b28cdba1076aa8335dcaaaacc3dafc7d36 (diff) |
UBI: improve debugging messages
Various minor improvements to the debugging messages which
I found useful while hunting problems.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/cdev.c | 6 | ||||
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 9 | ||||
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 10 |
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 1024c106c899..9a2b217941f7 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
@@ -113,7 +113,8 @@ static int vol_cdev_open(struct inode *inode, struct file *file) | |||
113 | else | 113 | else |
114 | mode = UBI_READONLY; | 114 | mode = UBI_READONLY; |
115 | 115 | ||
116 | dbg_gen("open volume %d, mode %d", vol_id, mode); | 116 | dbg_gen("open device %d, volume %d, mode %d", |
117 | ubi_num, vol_id, mode); | ||
117 | 118 | ||
118 | desc = ubi_open_volume(ubi_num, vol_id, mode); | 119 | desc = ubi_open_volume(ubi_num, vol_id, mode); |
119 | if (IS_ERR(desc)) | 120 | if (IS_ERR(desc)) |
@@ -128,7 +129,8 @@ static int vol_cdev_release(struct inode *inode, struct file *file) | |||
128 | struct ubi_volume_desc *desc = file->private_data; | 129 | struct ubi_volume_desc *desc = file->private_data; |
129 | struct ubi_volume *vol = desc->vol; | 130 | struct ubi_volume *vol = desc->vol; |
130 | 131 | ||
131 | dbg_gen("release volume %d, mode %d", vol->vol_id, desc->mode); | 132 | dbg_gen("release device %d, volume %d, mode %d", |
133 | vol->ubi->ubi_num, vol->vol_id, desc->mode); | ||
132 | 134 | ||
133 | if (vol->updating) { | 135 | if (vol->updating) { |
134 | ubi_warn("update of volume %d not finished, volume is damaged", | 136 | ubi_warn("update of volume %d not finished, volume is damaged", |
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 4abbe573fa40..2675207c5fe3 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
@@ -106,7 +106,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) | |||
106 | struct ubi_device *ubi; | 106 | struct ubi_device *ubi; |
107 | struct ubi_volume *vol; | 107 | struct ubi_volume *vol; |
108 | 108 | ||
109 | dbg_gen("open device %d volume %d, mode %d", ubi_num, vol_id, mode); | 109 | dbg_gen("open device %d, volume %d, mode %d", ubi_num, vol_id, mode); |
110 | 110 | ||
111 | if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES) | 111 | if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES) |
112 | return ERR_PTR(-EINVAL); | 112 | return ERR_PTR(-EINVAL); |
@@ -196,6 +196,8 @@ out_free: | |||
196 | kfree(desc); | 196 | kfree(desc); |
197 | out_put_ubi: | 197 | out_put_ubi: |
198 | ubi_put_device(ubi); | 198 | ubi_put_device(ubi); |
199 | dbg_err("cannot open device %d, volume %d, error %d", | ||
200 | ubi_num, vol_id, err); | ||
199 | return ERR_PTR(err); | 201 | return ERR_PTR(err); |
200 | } | 202 | } |
201 | EXPORT_SYMBOL_GPL(ubi_open_volume); | 203 | EXPORT_SYMBOL_GPL(ubi_open_volume); |
@@ -215,7 +217,7 @@ struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | |||
215 | struct ubi_device *ubi; | 217 | struct ubi_device *ubi; |
216 | struct ubi_volume_desc *ret; | 218 | struct ubi_volume_desc *ret; |
217 | 219 | ||
218 | dbg_gen("open volume %s, mode %d", name, mode); | 220 | dbg_gen("open device %d, volume %s, mode %d", ubi_num, name, mode); |
219 | 221 | ||
220 | if (!name) | 222 | if (!name) |
221 | return ERR_PTR(-EINVAL); | 223 | return ERR_PTR(-EINVAL); |
@@ -266,7 +268,8 @@ void ubi_close_volume(struct ubi_volume_desc *desc) | |||
266 | struct ubi_volume *vol = desc->vol; | 268 | struct ubi_volume *vol = desc->vol; |
267 | struct ubi_device *ubi = vol->ubi; | 269 | struct ubi_device *ubi = vol->ubi; |
268 | 270 | ||
269 | dbg_gen("close volume %d, mode %d", vol->vol_id, desc->mode); | 271 | dbg_gen("close device %d, volume %d, mode %d", |
272 | ubi->ubi_num, vol->vol_id, desc->mode); | ||
270 | 273 | ||
271 | spin_lock(&ubi->volumes_lock); | 274 | spin_lock(&ubi->volumes_lock); |
272 | switch (desc->mode) { | 275 | switch (desc->mode) { |
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 328c1242920e..419599d62b29 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
@@ -232,8 +232,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
232 | req->vol_id = vol_id; | 232 | req->vol_id = vol_id; |
233 | } | 233 | } |
234 | 234 | ||
235 | dbg_gen("volume ID %d, %llu bytes, type %d, name %s", | 235 | dbg_gen("create device %d, volume %d, %llu bytes, type %d, name %s", |
236 | vol_id, (unsigned long long)req->bytes, | 236 | ubi->ubi_num, vol_id, (unsigned long long)req->bytes, |
237 | (int)req->vol_type, req->name); | 237 | (int)req->vol_type, req->name); |
238 | 238 | ||
239 | /* Ensure that this volume does not exist */ | 239 | /* Ensure that this volume does not exist */ |
@@ -412,7 +412,7 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl) | |||
412 | struct ubi_device *ubi = vol->ubi; | 412 | struct ubi_device *ubi = vol->ubi; |
413 | int i, err, vol_id = vol->vol_id, reserved_pebs = vol->reserved_pebs; | 413 | int i, err, vol_id = vol->vol_id, reserved_pebs = vol->reserved_pebs; |
414 | 414 | ||
415 | dbg_gen("remove UBI volume %d", vol_id); | 415 | dbg_gen("remove device %d, volume %d", ubi->ubi_num, vol_id); |
416 | ubi_assert(desc->mode == UBI_EXCLUSIVE); | 416 | ubi_assert(desc->mode == UBI_EXCLUSIVE); |
417 | ubi_assert(vol == ubi->volumes[vol_id]); | 417 | ubi_assert(vol == ubi->volumes[vol_id]); |
418 | 418 | ||
@@ -498,8 +498,8 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) | |||
498 | if (ubi->ro_mode) | 498 | if (ubi->ro_mode) |
499 | return -EROFS; | 499 | return -EROFS; |
500 | 500 | ||
501 | dbg_gen("re-size volume %d to from %d to %d PEBs", | 501 | dbg_gen("re-size device %d, volume %d to from %d to %d PEBs", |
502 | vol_id, vol->reserved_pebs, reserved_pebs); | 502 | ubi->ubi_num, vol_id, vol->reserved_pebs, reserved_pebs); |
503 | 503 | ||
504 | if (vol->vol_type == UBI_STATIC_VOLUME && | 504 | if (vol->vol_type == UBI_STATIC_VOLUME && |
505 | reserved_pebs < vol->used_ebs) { | 505 | reserved_pebs < vol->used_ebs) { |