summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-12-15 19:25:59 +0000
committermckusick <mckusick@FreeBSD.org>2002-12-15 19:25:59 +0000
commit668d95fdc48725b7e7dccf426eb6ed4d48ce6006 (patch)
tree52061c14e77f3fe7f6c3ef3721ae64b1430d2c29 /sys/ufs
parent6bb43f226cd93e3d43a8e2117470ff75a02cad98 (diff)
downloadFreeBSD-src-668d95fdc48725b7e7dccf426eb6ed4d48ce6006.zip
FreeBSD-src-668d95fdc48725b7e7dccf426eb6ed4d48ce6006.tar.gz
Update to previous change (1.54) to use an approperly wide inode field
so as to work correctly on 64-bit platforms. Reported-by: Jake Burkholder <jake@locore.ca> Sponsored by: DARPA & NAI Labs. Approved by: Ian Dowse <iedowse@maths.tcd.ie>
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c14
-rw-r--r--sys/ufs/ufs/inode.h7
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 4e03eb9..994e8d3 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -532,18 +532,16 @@ out1:
}
/*
* Allocate the space for the list of preallocated snapshot blocks.
- * The i_offset field is borrowed to pass the value of snapblklist
- * down into the expunge functions.
*/
snaplistsize = fs->fs_ncg + howmany(fs->fs_cssize, fs->fs_bsize) +
FSMAXSNAP + 1 /* superblock */ + 1 /* last block */ + 1 /* size */;
MALLOC(snapblklist, daddr_t *, snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
- ((daddr_t *)(ip->i_offset)) = &snapblklist[1];
+ ip->i_snapblklist = &snapblklist[1];
/*
* Expunge the blocks used by the snapshots from the set of
* blocks marked as used in the snapshot bitmaps. Also, collect
- * the list of allocated blocks in i_offset.
+ * the list of allocated blocks in i_snapblklist.
*/
if (ip->i_ump->um_fstype == UFS1)
error = expunge_ufs1(vp, ip, copy_fs, mapacct_ufs1, BLK_SNAP);
@@ -554,9 +552,9 @@ out1:
FREE(snapblklist, M_UFSMNT);
goto done;
}
- snaplistsize = ((daddr_t *)(ip->i_offset)) - snapblklist;
+ snaplistsize = ip->i_snapblklist - snapblklist;
snapblklist[0] = snaplistsize;
- ip->i_offset = 0;
+ ip->i_snapblklist = 0;
/*
* Write out the list of allocated blocks to the end of the snapshot.
*/
@@ -999,7 +997,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
if (blkno == 0 || blkno == BLK_NOCOPY)
continue;
if (expungetype == BLK_SNAP && blkno != BLK_SNAP)
- *((daddr_t *)(ip->i_offset))++ = lblkno;
+ *ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
ffs_blkfree(fs, vp, blkno, fs->fs_bsize, inum);
@@ -1275,7 +1273,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
if (blkno == 0 || blkno == BLK_NOCOPY)
continue;
if (expungetype == BLK_SNAP && blkno != BLK_SNAP)
- *((daddr_t *)(ip->i_offset))++ = lblkno;
+ *ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
ffs_blkfree(fs, vp, blkno, fs->fs_bsize, inum);
diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h
index 2a59e63..705ee3f 100644
--- a/sys/ufs/ufs/inode.h
+++ b/sys/ufs/ufs/inode.h
@@ -85,7 +85,10 @@ struct inode {
ino_t i_ino; /* Inode number of found directory. */
u_int32_t i_reclen; /* Size of found directory entry. */
- struct dirhash *i_dirhash; /* Hashing for large directories */
+ union {
+ struct dirhash *dirhash; /* Hashing for large directories. */
+ daddr_t *snapblklist; /* Collect expunged snapshot blocks. */
+ } i_un;
/*
* Data for extended attribute modification.
@@ -124,6 +127,8 @@ struct inode {
#define IN_LAZYMOD 0x0040 /* Modified, but don't write yet. */
#define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */
+#define i_dirhash i_un.dirhash
+#define i_snapblklist i_un.snapblklist
#define i_din1 dinode_u.din1
#define i_din2 dinode_u.din2
OpenPOWER on IntegriCloud