aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/io.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-18 07:53:05 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-01 04:21:47 -0400
commit2a734bb8d502b645c061fa329e87c5d651498e68 (patch)
treed87ee3ddd7c5ccee224044e2178aaf131407b91a /drivers/mtd/ubi/io.c
parentd99383b00eba9c6ac3dea462d718b2849012ee03 (diff)
UBI: use debugfs for the extra checks knobs
This patch introduces debugfs support to UBI. All the UBI stuff is kept in the "ubi" debugfs directory, which contains per-UBI device "ubi/ubiX" sub-directories, containing debugging files. This file also creates "ubi/ubiX/chk_gen" and "ubi/ubiX/chk_io" knobs for switching general and I/O extra checks on and off. And it removes the 'debug_chks' UBI module parameters. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/io.c')
-rw-r--r--drivers/mtd/ubi/io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 8c1b1c7bc4a7..e23d6118224f 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -1146,7 +1146,7 @@ static int paranoid_check_not_bad(const struct ubi_device *ubi, int pnum)
1146{ 1146{
1147 int err; 1147 int err;
1148 1148
1149 if (!(ubi_chk_flags & UBI_CHK_IO)) 1149 if (!ubi->dbg->chk_io)
1150 return 0; 1150 return 0;
1151 1151
1152 err = ubi_io_is_bad(ubi, pnum); 1152 err = ubi_io_is_bad(ubi, pnum);
@@ -1173,7 +1173,7 @@ static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum,
1173 int err; 1173 int err;
1174 uint32_t magic; 1174 uint32_t magic;
1175 1175
1176 if (!(ubi_chk_flags & UBI_CHK_IO)) 1176 if (!ubi->dbg->chk_io)
1177 return 0; 1177 return 0;
1178 1178
1179 magic = be32_to_cpu(ec_hdr->magic); 1179 magic = be32_to_cpu(ec_hdr->magic);
@@ -1211,7 +1211,7 @@ static int paranoid_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum)
1211 uint32_t crc, hdr_crc; 1211 uint32_t crc, hdr_crc;
1212 struct ubi_ec_hdr *ec_hdr; 1212 struct ubi_ec_hdr *ec_hdr;
1213 1213
1214 if (!(ubi_chk_flags & UBI_CHK_IO)) 1214 if (!ubi->dbg->chk_io)
1215 return 0; 1215 return 0;
1216 1216
1217 ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS); 1217 ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS);
@@ -1255,7 +1255,7 @@ static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum,
1255 int err; 1255 int err;
1256 uint32_t magic; 1256 uint32_t magic;
1257 1257
1258 if (!(ubi_chk_flags & UBI_CHK_IO)) 1258 if (!ubi->dbg->chk_io)
1259 return 0; 1259 return 0;
1260 1260
1261 magic = be32_to_cpu(vid_hdr->magic); 1261 magic = be32_to_cpu(vid_hdr->magic);
@@ -1296,7 +1296,7 @@ static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
1296 struct ubi_vid_hdr *vid_hdr; 1296 struct ubi_vid_hdr *vid_hdr;
1297 void *p; 1297 void *p;
1298 1298
1299 if (!(ubi_chk_flags & UBI_CHK_IO)) 1299 if (!ubi->dbg->chk_io)
1300 return 0; 1300 return 0;
1301 1301
1302 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS); 1302 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS);
@@ -1348,7 +1348,7 @@ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
1348 void *buf1; 1348 void *buf1;
1349 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; 1349 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1350 1350
1351 if (!(ubi_chk_flags & UBI_CHK_IO)) 1351 if (!ubi->dbg->chk_io)
1352 return 0; 1352 return 0;
1353 1353
1354 buf1 = __vmalloc(len, GFP_NOFS, PAGE_KERNEL); 1354 buf1 = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
@@ -1412,7 +1412,7 @@ int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
1412 void *buf; 1412 void *buf;
1413 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; 1413 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1414 1414
1415 if (!(ubi_chk_flags & UBI_CHK_IO)) 1415 if (!ubi->dbg->chk_io)
1416 return 0; 1416 return 0;
1417 1417
1418 buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL); 1418 buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);