aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-10-17 06:31:39 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-03 06:14:33 -0500
commit17c2f9f85c896b48a5d74a9155d99ec5b241a0e6 (patch)
tree9d3e38e673d1d3af650072388a671ec767d3941a /fs/ubifs/super.c
parent5dd7cbc083f3a91fa7454125fe992826701b67bc (diff)
UBIFS: separate debugging fields out
Introduce a new data structure which contains all debugging stuff inside. This is cleaner than having debugging stuff directly in 'c'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index fc81022cc26d..ad44822059c7 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1069,11 +1069,9 @@ static int mount_ubifs(struct ubifs_info *c)
1069 if (err) 1069 if (err)
1070 return err; 1070 return err;
1071 1071
1072#ifdef CONFIG_UBIFS_FS_DEBUG 1072 err = ubifs_debugging_init(c);
1073 c->dbg_buf = vmalloc(c->leb_size); 1073 if (err)
1074 if (!c->dbg_buf) 1074 return err;
1075 return -ENOMEM;
1076#endif
1077 1075
1078 err = check_volume_empty(c); 1076 err = check_volume_empty(c);
1079 if (err) 1077 if (err)
@@ -1139,18 +1137,16 @@ static int mount_ubifs(struct ubifs_info *c)
1139 goto out_free; 1137 goto out_free;
1140 } 1138 }
1141 1139
1142 dbg_failure_mode_registration(c);
1143
1144 err = init_constants_late(c); 1140 err = init_constants_late(c);
1145 if (err) 1141 if (err)
1146 goto out_dereg; 1142 goto out_free;
1147 1143
1148 sz = ALIGN(c->max_idx_node_sz, c->min_io_size); 1144 sz = ALIGN(c->max_idx_node_sz, c->min_io_size);
1149 sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size); 1145 sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size);
1150 c->cbuf = kmalloc(sz, GFP_NOFS); 1146 c->cbuf = kmalloc(sz, GFP_NOFS);
1151 if (!c->cbuf) { 1147 if (!c->cbuf) {
1152 err = -ENOMEM; 1148 err = -ENOMEM;
1153 goto out_dereg; 1149 goto out_free;
1154 } 1150 }
1155 1151
1156 sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id); 1152 sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
@@ -1350,14 +1346,12 @@ out_wbufs:
1350 free_wbufs(c); 1346 free_wbufs(c);
1351out_cbuf: 1347out_cbuf:
1352 kfree(c->cbuf); 1348 kfree(c->cbuf);
1353out_dereg:
1354 dbg_failure_mode_deregistration(c);
1355out_free: 1349out_free:
1356 kfree(c->bu.buf); 1350 kfree(c->bu.buf);
1357 vfree(c->ileb_buf); 1351 vfree(c->ileb_buf);
1358 vfree(c->sbuf); 1352 vfree(c->sbuf);
1359 kfree(c->bottom_up_buf); 1353 kfree(c->bottom_up_buf);
1360 UBIFS_DBG(vfree(c->dbg_buf)); 1354 ubifs_debugging_exit(c);
1361 return err; 1355 return err;
1362} 1356}
1363 1357
@@ -1394,8 +1388,7 @@ static void ubifs_umount(struct ubifs_info *c)
1394 vfree(c->ileb_buf); 1388 vfree(c->ileb_buf);
1395 vfree(c->sbuf); 1389 vfree(c->sbuf);
1396 kfree(c->bottom_up_buf); 1390 kfree(c->bottom_up_buf);
1397 UBIFS_DBG(vfree(c->dbg_buf)); 1391 ubifs_debugging_exit(c);
1398 dbg_failure_mode_deregistration(c);
1399} 1392}
1400 1393
1401/** 1394/**
@@ -1879,7 +1872,6 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
1879 goto out_iput; 1872 goto out_iput;
1880 1873
1881 mutex_unlock(&c->umount_mutex); 1874 mutex_unlock(&c->umount_mutex);
1882
1883 return 0; 1875 return 0;
1884 1876
1885out_iput: 1877out_iput: