From patchwork Wed Apr 13 22:30:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 8829441 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 14B8A9F3D1 for ; Wed, 13 Apr 2016 22:30:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A7FC20361 for ; Wed, 13 Apr 2016 22:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B47E2037C for ; Wed, 13 Apr 2016 22:30:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932163AbcDMWak (ORCPT ); Wed, 13 Apr 2016 18:30:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55091 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbcDMWag (ORCPT ); Wed, 13 Apr 2016 18:30:36 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E88131602CC; Wed, 13 Apr 2016 22:30:35 +0000 (UTC) Received: from schleppi.home.com (vpn1-7-5.ams2.redhat.com [10.36.7.5]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3DMULdI026208; Wed, 13 Apr 2016 18:30:34 -0400 From: Andreas Gruenbacher To: Al Viro Cc: Steve French , linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, cluster-devel@redhat.com Subject: [PATCH 7/8] posix acls: Export xattr_handler functions Date: Thu, 14 Apr 2016 00:30:19 +0200 Message-Id: <1460586620-5717-8-git-send-email-agruenba@redhat.com> In-Reply-To: <1460586620-5717-1-git-send-email-agruenba@redhat.com> References: <1460586620-5717-1-git-send-email-agruenba@redhat.com> In-Reply-To: <20160413182026.GR25498@ZenIV.linux.org.uk> References: <20160413182026.GR25498@ZenIV.linux.org.uk> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Apr 2016 22:30:35 +0000 (UTC) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These functions are useful in filesystems like gfs2 which require pre-/postamble code around xattr operations. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson --- fs/posix_acl.c | 9 ++++++--- include/linux/posix_acl_xattr.h | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 2c60f17..1da2c63 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -795,7 +795,7 @@ posix_acl_to_xattr(struct user_namespace *user_ns, const struct posix_acl *acl, } EXPORT_SYMBOL (posix_acl_to_xattr); -static int +int posix_acl_xattr_get(const struct xattr_handler *handler, struct dentry *unused, struct inode *inode, const char *name, void *value, size_t size) @@ -819,8 +819,9 @@ posix_acl_xattr_get(const struct xattr_handler *handler, return error; } +EXPORT_SYMBOL(posix_acl_xattr_get); -static int +int posix_acl_xattr_set(const struct xattr_handler *handler, struct dentry *dentry, const char *name, const void *value, size_t size, int flags) @@ -856,12 +857,14 @@ out: posix_acl_release(acl); return ret; } +EXPORT_SYMBOL(posix_acl_xattr_set); -static bool +bool posix_acl_xattr_list(struct dentry *dentry) { return IS_POSIXACL(d_backing_inode(dentry)); } +EXPORT_SYMBOL(posix_acl_xattr_list); const struct xattr_handler posix_acl_access_xattr_handler = { .name = XATTR_NAME_POSIX_ACL_ACCESS, diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h index e5e8ec4..c92607c 100644 --- a/include/linux/posix_acl_xattr.h +++ b/include/linux/posix_acl_xattr.h @@ -65,6 +65,14 @@ struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns, int posix_acl_to_xattr(struct user_namespace *user_ns, const struct posix_acl *acl, void *buffer, size_t size); +int posix_acl_xattr_get(const struct xattr_handler *handler, + struct dentry *unused, struct inode *inode, + const char *name, void *value, size_t size); +int posix_acl_xattr_set(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, + const void *value, size_t size, int flags); +bool posix_acl_xattr_list(struct dentry *dentry); + extern const struct xattr_handler posix_acl_access_xattr_handler; extern const struct xattr_handler posix_acl_default_xattr_handler;