Whamcloud - gitweb
LU-14291 lustre: further cleanup of acl code. 32/42032/3
authorMr NeilBrown <neilb@suse.de>
Sun, 14 Mar 2021 22:34:55 +0000 (09:34 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 22 Mar 2021 16:26:28 +0000 (16:26 +0000)
Code in lustre/obdclass/acl.c is only used in lustre/mdd/, so move the
file there, renaming to mdd_acl.c and removing EXPORT_SYMBOL()
declarations.

The function prototypes in lustre_eacl.h are moved to mdd_internal.h,
and the remainder of that file is discarded.  THe
HAVE_STRUCT_ACL_XATTR stanza, in particular, is unnecessary is it
exists in lustre_compat.h.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Idb0978758640c5ad527d2c68c4fdf6dee32a731c
Reviewed-on: https://review.whamcloud.com/42032
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/Makefile.am
lustre/include/lustre_eacl.h
lustre/mdd/Makefile.in
lustre/mdd/mdd_acl.c [moved from lustre/obdclass/acl.c with 97% similarity]
lustre/mdd/mdd_internal.h
lustre/mdt/mdt_internal.h
lustre/obdclass/Makefile.in

index 3d17079..a0da174 100644 (file)
@@ -51,7 +51,6 @@ EXTRA_DIST = \
        lustre_disk.h \
        lustre_dlm_flags.h \
        lustre_dlm.h \
-       lustre_eacl.h \
        lustre_errno.h \
        lustre_export.h \
        lustre_fid.h \
index 68062dc..e69de29 100644 (file)
@@ -1,77 +0,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) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c) 2012, 2017, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/lustre/include/lustre_idmap.h
- *
- * MDS data structures.
- * See also lustre_idl.h for wire formats of requests.
- */
-
-#ifndef _LUSTRE_EACL_H
-#define _LUSTRE_EACL_H
-
-/** \defgroup eacl eacl
- *
- * @{
- */
-
-#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
-# include <linux/fs.h>
-# include <lustre_compat.h>
-
-#ifdef HAVE_SERVER_SUPPORT
-struct lu_ucred;
-struct lu_attr;
-struct lustre_idmap_table;
-
-#ifdef HAVE_STRUCT_POSIX_ACL_XATTR
-# define posix_acl_xattr_header struct posix_acl_xattr_header
-# define posix_acl_xattr_entry  struct posix_acl_xattr_entry
-#endif
-
-extern int lustre_posix_acl_permission(struct lu_ucred *mu,
-                                       const struct lu_attr *la,
-                                       unsigned int may_mask,
-                                       posix_acl_xattr_entry *entry,
-                                       int count);
-extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
-                                       __u32 mode, int count);
-extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
-                                        __u32 *pmode, int count);
-extern int lustre_posix_acl_equiv_mode(posix_acl_xattr_entry *entry, mode_t *mode_p,
-                                      int count);
-#endif /* HAVE_SERVER_SUPPORT */
-#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
-
-/** @} eacl */
-
-#endif
index b8b0a70..46705cd 100644 (file)
@@ -1,5 +1,7 @@
 MODULES := mdd
-mdd-objs := mdd_device.o \
+mdd-objs := \
+       mdd_acl.o \
+       mdd_device.o \
        mdd_dir.o \
        mdd_lock.o \
        mdd_lproc.o \
similarity index 97%
rename from lustre/obdclass/acl.c
rename to lustre/mdd/mdd_acl.c
index 2ff7396..a32a1d9 100644 (file)
 #define DEBUG_SUBSYSTEM S_SEC
 #include <lu_object.h>
 #include <lustre_acl.h>
-#include <lustre_eacl.h>
 #include <obd_support.h>
 #include <lustre_idmap.h>
 #include <md_object.h>
+#include "mdd_internal.h"
 
 #ifdef CONFIG_LUSTRE_FS_POSIX_ACL
 
@@ -149,7 +149,6 @@ check_perm:
 
        return -EACCES;
 }
-EXPORT_SYMBOL(lustre_posix_acl_permission);
 
 /*
  * Modify the ACL for the chmod.
@@ -198,7 +197,6 @@ int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry, u32 mode,
 
        return 0;
 }
-EXPORT_SYMBOL(lustre_posix_acl_chmod_masq);
 
 /*
  * Returns 0 if the acl can be exactly represented in the traditional
@@ -241,7 +239,6 @@ lustre_posix_acl_equiv_mode(posix_acl_xattr_entry *entry, mode_t *mode_p,
                *mode_p = (*mode_p & ~S_IRWXUGO) | mode;
        return not_equiv;
 }
-EXPORT_SYMBOL(lustre_posix_acl_equiv_mode);
 
 /*
  * Modify acl when creating a new object.
@@ -300,5 +297,4 @@ int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry, u32 *pmode,
        *pmode = (*pmode & ~S_IRWXUGO) | mode;
        return not_equiv;
 }
-EXPORT_SYMBOL(lustre_posix_acl_create_masq);
 #endif
index 842abe3..bdb6e6d 100644 (file)
@@ -39,7 +39,6 @@
 
 #include <lustre_acl.h>
 #include <lustre_compat.h>
-#include <lustre_eacl.h>
 #include <md_object.h>
 #include <dt_object.h>
 #include <lustre_lfsck.h>
@@ -438,6 +437,19 @@ int mdd_changelog_user_purge(const struct lu_env *env, struct mdd_device *mdd,
 /* mdd_prepare.c */
 int mdd_compat_fixes(const struct lu_env *env, struct mdd_device *mdd);
 
+/* acl.c */
+extern int lustre_posix_acl_permission(struct lu_ucred *mu,
+                                      const struct lu_attr *la,
+                                      unsigned int may_mask,
+                                      posix_acl_xattr_entry *entry,
+                                      int count);
+extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
+                                      __u32 mode, int count);
+extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
+                                       __u32 *pmode, int count);
+extern int lustre_posix_acl_equiv_mode(posix_acl_xattr_entry *entry,
+                                      mode_t *mode_p, int count);
+
 /* inline functions */
 static inline int lu_device_is_mdd(struct lu_device *d)
 {
index 64d5bef..bdecb34 100644 (file)
@@ -56,7 +56,6 @@
 #include <lustre_req_layout.h>
 #include <lustre_sec.h>
 #include <lustre_idmap.h>
-#include <lustre_eacl.h>
 #include <lustre_quota.h>
 #include <lustre_linkea.h>
 #include <lustre_lmv.h>
index 4882371..afb99fc 100644 (file)
@@ -15,7 +15,6 @@ obdclass-all-objs += integrity.o obd_cksum.o
 obdclass-all-objs += lu_tgt_descs.o lu_tgt_pool.o
 obdclass-all-objs += range_lock.o interval_tree.o
 
-@SERVER_TRUE@obdclass-all-objs += acl.o
 @SERVER_TRUE@obdclass-all-objs += idmap.o
 @SERVER_TRUE@obdclass-all-objs += upcall_cache.o
 @SERVER_TRUE@obdclass-all-objs += lprocfs_jobstats.o
@@ -34,7 +33,6 @@ EXTRA_DIST = $(obdclass-all-objs:.o=.c) llog_test.c llog_internal.h
 EXTRA_DIST += cl_internal.h local_storage.h
 EXTRA_DIST += range_lock.c interval_tree.c
 
-@SERVER_FALSE@EXTRA_DIST += acl.c
 @SERVER_FALSE@EXTRA_DIST += idmap.c
 @SERVER_FALSE@EXTRA_DIST += upcall_cache.c
 @SERVER_FALSE@EXTRA_DIST += lprocfs_jobstats.c