aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/ialloc.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:04 -0400
commitee3ffd6c126323693b3b32a71a1f1acfce30bd66 (patch)
tree942b653ebc46c5c4f246ddee8a89b154122f1493 /fs/ufs/ialloc.c
parent577a82752f95a5680d7c14569ffd3fd630d9fb22 (diff)
[PATCH] ufs: make fsck -f happy
ufs super block contains some statistic about file systems, like amount of directories, free blocks, inodes and so on. UFS1 hold this information in one location and uses 32bit integers for such information, UFS2 hold statistic in another location and uses 64bit integers. There is transition variant, if UFS1 has type 44BSD and flags field in super block has some special value this mean that we work with statistic like UFS2 does. and this also means that nobody care about old(UFS1) statistic. So if start fsck against such file system, after usage linux ufs driver, it found error: at now only UFS1 like statistic is updated. This patch should fix this. Also it contains some minor cleanup: CodingSytle and remove unused variables. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/ialloc.c')
-rw-r--r--fs/ufs/ialloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index c684aaad9998..6d7527350026 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -103,12 +103,12 @@ void ufs_free_inode (struct inode * inode)
103 if (ino < ucpi->c_irotor) 103 if (ino < ucpi->c_irotor)
104 ucpi->c_irotor = ino; 104 ucpi->c_irotor = ino;
105 fs32_add(sb, &ucg->cg_cs.cs_nifree, 1); 105 fs32_add(sb, &ucg->cg_cs.cs_nifree, 1);
106 fs32_add(sb, &usb1->fs_cstotal.cs_nifree, 1); 106 uspi->cs_total.cs_nifree++;
107 fs32_add(sb, &UFS_SB(sb)->fs_cs(cg).cs_nifree, 1); 107 fs32_add(sb, &UFS_SB(sb)->fs_cs(cg).cs_nifree, 1);
108 108
109 if (is_directory) { 109 if (is_directory) {
110 fs32_sub(sb, &ucg->cg_cs.cs_ndir, 1); 110 fs32_sub(sb, &ucg->cg_cs.cs_ndir, 1);
111 fs32_sub(sb, &usb1->fs_cstotal.cs_ndir, 1); 111 uspi->cs_total.cs_ndir--;
112 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cg).cs_ndir, 1); 112 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cg).cs_ndir, 1);
113 } 113 }
114 } 114 }
@@ -228,12 +228,12 @@ cg_found:
228 } 228 }
229 229
230 fs32_sub(sb, &ucg->cg_cs.cs_nifree, 1); 230 fs32_sub(sb, &ucg->cg_cs.cs_nifree, 1);
231 fs32_sub(sb, &usb1->fs_cstotal.cs_nifree, 1); 231 uspi->cs_total.cs_nifree--;
232 fs32_sub(sb, &sbi->fs_cs(cg).cs_nifree, 1); 232 fs32_sub(sb, &sbi->fs_cs(cg).cs_nifree, 1);
233 233
234 if (S_ISDIR(mode)) { 234 if (S_ISDIR(mode)) {
235 fs32_add(sb, &ucg->cg_cs.cs_ndir, 1); 235 fs32_add(sb, &ucg->cg_cs.cs_ndir, 1);
236 fs32_add(sb, &usb1->fs_cstotal.cs_ndir, 1); 236 uspi->cs_total.cs_ndir++;
237 fs32_add(sb, &sbi->fs_cs(cg).cs_ndir, 1); 237 fs32_add(sb, &sbi->fs_cs(cg).cs_ndir, 1);
238 } 238 }
239 239