Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2012 16:05:52 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234104 - head/sys/fs/ext2fs
Message-ID:  <201204101605.q3AG5qaH030816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Tue Apr 10 16:05:52 2012
New Revision: 234104
URL: http://svn.freebsd.org/changeset/base/234104

Log:
  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

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Tue Apr 10 15:59:37 2012	(r234103)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Tue Apr 10 16:05:52 2012	(r234104)
@@ -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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204101605.q3AG5qaH030816>