Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2017 19:05:45 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319827 - head/sys/fs/ext2fs
Message-ID:  <201706111905.v5BJ5jrC039327@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jun 11 19:05:45 2017
New Revision: 319827
URL: https://svnweb.freebsd.org/changeset/base/319827

Log:
  extfs: fix the build with no UFS_ACL.
  
  Some people may want to drop UFS-style ACLs for slimmer kernels.
  Let's just not assume everyone needs ACLs.
  
  Reported by:	bde
  Submitted by:	Fedor Uporov
  Differential Revision:	https://reviews.freebsd.org/D11145

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

Modified: head/sys/fs/ext2fs/ext2_acl.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_acl.c	Sun Jun 11 16:54:04 2017	(r319826)
+++ head/sys/fs/ext2fs/ext2_acl.c	Sun Jun 11 19:05:45 2017	(r319827)
@@ -49,6 +49,8 @@
 #include <fs/ext2fs/ext2_dinode.h>
 #include <fs/ext2fs/ext2_mount.h>
 
+#ifdef UFS_ACL
+
 void
 ext2_sync_acl_from_inode(struct inode *ip, struct acl *acl)
 {
@@ -522,3 +524,5 @@ ext2_aclcheck(struct vop_aclcheck_args *ap)
 
 	return (acl_posix1e_check(ap->a_aclp));
 }
+
+#endif /* UFS_ACL */

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Sun Jun 11 16:54:04 2017	(r319826)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Sun Jun 11 19:05:45 2017	(r319827)
@@ -164,9 +164,11 @@ struct vop_vector ext2_vnodeops = {
 	.vop_getextattr =	ext2_getextattr,
 	.vop_listextattr =	ext2_listextattr,
 	.vop_setextattr =	ext2_setextattr,
+#ifdef UFS_ACL
 	.vop_getacl =		ext2_getacl,
 	.vop_setacl =		ext2_setacl,
 	.vop_aclcheck =		ext2_aclcheck,
+#endif /* UFS_ACL */
 	.vop_vptofh =		ext2_vptofh,
 };
 
@@ -1087,6 +1089,7 @@ out:
 	return (error);
 }
 
+#ifdef UFS_ACL
 static int
 ext2_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp,
     mode_t dmode, struct ucred *cred, struct thread *td)
@@ -1231,6 +1234,8 @@ out:
 	return (error);
 }
 
+#endif /* UFS_ACL */
+
 /*
  * Mkdir system call
  */
@@ -1340,6 +1345,7 @@ ext2_mkdir(struct vop_mkdir_args *ap)
 		ip->i_flag |= IN_CHANGE;
 	}
 
+#ifdef UFS_ACL
 	if (dvp->v_mount->mnt_flag & MNT_ACLS) {
 		error = ext2_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode,
 		    cnp->cn_cred, cnp->cn_thread);
@@ -1347,6 +1353,8 @@ ext2_mkdir(struct vop_mkdir_args *ap)
 			goto bad;
 	}
 
+#endif /* UFS_ACL */
+
 	/* Directory set up, now install its entry in the parent directory. */
 	error = ext2_direnter(ip, dvp, cnp);
 	if (error) {
@@ -1601,6 +1609,8 @@ ext2_pathconf(struct vop_pathconf_args *ap)
 	case _PC_NO_TRUNC:
 		*ap->a_retval = 1;
 		break;
+
+#ifdef UFS_ACL
 	case _PC_ACL_EXTENDED:
 		if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS)
 			*ap->a_retval = 1;
@@ -1613,6 +1623,8 @@ ext2_pathconf(struct vop_pathconf_args *ap)
 		else
 			*ap->a_retval = 3;
 		break;
+#endif /* UFS_ACL */
+
 	case _PC_MIN_HOLE_SIZE:
 		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
 		break;
@@ -1927,12 +1939,14 @@ ext2_makeinode(int mode, struct vnode *dvp, struct vno
 	if (error)
 		goto bad;
 
+#ifdef UFS_ACL
 	if (dvp->v_mount->mnt_flag & MNT_ACLS) {
 		error = ext2_do_posix1e_acl_inheritance_file(dvp, tvp, mode,
 		    cnp->cn_cred, cnp->cn_thread);
 		if (error)
 			goto bad;
 	}
+#endif /* UFS_ACL */
 
 	error = ext2_direnter(ip, dvp, cnp);
 	if (error)



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