diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-16 10:40:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-24 06:34:45 -0400 |
commit | c8566350a3229ca505b84313c65d1403b4d0cbfc (patch) | |
tree | 156309b71de9779948fdab03a2831b41fe6ca159 /drivers/mtd/ubi/cdev.c | |
parent | 85c6e6e28259e9b58b8984db536c45bc3161f40c (diff) |
UBI: fix and re-work debugging stuff
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/cdev.c')
-rw-r--r-- | drivers/mtd/ubi/cdev.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 4fb84e3e6502..7c19918cc914 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
@@ -116,7 +116,7 @@ static int vol_cdev_open(struct inode *inode, struct file *file) | |||
116 | else | 116 | else |
117 | mode = UBI_READONLY; | 117 | mode = UBI_READONLY; |
118 | 118 | ||
119 | dbg_msg("open volume %d, mode %d", vol_id, mode); | 119 | dbg_gen("open volume %d, mode %d", vol_id, mode); |
120 | 120 | ||
121 | desc = ubi_open_volume(ubi_num, vol_id, mode); | 121 | desc = ubi_open_volume(ubi_num, vol_id, mode); |
122 | unlock_kernel(); | 122 | unlock_kernel(); |
@@ -132,7 +132,7 @@ static int vol_cdev_release(struct inode *inode, struct file *file) | |||
132 | struct ubi_volume_desc *desc = file->private_data; | 132 | struct ubi_volume_desc *desc = file->private_data; |
133 | struct ubi_volume *vol = desc->vol; | 133 | struct ubi_volume *vol = desc->vol; |
134 | 134 | ||
135 | dbg_msg("release volume %d, mode %d", vol->vol_id, desc->mode); | 135 | dbg_gen("release volume %d, mode %d", vol->vol_id, desc->mode); |
136 | 136 | ||
137 | if (vol->updating) { | 137 | if (vol->updating) { |
138 | ubi_warn("update of volume %d not finished, volume is damaged", | 138 | ubi_warn("update of volume %d not finished, volume is damaged", |
@@ -141,7 +141,7 @@ static int vol_cdev_release(struct inode *inode, struct file *file) | |||
141 | vol->updating = 0; | 141 | vol->updating = 0; |
142 | vfree(vol->upd_buf); | 142 | vfree(vol->upd_buf); |
143 | } else if (vol->changing_leb) { | 143 | } else if (vol->changing_leb) { |
144 | dbg_msg("only %lld of %lld bytes received for atomic LEB change" | 144 | dbg_gen("only %lld of %lld bytes received for atomic LEB change" |
145 | " for volume %d:%d, cancel", vol->upd_received, | 145 | " for volume %d:%d, cancel", vol->upd_received, |
146 | vol->upd_bytes, vol->ubi->ubi_num, vol->vol_id); | 146 | vol->upd_bytes, vol->ubi->ubi_num, vol->vol_id); |
147 | vol->changing_leb = 0; | 147 | vol->changing_leb = 0; |
@@ -183,7 +183,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin) | |||
183 | return -EINVAL; | 183 | return -EINVAL; |
184 | } | 184 | } |
185 | 185 | ||
186 | dbg_msg("seek volume %d, offset %lld, origin %d, new offset %lld", | 186 | dbg_gen("seek volume %d, offset %lld, origin %d, new offset %lld", |
187 | vol->vol_id, offset, origin, new_offset); | 187 | vol->vol_id, offset, origin, new_offset); |
188 | 188 | ||
189 | file->f_pos = new_offset; | 189 | file->f_pos = new_offset; |
@@ -201,7 +201,7 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, | |||
201 | void *tbuf; | 201 | void *tbuf; |
202 | uint64_t tmp; | 202 | uint64_t tmp; |
203 | 203 | ||
204 | dbg_msg("read %zd bytes from offset %lld of volume %d", | 204 | dbg_gen("read %zd bytes from offset %lld of volume %d", |
205 | count, *offp, vol->vol_id); | 205 | count, *offp, vol->vol_id); |
206 | 206 | ||
207 | if (vol->updating) { | 207 | if (vol->updating) { |
@@ -216,7 +216,7 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, | |||
216 | return 0; | 216 | return 0; |
217 | 217 | ||
218 | if (vol->corrupted) | 218 | if (vol->corrupted) |
219 | dbg_msg("read from corrupted volume %d", vol->vol_id); | 219 | dbg_gen("read from corrupted volume %d", vol->vol_id); |
220 | 220 | ||
221 | if (*offp + count > vol->used_bytes) | 221 | if (*offp + count > vol->used_bytes) |
222 | count_save = count = vol->used_bytes - *offp; | 222 | count_save = count = vol->used_bytes - *offp; |
@@ -285,7 +285,7 @@ static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf, | |||
285 | char *tbuf; | 285 | char *tbuf; |
286 | uint64_t tmp; | 286 | uint64_t tmp; |
287 | 287 | ||
288 | dbg_msg("requested: write %zd bytes to offset %lld of volume %u", | 288 | dbg_gen("requested: write %zd bytes to offset %lld of volume %u", |
289 | count, *offp, vol->vol_id); | 289 | count, *offp, vol->vol_id); |
290 | 290 | ||
291 | if (vol->vol_type == UBI_STATIC_VOLUME) | 291 | if (vol->vol_type == UBI_STATIC_VOLUME) |
@@ -514,7 +514,7 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file, | |||
514 | break; | 514 | break; |
515 | } | 515 | } |
516 | 516 | ||
517 | dbg_msg("erase LEB %d:%d", vol->vol_id, lnum); | 517 | dbg_gen("erase LEB %d:%d", vol->vol_id, lnum); |
518 | err = ubi_eba_unmap_leb(ubi, vol, lnum); | 518 | err = ubi_eba_unmap_leb(ubi, vol, lnum); |
519 | if (err) | 519 | if (err) |
520 | break; | 520 | break; |
@@ -626,7 +626,7 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, | |||
626 | { | 626 | { |
627 | struct ubi_mkvol_req req; | 627 | struct ubi_mkvol_req req; |
628 | 628 | ||
629 | dbg_msg("create volume"); | 629 | dbg_gen("create volume"); |
630 | err = copy_from_user(&req, argp, sizeof(struct ubi_mkvol_req)); | 630 | err = copy_from_user(&req, argp, sizeof(struct ubi_mkvol_req)); |
631 | if (err) { | 631 | if (err) { |
632 | err = -EFAULT; | 632 | err = -EFAULT; |
@@ -656,7 +656,7 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, | |||
656 | { | 656 | { |
657 | int vol_id; | 657 | int vol_id; |
658 | 658 | ||
659 | dbg_msg("remove volume"); | 659 | dbg_gen("remove volume"); |
660 | err = get_user(vol_id, (__user int32_t *)argp); | 660 | err = get_user(vol_id, (__user int32_t *)argp); |
661 | if (err) { | 661 | if (err) { |
662 | err = -EFAULT; | 662 | err = -EFAULT; |
@@ -689,7 +689,7 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, | |||
689 | uint64_t tmp; | 689 | uint64_t tmp; |
690 | struct ubi_rsvol_req req; | 690 | struct ubi_rsvol_req req; |
691 | 691 | ||
692 | dbg_msg("re-size volume"); | 692 | dbg_gen("re-size volume"); |
693 | err = copy_from_user(&req, argp, sizeof(struct ubi_rsvol_req)); | 693 | err = copy_from_user(&req, argp, sizeof(struct ubi_rsvol_req)); |
694 | if (err) { | 694 | if (err) { |
695 | err = -EFAULT; | 695 | err = -EFAULT; |
@@ -742,7 +742,7 @@ static int ctrl_cdev_ioctl(struct inode *inode, struct file *file, | |||
742 | struct ubi_attach_req req; | 742 | struct ubi_attach_req req; |
743 | struct mtd_info *mtd; | 743 | struct mtd_info *mtd; |
744 | 744 | ||
745 | dbg_msg("attach MTD device"); | 745 | dbg_gen("attach MTD device"); |
746 | err = copy_from_user(&req, argp, sizeof(struct ubi_attach_req)); | 746 | err = copy_from_user(&req, argp, sizeof(struct ubi_attach_req)); |
747 | if (err) { | 747 | if (err) { |
748 | err = -EFAULT; | 748 | err = -EFAULT; |
@@ -782,7 +782,7 @@ static int ctrl_cdev_ioctl(struct inode *inode, struct file *file, | |||
782 | { | 782 | { |
783 | int ubi_num; | 783 | int ubi_num; |
784 | 784 | ||
785 | dbg_msg("dettach MTD device"); | 785 | dbg_gen("dettach MTD device"); |
786 | err = get_user(ubi_num, (__user int32_t *)argp); | 786 | err = get_user(ubi_num, (__user int32_t *)argp); |
787 | if (err) { | 787 | if (err) { |
788 | err = -EFAULT; | 788 | err = -EFAULT; |