From owner-p4-projects@FreeBSD.ORG Sun Jul 27 19:20:36 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2ED011065697; Sun, 27 Jul 2008 19:20:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68181065679 for ; Sun, 27 Jul 2008 19:20:35 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DB7A58FC18 for ; Sun, 27 Jul 2008 19:20:35 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m6RJKZ5t054698 for ; Sun, 27 Jul 2008 19:20:35 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6RJKZxd054696 for perforce@freebsd.org; Sun, 27 Jul 2008 19:20:35 GMT (envelope-from trasz@freebsd.org) Date: Sun, 27 Jul 2008 19:20:35 GMT Message-Id: <200807271920.m6RJKZxd054696@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Cc: Subject: PERFORCE change 146060 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2008 19:20:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=146060 Change 146060 by trasz@trasz_traszkan on 2008/07/27 19:20:34 Simplify alignment. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_branding.c#3 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#4 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.h#4 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_branding.c#3 (text+ko) ==== @@ -48,10 +48,7 @@ { acl_t aclp; - /* - * XXX: This is not a proper way to strip off low order bits. - */ - aclp = (acl_t)((long)entry - ((long)entry % (long)_ACL_T_ALIGNMENT)); + aclp = (acl_t)(((long)entry >> _ACL_T_ALIGNMENT_BITS) << _ACL_T_ALIGNMENT_BITS); return (aclp); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#4 (text+ko) ==== @@ -57,8 +57,8 @@ return (NULL); } - assert(_ACL_T_ALIGNMENT > sizeof(struct acl_t_struct)); - error = posix_memalign((void *)&acl, _ACL_T_ALIGNMENT, sizeof(struct acl_t_struct)); + assert(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct)); + error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS, sizeof(struct acl_t_struct)); if (error) return (NULL); ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.h#4 (text+ko) ==== @@ -33,7 +33,7 @@ #define _ACL_SUPPORT_H #define _POSIX1E_ACL_STRING_PERM_MAXSIZE 3 /* read, write, exec */ -#define _ACL_T_ALIGNMENT (1 << 12) +#define _ACL_T_ALIGNMENT_BITS 12 int _acl_type_unold(acl_type_t type); int _acl_differs(const acl_t a, const acl_t b);