git: 6939af9c1280 - stable/13 - ext2fs: remove remnants of the UFS snapshot code

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 07 Feb 2022 09:50:48 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=6939af9c12800bb27ae52f39155dd7e00cc1b35e

commit 6939af9c12800bb27ae52f39155dd7e00cc1b35e
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-01-30 01:52:27 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-02-07 09:38:49 +0000

    ext2fs: remove remnants of the UFS snapshot code
    
    (cherry picked from commit 9cd59de2e19b032fcbe6a9e7524b00e73a1a761c)
---
 sys/fs/ext2fs/ext2_bmap.c  | 13 +------------
 sys/fs/ext2fs/ext2_vnops.c |  2 +-
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/sys/fs/ext2fs/ext2_bmap.c b/sys/fs/ext2fs/ext2_bmap.c
index 49963c8a92a1..412f08b871e0 100644
--- a/sys/fs/ext2fs/ext2_bmap.c
+++ b/sys/fs/ext2fs/ext2_bmap.c
@@ -308,17 +308,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb)
 	if (bp)
 		bqrelse(bp);
 
-	/*
-	 * Since this is FFS independent code, we are out of scope for the
-	 * definitions of BLK_NOCOPY and BLK_SNAP, but we do know that they
-	 * will fall in the range 1..um_seqinc, so we use that test and
-	 * return a request for a zeroed out buffer if attempts are made
-	 * to read a BLK_NOCOPY or BLK_SNAP block.
-	 */
-	if ((ip->i_flags & SF_SNAPSHOT) && daddr > 0 && daddr < ump->um_seqinc) {
-		*bnp = -1;
-		return (0);
-	}
 	*bnp = blkptrtodb(ump, daddr);
 	if (*bnp == 0) {
 		*bnp = -1;
@@ -356,7 +345,7 @@ ext2_bmap_seekdata(struct vnode *vp, off_t *offp)
 	mp = vp->v_mount;
 	ump = VFSTOEXT2(mp);
 
-	if (vp->v_type != VREG || (ip->i_flags & SF_SNAPSHOT) != 0)
+	if (vp->v_type != VREG)
 		return (EINVAL);
 	if (*offp < 0 || *offp >= ip->i_size)
 		return (ENXIO);
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 63909b7df987..724690403809 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -342,7 +342,7 @@ ext2_access(struct vop_access_args *ap)
 	}
 
 	/* If immutable bit set, nobody gets to write it. */
-	if ((accmode & VWRITE) && (ip->i_flags & (SF_IMMUTABLE | SF_SNAPSHOT)))
+	if ((accmode & VWRITE) && (ip->i_flags & SF_IMMUTABLE))
 		return (EPERM);
 
 	error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,