Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3454852imm; Tue, 29 May 2018 07:33:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrozVUUjzgavFixjTq2PSowW3ZMilVuQKoIBCyj5vanWX2QCbWaHHTs8fcDdGMuh4+QaCIH X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr13765025pgf.90.1527604384996; Tue, 29 May 2018 07:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527604384; cv=none; d=google.com; s=arc-20160816; b=sjgFQvj7xn8wtDs19it45f76szdtsIjBML38pqPOcPXLvSntpjijzpupH3Asz20L7W S9AK++fijMZ5ui/RzzAshST0fDMHrlzBFr9alSsUl5b9olC5eUtjbRpYY7YqiWzJosWw T8tNgsuNLHUfyPCGS3V1dcslipv26q3t3256DKY5Fzdg4mVID0uFDb38ISt1mNXq5JA8 WATGpoUGrChw5EXtEDP4SfFik5CppXDDX3SLPfm0D8F0v1UVFIQSBWyXPFvZetXFPcDB lMrubi4dGr4CIICJzEY09M4nswbJ9NqsaIHHcWLhTWccrGMTbJGG9cAa10CM4xSQaya+ Tasg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=R5uwxMsZb0hCN/14NYOz/CEMMzMs0+MGfssWOtvmfUU=; b=0onNVWjq4ZzXomcUqPG4DsBwhheX6L/i81qyQQHUVq4FG+Lz7d//D0PLbTKImRgJ+T mGBZKQAO7+5t7vbj5mbr8TfZhyONWh4p9QzUKJ7jZ395omQJocgFIbVL3lAwRoBwC5A6 3FrRs4b6P+Fh4MfPKvTOMUaAxVp3P0n1aChvOtaEWCn2GoNUTiD6g/7Kkf8UvkvnCkcm Aa9TlXFELxR2G+ESe4JZwlBx8FQQCxtPJWKTTy88EQfqZ6sDU+B6luwELrfZI2CUb7qo 2O0qnAcrKS2LQQB5kmPzgbMhP94LX22MMZUWBnHCH8wlajQMk1z11m0C3oagFzdES6c8 HyrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23-v6si9469595pfi.105.2018.05.29.07.32.50; Tue, 29 May 2018 07:33:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935004AbeE2OaP (ORCPT + 99 others); Tue, 29 May 2018 10:30:15 -0400 Received: from smtp4.ccs.ornl.gov ([160.91.203.40]:38132 "EHLO smtp4.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934533AbeE2OVv (ORCPT ); Tue, 29 May 2018 10:21:51 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id C1DF2100526F; Tue, 29 May 2018 10:21:49 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id BA1FC2C1; Tue, 29 May 2018 10:21:49 -0400 (EDT) From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , NeilBrown Cc: Linux Kernel Mailing List , Lustre Development List , James Simmons Subject: [PATCH v2 1/6] staging: lustre: llite: create acl.c file Date: Tue, 29 May 2018 10:21:40 -0400 Message-Id: <1527603705-30450-2-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527603705-30450-1-git-send-email-jsimmons@infradead.org> References: <1527603705-30450-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move ll_get_acl() to its own file acl.c just like all the other linux file systems do. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Signed-off-by: James Simmons --- Changelog: v1) Initial patch to add acl.c file which contains acl handling for lustre drivers/staging/lustre/lustre/llite/Makefile | 2 + drivers/staging/lustre/lustre/llite/acl.c | 51 ++++++++++++++++++++++ drivers/staging/lustre/lustre/llite/file.c | 13 ------ .../staging/lustre/lustre/llite/llite_internal.h | 5 +++ 4 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 drivers/staging/lustre/lustre/llite/acl.c diff --git a/drivers/staging/lustre/lustre/llite/Makefile b/drivers/staging/lustre/lustre/llite/Makefile index 519fd74..5200924 100644 --- a/drivers/staging/lustre/lustre/llite/Makefile +++ b/drivers/staging/lustre/lustre/llite/Makefile @@ -9,3 +9,5 @@ lustre-y := dcache.o dir.o file.o llite_lib.o llite_nfs.o \ super25.o statahead.o glimpse.o lcommon_cl.o lcommon_misc.o \ vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o \ lproc_llite.o + +lustre-$(CONFIG_FS_POSIX_ACL) += acl.o diff --git a/drivers/staging/lustre/lustre/llite/acl.c b/drivers/staging/lustre/lustre/llite/acl.c new file mode 100644 index 0000000..d7c3bf9 --- /dev/null +++ b/drivers/staging/lustre/lustre/llite/acl.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2011, 2015, Intel Corporation. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * lustre/llite/acl.c + */ + +#define DEBUG_SUBSYSTEM S_LLITE + +#include "llite_internal.h" + +struct posix_acl *ll_get_acl(struct inode *inode, int type) +{ + struct ll_inode_info *lli = ll_i2info(inode); + struct posix_acl *acl = NULL; + + spin_lock(&lli->lli_lock); + /* VFS' acl_permission_check->check_acl will release the refcount */ + acl = posix_acl_dup(lli->lli_posix_acl); + spin_unlock(&lli->lli_lock); + + return acl; +} diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index a77cadc..ccbf91b 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3030,19 +3030,6 @@ static int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, return rc; } -struct posix_acl *ll_get_acl(struct inode *inode, int type) -{ - struct ll_inode_info *lli = ll_i2info(inode); - struct posix_acl *acl = NULL; - - spin_lock(&lli->lli_lock); - /* VFS' acl_permission_check->check_acl will release the refcount */ - acl = posix_acl_dup(lli->lli_posix_acl); - spin_unlock(&lli->lli_lock); - - return acl; -} - int ll_inode_permission(struct inode *inode, int mask) { struct ll_sb_info *sbi; diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 379d88e..bdb1564 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -754,7 +754,12 @@ enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits, int ll_md_real_close(struct inode *inode, fmode_t fmode); int ll_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags); +#ifdef CONFIG_FS_POSIX_ACL struct posix_acl *ll_get_acl(struct inode *inode, int type); +#else +#define ll_get_acl NULL +#endif /* CONFIG_FS_POSIX_ACL */ + int ll_migrate(struct inode *parent, struct file *file, int mdtidx, const char *name, int namelen); int ll_get_fid_by_name(struct inode *parent, const char *name, -- 1.8.3.1