From bca975c7fa261ffb926e8a18d5869b886c65f447 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Tue, 6 Jan 2015 09:38:23 -0600 Subject: [PATCH] LU-2675 lustre: remove lustre/include/linux/ Merge the contents of lustre/include/linux/lvfs.h into lustre/include/lvfs.h. Merge lustre/include/linux/lustre_user.h into lustre/include/lustre/lustre_user.h. Move lustre_compat25.h and lustre_patchless_compat.h from lustre/include/linux/ to lustre/include/ and rename lustre_compat25.h to lustre_compat.h. Signed-off-by: John L. Hammond Change-Id: I217d3c9b2369b469f95f916becafbfe674fed3ef Reviewed-on: http://review.whamcloud.com/13271 Tested-by: Jenkins Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- lustre.spec.in | 1 - lustre/include/Makefile.am | 6 +- lustre/include/linux/.gitignore | 8 -- lustre/include/linux/Makefile.am | 47 ---------- lustre/include/linux/lustre_user.h | 77 ---------------- lustre/include/linux/lvfs.h | 102 --------------------- lustre/include/lustre/lustre_user.h | 22 ++++- .../{linux/lustre_compat25.h => lustre_compat.h} | 8 +- .../include/{linux => }/lustre_patchless_compat.h | 0 lustre/include/lvfs.h | 58 +++++++++++- lustre/llite/llite_mmap.c | 2 +- lustre/llite/rw.c | 2 +- lustre/llite/rw26.c | 2 +- 13 files changed, 86 insertions(+), 249 deletions(-) delete mode 100644 lustre/include/linux/.gitignore delete mode 100644 lustre/include/linux/Makefile.am delete mode 100644 lustre/include/linux/lustre_user.h delete mode 100644 lustre/include/linux/lvfs.h rename lustre/include/{linux/lustre_compat25.h => lustre_compat.h} (98%) rename lustre/include/{linux => }/lustre_patchless_compat.h (100%) diff --git a/lustre.spec.in b/lustre.spec.in index a3a8e50..625d858 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -493,7 +493,6 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \ %{_mandir}/man?/* %{_includedir}/lustre %{_includedir}/libcfs -%{_includedir}/linux/lustre_user.h %endif %{_datadir}/lustre %{_sysconfdir}/udev/rules.d/99-lustre.rules diff --git a/lustre/include/Makefile.am b/lustre/include/Makefile.am index 86d0f78..25adaa8 100644 --- a/lustre/include/Makefile.am +++ b/lustre/include/Makefile.am @@ -36,9 +36,9 @@ # Lustre is a trademark of Sun Microsystems, Inc. # -SUBDIRS = linux lustre +SUBDIRS = lustre -DIST_SUBDIRS = linux lustre +DIST_SUBDIRS = lustre EXTRA_DIST = \ cl_object.h \ @@ -51,6 +51,7 @@ EXTRA_DIST = \ lustre_acl.h \ lustre_capa.h \ lustre_cfg.h \ + lustre_compat.h \ lustre_debug.h \ lustre_disk.h \ lustre_dlm_flags.h \ @@ -76,6 +77,7 @@ EXTRA_DIST = \ lustre_nodemap.h \ lustre_nrs_tbf.h \ lustre_param.h \ + lustre_patchless_compat.h \ lustre_quota.h \ lustre_req_layout.h \ lustre_sec.h \ diff --git a/lustre/include/linux/.gitignore b/lustre/include/linux/.gitignore deleted file mode 100644 index 50facfb..0000000 --- a/lustre/include/linux/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile.in -/extN_fs.h -/extN_fs_i.h -/extN_fs_sb.h -/extN_jbd.h -/extN_xattr.h -/xattr.h -/lustre_build_version.h diff --git a/lustre/include/linux/Makefile.am b/lustre/include/linux/Makefile.am deleted file mode 100644 index d2856db..0000000 --- a/lustre/include/linux/Makefile.am +++ /dev/null @@ -1,47 +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.sun.com/software/products/lustre/docs/GPLv2.pdf -# -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, -# CA 95054 USA or visit www.sun.com if you need additional information or -# have any questions. -# -# GPL HEADER END -# - -# -# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. -# -# Copyright (c) 2012, 2014, Intel Corporation. -# - -# -# This file is part of Lustre, http://www.lustre.org/ -# Lustre is a trademark of Sun Microsystems, Inc. -# - -linuxdir = $(includedir)/linux - -if UTILS -linux_HEADERS = lustre_user.h -endif - -EXTRA_DIST = \ - lvfs.h lustre_compat25.h \ - lustre_user.h lustre_patchless_compat.h diff --git a/lustre/include/linux/lustre_user.h b/lustre/include/linux/lustre_user.h deleted file mode 100644 index 83b5666..0000000 --- a/lustre/include/linux/lustre_user.h +++ /dev/null @@ -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.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lustre_user.h - * - * Lustre public user-space interface definitions. - */ - -#ifndef _LINUX_LUSTRE_USER_H -#define _LINUX_LUSTRE_USER_H - -#ifndef __KERNEL__ -# define NEED_QUOTA_DEFS -# include -#else -# include -# include -#endif - -/* - * asm-x86_64/processor.h on some SLES 9 distros seems to use - * kernel-only typedefs. fortunately skipping it altogether is ok - * (for now). - */ -#define __ASM_X86_64_PROCESSOR_H - -#ifdef __KERNEL__ -#include -#else -#include -#include -#endif - -#if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \ - defined(__craynv) || defined (__mips64__) || defined(__powerpc64__) -typedef struct stat lstat_t; -#define lstat_f lstat -#define HAVE_LOV_USER_MDS_DATA -#elif defined(__USE_LARGEFILE64) || defined(__KERNEL__) -typedef struct stat64 lstat_t; -#define lstat_f lstat64 -#define HAVE_LOV_USER_MDS_DATA -#endif - -#endif /* _LUSTRE_USER_H */ diff --git a/lustre/include/linux/lvfs.h b/lustre/include/linux/lvfs.h deleted file mode 100644 index b621fd0..0000000 --- a/lustre/include/linux/lvfs.h +++ /dev/null @@ -1,102 +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.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, 2014, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lvfs.h - * - * lustre VFS/process permission interface - */ - -#ifndef __LINUX_LVFS_H__ -#define __LINUX_LVFS_H__ - -#ifndef __LVFS_H__ -#error Do not #include this file directly. #include instead -#endif - -#include -#include - -#define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA -#define OBD_CTXT_DEBUG /* development-only debugging */ - -struct dt_device; - -struct lvfs_run_ctxt { - struct vfsmount *pwdmnt; - struct dentry *pwd; - mm_segment_t fs; - uint32_t umask; - struct dt_device *dt; -#ifdef OBD_CTXT_DEBUG - uint32_t magic; -#endif -}; - -#ifdef OBD_CTXT_DEBUG -#define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC -#else -#define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0) -#endif - - -/* We need to hold the inode semaphore over the dcache lookup itself, or we - * run the risk of entering the filesystem lookup path concurrently on SMP - * systems, and instantiating two inodes for the same entry. We still - * protect against concurrent addition/removal races with the DLM locking. - */ -static inline struct dentry *ll_lookup_one_len(const char *fid_name, - struct dentry *dparent, - int fid_namelen) -{ - struct dentry *dchild; - - mutex_lock(&dparent->d_inode->i_mutex); - dchild = lookup_one_len(fid_name, dparent, fid_namelen); - mutex_unlock(&dparent->d_inode->i_mutex); - - if (IS_ERR(dchild) || dchild->d_inode == NULL) - return dchild; - - if (is_bad_inode(dchild->d_inode)) { - CERROR("bad inode returned %lu/%u\n", - dchild->d_inode->i_ino, dchild->d_inode->i_generation); - dput(dchild); - dchild = ERR_PTR(-ENOENT); - } - return dchild; -} - - -#endif diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index d49c8c9..fb4cb9b 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -49,12 +49,28 @@ #include #ifdef __KERNEL__ +# include # include /* snprintf() */ -#else +# include +#else /* !__KERNEL__ */ +# define NEED_QUOTA_DEFS # include /* snprintf() */ -#endif +# include +# include +# include +#endif /* __KERNEL__ */ #include -#include + +#if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \ + defined(__craynv) || defined(__mips64__) || defined(__powerpc64__) +typedef struct stat lstat_t; +# define lstat_f lstat +# define HAVE_LOV_USER_MDS_DATA +#elif defined(__USE_LARGEFILE64) || defined(__KERNEL__) +typedef struct stat64 lstat_t; +# define lstat_f lstat64 +# define HAVE_LOV_USER_MDS_DATA +#endif #define LUSTRE_EOF 0xffffffffffffffffULL diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/lustre_compat.h similarity index 98% rename from lustre/include/linux/lustre_compat25.h rename to lustre/include/lustre_compat.h index ce4ae16..9918a7a 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/lustre_compat.h @@ -34,13 +34,13 @@ * Lustre is a trademark of Sun Microsystems, Inc. */ -#ifndef _LINUX_COMPAT25_H -#define _LINUX_COMPAT25_H +#ifndef _LUSTRE_COMPAT_H +#define _LUSTRE_COMPAT_H #include #include -#include +#include #ifdef HAVE_FS_STRUCT_RWLOCK # define LOCK_FS_STRUCT(fs) write_lock(&(fs)->lock) @@ -383,4 +383,4 @@ static inline void truncate_inode_pages_final(struct address_space *map) #define SIZE_MAX (~(size_t)0) #endif -#endif /* _COMPAT25_H */ +#endif /* _LUSTRE_COMPAT_H */ diff --git a/lustre/include/linux/lustre_patchless_compat.h b/lustre/include/lustre_patchless_compat.h similarity index 100% rename from lustre/include/linux/lustre_patchless_compat.h rename to lustre/include/lustre_patchless_compat.h diff --git a/lustre/include/lvfs.h b/lustre/include/lvfs.h index 41a7c14..be4187f 100644 --- a/lustre/include/lvfs.h +++ b/lustre/include/lvfs.h @@ -41,12 +41,66 @@ #ifndef __LVFS_H__ #define __LVFS_H__ -#include +#include +#include +#include +#include +#include +#include -#include +#define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA +#define OBD_CTXT_DEBUG /* development-only debugging */ + +struct dt_device; + +struct lvfs_run_ctxt { + struct vfsmount *pwdmnt; + struct dentry *pwd; + mm_segment_t fs; + int umask; + struct dt_device *dt; +#ifdef OBD_CTXT_DEBUG + unsigned int magic; +#endif +}; + +static inline void OBD_SET_CTXT_MAGIC(struct lvfs_run_ctxt *ctxt) +{ +#ifdef OBD_CTXT_DEBUG + ctxt->magic = OBD_RUN_CTXT_MAGIC; +#endif +} /* ptlrpc_sec_ctx.c */ void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx); void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx); +/* We need to hold the inode semaphore over the dcache lookup itself, or we + * run the risk of entering the filesystem lookup path concurrently on SMP + * systems, and instantiating two inodes for the same entry. We still + * protect against concurrent addition/removal races with the DLM locking. + */ +static inline struct dentry * +ll_lookup_one_len(const char *fid_name, struct dentry *dparent, + int fid_namelen) +{ + struct dentry *dchild; + + mutex_lock(&dparent->d_inode->i_mutex); + dchild = lookup_one_len(fid_name, dparent, fid_namelen); + mutex_unlock(&dparent->d_inode->i_mutex); + + if (IS_ERR(dchild) || dchild->d_inode == NULL) + return dchild; + + if (is_bad_inode(dchild->d_inode)) { + CERROR("bad inode returned %lu/%u\n", + dchild->d_inode->i_ino, dchild->d_inode->i_generation); + dput(dchild); + dchild = ERR_PTR(-ENOENT); + } + + return dchild; +} + #endif diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index d72665b..7ead998 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -52,7 +52,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include "llite_internal.h" -#include +#include static const struct vm_operations_struct ll_file_vm_ops; diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 70953fc..4e032fb 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -59,7 +59,7 @@ #include #include "llite_internal.h" -#include +#include struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt) { diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index b218f5e..40b68ca 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -63,7 +63,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include "llite_internal.h" -#include +#include /** * Implements Linux VM address_space::invalidatepage() method. This method is -- 1.8.3.1