mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 10:01:02 +01:00
ext2fs: remove remnants of the UFS snapshot code
Noted and reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34095
This commit is contained in:
parent
85f7e9a4f0
commit
9cd59de2e1
@ -308,17 +308,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb)
|
|||||||
if (bp)
|
if (bp)
|
||||||
bqrelse(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);
|
*bnp = blkptrtodb(ump, daddr);
|
||||||
if (*bnp == 0) {
|
if (*bnp == 0) {
|
||||||
*bnp = -1;
|
*bnp = -1;
|
||||||
@ -356,7 +345,7 @@ ext2_bmap_seekdata(struct vnode *vp, off_t *offp)
|
|||||||
mp = vp->v_mount;
|
mp = vp->v_mount;
|
||||||
ump = VFSTOEXT2(mp);
|
ump = VFSTOEXT2(mp);
|
||||||
|
|
||||||
if (vp->v_type != VREG || (ip->i_flags & SF_SNAPSHOT) != 0)
|
if (vp->v_type != VREG)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
if (*offp < 0 || *offp >= ip->i_size)
|
if (*offp < 0 || *offp >= ip->i_size)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
@ -339,7 +339,7 @@ ext2_access(struct vop_access_args *ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If immutable bit set, nobody gets to write it. */
|
/* 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);
|
return (EPERM);
|
||||||
|
|
||||||
error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,
|
error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,
|
||||||
|
Loading…
Reference in New Issue
Block a user