aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorJaakko Heinonen <jh@FreeBSD.org>2012-04-10 16:05:52 +0000
committerJaakko Heinonen <jh@FreeBSD.org>2012-04-10 16:05:52 +0000
commit034efc61baa8d521eaa323640b01626faed72c84 (patch)
treed03e8ef6d7830f793135eeca59dd071d19738a19 /sys/fs
parentfce74feae103931f724accd8c30cab9871834348 (diff)
downloadsrc-034efc61baa8d521eaa323640b01626faed72c84.tar.gz
src-034efc61baa8d521eaa323640b01626faed72c84.zip
Apply changes from r233787 to ext2fs:
- Use more natural ip->i_flags instead of vap->va_flags in the final flags check. - Style improvements. No functional change intended. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=234104
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 5e2e31814ee5..85552ba6915e 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -407,7 +407,6 @@ ext2_setattr(ap)
/* Disallow flags not supported by ext2fs. */
if(vap->va_flags & ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP))
return (EOPNOTSUPP);
-
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
/*
@@ -424,23 +423,23 @@ ext2_setattr(ap)
* if securelevel > 0 and any existing system flags are set.
*/
if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) {
- if (ip->i_flags
- & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
+ if (ip->i_flags &
+ (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
error = securelevel_gt(cred, 0);
if (error)
return (error);
}
ip->i_flags = vap->va_flags;
} else {
- if (ip->i_flags
- & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
+ if (ip->i_flags &
+ (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
(vap->va_flags & UF_SETTABLE) != vap->va_flags)
return (EPERM);
ip->i_flags &= SF_SETTABLE;
ip->i_flags |= (vap->va_flags & UF_SETTABLE);
}
ip->i_flag |= IN_CHANGE;
- if (vap->va_flags & (IMMUTABLE | APPEND))
+ if (ip->i_flags & (IMMUTABLE | APPEND))
return (0);
}
if (ip->i_flags & (IMMUTABLE | APPEND))