Whamcloud - gitweb
LU-2675 lustre: remove linux/lustre_handles.h 98/11498/2
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 18 Aug 2014 17:06:57 +0000 (12:06 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 6 Sep 2014 15:25:19 +0000 (15:25 +0000)
Remove the cfs_rcu_head_t typedef and remove
lustre/include/linux/lustre_handles.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I75a9d455ae68de6173b3c47b9e10a6a6eda65989
Reviewed-on: http://review.whamcloud.com/11498
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
lustre/include/linux/Makefile.am
lustre/include/linux/lustre_handles.h [deleted file]
lustre/include/lustre_handles.h
lustre/obdclass/lustre_handles.c

index 19197ae..d646b21 100644 (file)
@@ -43,6 +43,6 @@ linux_HEADERS = lustre_user.h
 endif
 
 EXTRA_DIST = lustre_lib.h \
-       lustre_handles.h lustre_net.h obd_class.h obd_support.h \
+       lustre_net.h obd_class.h obd_support.h \
        obd.h lvfs.h lustre_log.h lustre_compat25.h lustre_lite.h lustre_quota.h \
        lustre_user.h lustre_patchless_compat.h lustre_intent.h
diff --git a/lustre/include/linux/lustre_handles.h b/lustre/include/linux/lustre_handles.h
deleted file mode 100644 (file)
index ecf1840..0000000
+++ /dev/null
@@ -1,53 +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.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LINUX_LUSTRE_HANDLES_H_
-#define __LINUX_LUSTRE_HANDLES_H_
-
-#ifndef __LUSTRE_HANDLES_H_
-#error Do not #include this file directly. #include <lustre_handles.h> instead
-#endif
-
-#include <asm/types.h>
-#include <asm/atomic.h>
-#include <linux/list.h>
-#include <linux/version.h>
-#include <linux/spinlock.h>
-#include <linux/types.h>
-
-#include <linux/rcupdate.h> /* for rcu_head{} */
-typedef struct rcu_head cfs_rcu_head_t;
-
-
-#endif
index a3c16f6..c46bd79 100644 (file)
  * @{
  */
 
-#include <linux/lustre_handles.h>
-
+#include <linux/rcupdate.h>
+#include <linux/spinlock.h>
 #include <libcfs/libcfs.h>
 
-
 struct portals_handle_ops {
        void (*hop_addref)(void *object);
        void (*hop_free)(void *object, int size);
@@ -70,12 +69,11 @@ struct portals_handle {
        struct portals_handle_ops      *h_ops;
 
        /* newly added fields to handle the RCU issue. -jxiong */
-       cfs_rcu_head_t                  h_rcu;
+       struct rcu_head                 h_rcu;
        spinlock_t                      h_lock;
        unsigned int                    h_size:31;
        unsigned int                    h_in:1;
 };
-#define RCU2HANDLE(rcu)    container_of(rcu, struct portals_handle, h_rcu)
 
 /* handles.c */
 
@@ -85,7 +83,7 @@ void class_handle_hash(struct portals_handle *,
 void class_handle_unhash(struct portals_handle *);
 void class_handle_hash_back(struct portals_handle *);
 void *class_handle2object(__u64 cookie, const void *owner);
-void class_handle_free_cb(cfs_rcu_head_t *);
+void class_handle_free_cb(struct rcu_head *rcu);
 int class_handle_init(void);
 void class_handle_cleanup(void);
 
index 0827178..8327a6c 100644 (file)
@@ -184,10 +184,13 @@ void *class_handle2object(__u64 cookie, const void *owner)
 }
 EXPORT_SYMBOL(class_handle2object);
 
-void class_handle_free_cb(cfs_rcu_head_t *rcu)
+void class_handle_free_cb(struct rcu_head *rcu)
 {
-       struct portals_handle *h = RCU2HANDLE(rcu);
-       void *ptr = (void *)(unsigned long)h->h_cookie;
+       struct portals_handle *h;
+       void *ptr;
+
+       h = container_of(rcu, struct portals_handle, h_rcu);
+       ptr = (void *)(unsigned long)h->h_cookie;
 
        if (h->h_ops->hop_free != NULL)
                h->h_ops->hop_free(ptr, h->h_size);