diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2001-03-21 04:05:20 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2001-03-21 04:05:20 +0000 |
commit | 31c6ce0aede48d8e6e031d39e0891834c652fb42 (patch) | |
tree | dde1431c047453a8142801271545b029c5cbe1cc /sys | |
parent | 6e9a9c5851050b7baeedb9d88a4acaf4161baeb6 (diff) | |
download | src-31c6ce0aede48d8e6e031d39e0891834c652fb42.tar.gz src-31c6ce0aede48d8e6e031d39e0891834c652fb42.zip |
Notes
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_snapshot.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index c8a808ffa705..f128d048803a 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -339,7 +339,8 @@ restart: goto out1; copy_fs = (struct fs *)(nbp->b_data + blkoff(fs, SBOFF)); bcopy(fs, copy_fs, fs->fs_sbsize); - copy_fs->fs_clean = 1; + if ((fs->fs_flags & FS_UNCLEAN) == 0) + copy_fs->fs_clean = 1; if (fs->fs_sbsize < SBSIZE) bzero(&nbp->b_data[blkoff(fs, SBOFF) + fs->fs_sbsize], SBSIZE - fs->fs_sbsize); @@ -601,6 +602,8 @@ ffs_snapgone(ip) struct inode *ip; { struct inode *xp; + struct fs *fs; + int snaploc; /* * Find snapshot in incore list. @@ -613,6 +616,21 @@ ffs_snapgone(ip) ip->i_number); else vrele(ITOV(ip)); + /* + * Delete snapshot inode from superblock. Keep list dense. + */ + fs = ip->i_fs; + for (snaploc = 0; snaploc < FSMAXSNAP; snaploc++) + if (fs->fs_snapinum[snaploc] == ip->i_number) + break; + if (snaploc < FSMAXSNAP) { + for (snaploc++; snaploc < FSMAXSNAP; snaploc++) { + if (fs->fs_snapinum[snaploc] == 0) + break; + fs->fs_snapinum[snaploc - 1] = fs->fs_snapinum[snaploc]; + } + fs->fs_snapinum[snaploc - 1] = 0; + } } /* @@ -627,25 +645,11 @@ ffs_snapremove(vp) struct buf *ibp; struct fs *fs; ufs_daddr_t blkno, dblk; - int error, snaploc, loc, last; + int error, loc, last; ip = VTOI(vp); fs = ip->i_fs; /* - * Delete snapshot inode from superblock. Keep list dense. - */ - for (snaploc = 0; snaploc < FSMAXSNAP; snaploc++) - if (fs->fs_snapinum[snaploc] == ip->i_number) - break; - if (snaploc < FSMAXSNAP) { - for (snaploc++; snaploc < FSMAXSNAP; snaploc++) { - if (fs->fs_snapinum[snaploc] == 0) - break; - fs->fs_snapinum[snaploc - 1] = fs->fs_snapinum[snaploc]; - } - fs->fs_snapinum[snaploc - 1] = 0; - } - /* * Delete from incore list. * Clear copy-on-write flag if last snapshot. */ |