Whamcloud - gitweb
LU-2675 lustre: remove lustre/include/linux/ 71/13271/2
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 6 Jan 2015 15:38:23 +0000 (09:38 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 10 Jan 2015 04:40:54 +0000 (04:40 +0000)
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 <john.hammond@intel.com>
Change-Id: I217d3c9b2369b469f95f916becafbfe674fed3ef
Reviewed-on: http://review.whamcloud.com/13271
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
13 files changed:
lustre.spec.in
lustre/include/Makefile.am
lustre/include/linux/.gitignore [deleted file]
lustre/include/linux/Makefile.am [deleted file]
lustre/include/linux/lustre_user.h [deleted file]
lustre/include/linux/lvfs.h [deleted file]
lustre/include/lustre/lustre_user.h
lustre/include/lustre_compat.h [moved from lustre/include/linux/lustre_compat25.h with 98% similarity]
lustre/include/lustre_patchless_compat.h [moved from lustre/include/linux/lustre_patchless_compat.h with 100% similarity]
lustre/include/lvfs.h
lustre/llite/llite_mmap.c
lustre/llite/rw.c
lustre/llite/rw26.c

index a3a8e50..625d858 100644 (file)
@@ -493,7 +493,6 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
 %{_mandir}/man?/*
 %{_includedir}/lustre
 %{_includedir}/libcfs
 %{_mandir}/man?/*
 %{_includedir}/lustre
 %{_includedir}/libcfs
-%{_includedir}/linux/lustre_user.h
 %endif
 %{_datadir}/lustre
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
 %endif
 %{_datadir}/lustre
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
index 86d0f78..25adaa8 100644 (file)
@@ -36,9 +36,9 @@
 # Lustre is a trademark of Sun Microsystems, Inc.
 #
 
 # 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 \
 
 EXTRA_DIST = \
        cl_object.h \
@@ -51,6 +51,7 @@ EXTRA_DIST = \
        lustre_acl.h \
        lustre_capa.h \
        lustre_cfg.h \
        lustre_acl.h \
        lustre_capa.h \
        lustre_cfg.h \
+       lustre_compat.h \
        lustre_debug.h \
        lustre_disk.h \
        lustre_dlm_flags.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_nodemap.h \
        lustre_nrs_tbf.h \
        lustre_param.h \
+       lustre_patchless_compat.h \
        lustre_quota.h \
        lustre_req_layout.h \
        lustre_sec.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 (file)
index 50facfb..0000000
+++ /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 (file)
index d2856db..0000000
+++ /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 (file)
index 83b5666..0000000
+++ /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 <sys/quota.h>
-#else
-# include <linux/version.h>
-# include <linux/quota.h>
-#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 <linux/string.h>
-#else
-#include <string.h>
-#include <sys/stat.h>
-#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 (file)
index b621fd0..0000000
+++ /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 <lvfs.h> instead
-#endif
-
-#include <linux/lustre_compat25.h>
-#include <linux/fs.h>
-
-#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
index d49c8c9..fb4cb9b 100644 (file)
 #include <libcfs/types.h>
 
 #ifdef __KERNEL__
 #include <libcfs/types.h>
 
 #ifdef __KERNEL__
+# include <linux/quota.h>
 # include <linux/string.h> /* snprintf() */
 # include <linux/string.h> /* snprintf() */
-#else
+# include <linux/version.h>
+#else /* !__KERNEL__ */
+# define NEED_QUOTA_DEFS
 # include <stdio.h> /* snprintf() */
 # include <stdio.h> /* snprintf() */
-#endif
+# include <string.h>
+# include <sys/quota.h>
+# include <sys/stat.h>
+#endif /* __KERNEL__ */
 #include <lustre/ll_fiemap.h>
 #include <lustre/ll_fiemap.h>
-#include <linux/lustre_user.h>
+
+#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
 
 
 #define LUSTRE_EOF 0xffffffffffffffffULL
 
similarity index 98%
rename from lustre/include/linux/lustre_compat25.h
rename to lustre/include/lustre_compat.h
index ce4ae16..9918a7a 100644 (file)
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
  * 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 <linux/fs_struct.h>
 #include <linux/namei.h>
 
 
 #include <linux/fs_struct.h>
 #include <linux/namei.h>
 
-#include <linux/lustre_patchless_compat.h>
+#include <lustre_patchless_compat.h>
 
 #ifdef HAVE_FS_STRUCT_RWLOCK
 # define LOCK_FS_STRUCT(fs)    write_lock(&(fs)->lock)
 
 #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
 
 #define SIZE_MAX       (~(size_t)0)
 #endif
 
-#endif /* _COMPAT25_H */
+#endif /* _LUSTRE_COMPAT_H */
index 41a7c14..be4187f 100644 (file)
 #ifndef __LVFS_H__
 #define __LVFS_H__
 
 #ifndef __LVFS_H__
 #define __LVFS_H__
 
-#include <libcfs/libcfs.h>
+#include <linux/dcache.h>
+#include <linux/err.h>
+#include <linux/fs.h>
+#include <linux/mutex.h>
+#include <linux/namei.h>
+#include <lustre_compat.h>
 
 
-#include <linux/lvfs.h>
+#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);
 
 
 /* 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
 #endif
index d72665b..7ead998 100644 (file)
@@ -52,7 +52,7 @@
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include "llite_internal.h"
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include "llite_internal.h"
-#include <linux/lustre_compat25.h>
+#include <lustre_compat.h>
 
 static const struct vm_operations_struct ll_file_vm_ops;
 
 
 static const struct vm_operations_struct ll_file_vm_ops;
 
index 70953fc..4e032fb 100644 (file)
@@ -59,7 +59,7 @@
 
 #include <obd_cksum.h>
 #include "llite_internal.h"
 
 #include <obd_cksum.h>
 #include "llite_internal.h"
-#include <linux/lustre_compat25.h>
+#include <lustre_compat.h>
 
 struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
 {
 
 struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
 {
index b218f5e..40b68ca 100644 (file)
@@ -63,7 +63,7 @@
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include "llite_internal.h"
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include "llite_internal.h"
-#include <linux/lustre_compat25.h>
+#include <lustre_compat.h>
 
 /**
  * Implements Linux VM address_space::invalidatepage() method. This method is
 
 /**
  * Implements Linux VM address_space::invalidatepage() method. This method is