From: Andreas Gruenbacher Subject: Re: [PATCH v18 11/22] vfs: Cache base_acl objects in inodes Date: Fri, 11 Mar 2016 17:24:45 +0100 Message-ID: References: <1456733847-17982-1-git-send-email-agruenba@redhat.com> <1456733847-17982-12-git-send-email-agruenba@redhat.com> <20160311140746.GC14808@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Alexander Viro , "J. Bruce Fields" , Linux NFS Mailing List , "Theodore Ts'o" , linux-cifs@vger.kernel.org, Linux API , Trond Myklebust , LKML , XFS Developers , Andreas Dilger , linux-fsdevel , Jeff Layton , linux-ext4 , Anna Schumaker , jaegeuk@kernel.org, chao2.yu@samsung.com To: Christoph Hellwig Return-path: Received: from mail-vk0-f52.google.com ([209.85.213.52]:34535 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932619AbcCKQYq (ORCPT ); Fri, 11 Mar 2016 11:24:46 -0500 Received: by mail-vk0-f52.google.com with SMTP id e185so139943932vkb.1 for ; Fri, 11 Mar 2016 08:24:46 -0800 (PST) In-Reply-To: <20160311140746.GC14808@infradead.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Fri, Mar 11, 2016 at 3:07 PM, Christoph Hellwig wrote: > On Mon, Feb 29, 2016 at 09:17:16AM +0100, Andreas Gruenbacher wrote: >> POSIX ACLs and richacls are both objects allocated by kmalloc() with a >> reference count which are freed by kfree_rcu(). An inode can either >> cache an access and a default POSIX ACL, or a richacl (richacls do not >> have default acls). To allow an inode to cache either of the two kinds >> of acls, introduce a new base_acl type and convert i_acl and >> i_default_acl to that type. In most cases, the vfs then doesn't care which >> kind of acl an inode caches (if any). > > This base_acl object is pointless. I've asked in the past to have > a proper container for the ACLs in common code, but a union > of a refcount and a rcu head doesn't really fit that category. POSIX ACLs and RichACLs are different objects, with different members and different algorithms operating on them. The only commonality is that they are both kmalloc()ed, reference counted objects, and when an inode is destroyed, both kinds of ACLs can be put in the same way, avoiding an unnecessary if. What kind of common-code container beyond that are you still dreaming about? Thanks, Andreas