Module Name: src
Committed By: bouyer
Date: Sat Feb 12 21:48:41 UTC 2011
Modified Files:
src/sbin/fsck_ffs [bouyer-quota2]: inode.c pass1.c pass4.c
Log Message:
Skip snapshot inodes for both block and inode quotas.
To generate a diff of this commit:
cvs rdiff -u -r1.63.2.2 -r1.63.2.3 src/sbin/fsck_ffs/inode.c
cvs rdiff -u -r1.46.14.2 -r1.46.14.3 src/sbin/fsck_ffs/pass1.c
cvs rdiff -u -r1.25.14.2 -r1.25.14.3 src/sbin/fsck_ffs/pass4.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/fsck_ffs/inode.c
diff -u src/sbin/fsck_ffs/inode.c:1.63.2.2 src/sbin/fsck_ffs/inode.c:1.63.2.3
--- src/sbin/fsck_ffs/inode.c:1.63.2.2 Sat Feb 12 19:53:32 2011
+++ src/sbin/fsck_ffs/inode.c Sat Feb 12 21:48:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.63.2.2 2011/02/12 19:53:32 bouyer Exp $ */
+/* $NetBSD: inode.c,v 1.63.2.3 2011/02/12 21:48:41 bouyer Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: inode.c,v 1.63.2.2 2011/02/12 19:53:32 bouyer Exp $");
+__RCSID("$NetBSD: inode.c,v 1.63.2.3 2011/02/12 21:48:41 bouyer Exp $");
#endif
#endif /* not lint */
@@ -580,8 +580,9 @@
* ckinode will call id_func (actually always pass4check)
* which will update the block count
*/
- update_uquot(idesc->id_number, idesc->id_uid, idesc->id_gid,
- 0, -1);
+ if (idesc->id_type != SNAP)
+ update_uquot(idesc->id_number,
+ idesc->id_uid, idesc->id_gid, 0, -1);
(void)ckinode(dp, idesc);
clearinode(dp);
inoinfo(idesc->id_number)->ino_state = USTATE;
@@ -844,7 +845,9 @@
clearinode(dp);
inodirty();
inoinfo(ino)->ino_state = USTATE;
- update_uquot(idesc.id_number, idesc.id_uid, idesc.id_gid, 0, -1);
+ if (idesc.id_type != SNAP)
+ update_uquot(idesc.id_number,
+ idesc.id_uid, idesc.id_gid, 0, -1);
n_files--;
if (cgp) {
clrbit(cg_inosused(cgp, 0), ino % sblock->fs_ipg);
Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.46.14.2 src/sbin/fsck_ffs/pass1.c:1.46.14.3
--- src/sbin/fsck_ffs/pass1.c:1.46.14.2 Sat Feb 12 19:53:32 2011
+++ src/sbin/fsck_ffs/pass1.c Sat Feb 12 21:48:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.46.14.2 2011/02/12 19:53:32 bouyer Exp $ */
+/* $NetBSD: pass1.c,v 1.46.14.3 2011/02/12 21:48:41 bouyer Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: pass1.c,v 1.46.14.2 2011/02/12 19:53:32 bouyer Exp $");
+__RCSID("$NetBSD: pass1.c,v 1.46.14.3 2011/02/12 21:48:41 bouyer Exp $");
#endif
#endif /* not lint */
@@ -466,8 +466,9 @@
dp->dp1.di_blocks = iswap32((int32_t)idesc->id_entryno);
inodirty();
}
- update_uquot(inumber, idesc->id_uid, idesc->id_gid,
- (idesc->id_type == SNAP) ? 0 : idesc->id_entryno, 1);
+ if (idesc->id_type != SNAP)
+ update_uquot(inumber, idesc->id_uid, idesc->id_gid,
+ idesc->id_entryno, 1);
return;
unknown:
pfatal("UNKNOWN FILE TYPE I=%llu", (unsigned long long)inumber);
Index: src/sbin/fsck_ffs/pass4.c
diff -u src/sbin/fsck_ffs/pass4.c:1.25.14.2 src/sbin/fsck_ffs/pass4.c:1.25.14.3
--- src/sbin/fsck_ffs/pass4.c:1.25.14.2 Sat Feb 12 19:53:32 2011
+++ src/sbin/fsck_ffs/pass4.c Sat Feb 12 21:48:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pass4.c,v 1.25.14.2 2011/02/12 19:53:32 bouyer Exp $ */
+/* $NetBSD: pass4.c,v 1.25.14.3 2011/02/12 21:48:41 bouyer Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass4.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: pass4.c,v 1.25.14.2 2011/02/12 19:53:32 bouyer Exp $");
+__RCSID("$NetBSD: pass4.c,v 1.25.14.3 2011/02/12 21:48:41 bouyer Exp $");
#endif
#endif /* not lint */
@@ -192,9 +192,11 @@
dtogd(sblock, blkno));
n_blks--;
- update_uquot(idesc->id_number, idesc->id_uid,
- idesc->id_gid, (idesc->id_type == SNAP) ?
- 0 : -btodb(sblock->fs_fsize), 0);
+ if (idesc->id_type != SNAP) {
+ update_uquot(idesc->id_number,
+ idesc->id_uid, idesc->id_gid,
+ -btodb(sblock->fs_fsize), 0);
+ }
if (idesc->id_numfrags != sblock->fs_frag &&
cgp) {
cgp->cg_cs.cs_nffree ++;