Date: Sun, 16 Dec 2001 13:50:15 +0000 From: Ian Dowse <iedowse@maths.tcd.ie> To: Jake Burkholder <jake@locore.ca> Cc: Kirk McKusick <mckusick@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_alloc.c ffs_snapshot.c ffs_vfsops.c fs.h Message-ID: <200112161350.aa62493@salmon.maths.tcd.ie> In-Reply-To: Your message of "Sat, 15 Dec 2001 23:46:03 EST." <20011215234603.B35198@locore.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20011215234603.B35198@locore.ca>, Jake Burkholder writes:
>This breaks compatibility with existing filesystems for 64 bit
>platforms. You added a pointer field to struct fs and decreased
>the size of the sparecon array by 4 bytes. Pointers are 8 bytes
>on 64 bit platforms, so the magic number ends up in a different
>place.
Does the following patch help? It moves fs_active to a section of
the superblock that already correctly deals with pointer fields.
Ian
Index: ffs_vfsops.c
===================================================================
RCS file: /home/iedowse/CVS/src/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.164
diff -u -r1.164 ffs_vfsops.c
--- ffs_vfsops.c 14 Dec 2001 00:15:05 -0000 1.164
+++ ffs_vfsops.c 16 Dec 2001 13:44:08 -0000
@@ -430,6 +430,7 @@
newfs->fs_csp = fs->fs_csp;
newfs->fs_maxcluster = fs->fs_maxcluster;
newfs->fs_contigdirs = fs->fs_contigdirs;
+ newfs->fs_active = fs->fs_active;
bcopy(newfs, fs, (u_int)fs->fs_sbsize);
if (fs->fs_sbsize < SBSIZE)
bp->b_flags |= B_INVAL | B_NOCACHE;
@@ -636,7 +637,6 @@
fs->fs_pendingblocks = 0;
fs->fs_pendinginodes = 0;
}
- fs->fs_active = 0;
/* XXX updating 4.2 FFS superblocks trashes rotational layout tables */
if (fs->fs_postblformat == FS_42POSTBLFMT && !ronly) {
error = EROFS; /* needs translation */
@@ -690,6 +690,7 @@
size = fs->fs_ncg * sizeof(u_int8_t);
fs->fs_contigdirs = (u_int8_t *)space;
bzero(fs->fs_contigdirs, size);
+ fs->fs_active = NULL;
/* Compatibility for old filesystems XXX */
if (fs->fs_avgfilesize <= 0) /* XXX */
fs->fs_avgfilesize = AVFILESIZ; /* XXX */
Index: fs.h
===================================================================
RCS file: /home/iedowse/CVS/src/sys/ufs/ffs/fs.h,v
retrieving revision 1.24
diff -u -r1.24 fs.h
--- fs.h 14 Dec 2001 00:15:06 -0000 1.24
+++ fs.h 16 Dec 2001 13:44:08 -0000
@@ -108,7 +108,7 @@
/*
* There is a 128-byte region in the superblock reserved for in-core
* pointers to summary information. Originally this included an array
- * of pointers to blocks of struct csum; now there are just three
+ * of pointers to blocks of struct csum; now there are just a few
* pointers and the remaining space is padded with fs_ocsp[].
*
* NOCSPTRS determines the size of this padding. One pointer (fs_csp)
@@ -116,9 +116,11 @@
* all cylinder groups; a second (fs_maxcluster) points to an array
* of cluster sizes that is computed as cylinder groups are inspected,
* and the third points to an array that tracks the creation of new
- * directories.
+ * directories. A fourth pointer, fs_active, is used when creating
+ * snapshots; it points to a bitmap of cylinder groups for which the
+ * free-block bitmap has changed since the snapshot operation began.
*/
-#define NOCSPTRS ((128 / sizeof(void *)) - 3)
+#define NOCSPTRS ((128 / sizeof(void *)) - 4)
/*
* A summary of contiguous blocks of various sizes is maintained
@@ -290,13 +292,13 @@
u_int8_t *fs_contigdirs; /* # of contiguously allocated dirs */
struct csum *fs_csp; /* cg summary info buffer for fs_cs */
int32_t *fs_maxcluster; /* max cluster in each cyl group */
+ u_int8_t *fs_active; /* used by snapshots to track fs */
int32_t fs_cpc; /* cyl per cycle in postbl */
int16_t fs_opostbl[16][8]; /* old rotation block list head */
int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
int32_t fs_avgfilesize; /* expected average file size */
int32_t fs_avgfpdir; /* expected # of files per directory */
- u_int8_t *fs_active; /* used by snapshots to track fs */
- int32_t fs_sparecon[25]; /* reserved for future constants */
+ int32_t fs_sparecon[26]; /* reserved for future constants */
int32_t fs_pendingblocks; /* blocks in process of being freed */
int32_t fs_pendinginodes; /* inodes in process of being freed */
int32_t fs_contigsumsize; /* size of cluster summary array */
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112161350.aa62493>
