From d992b088539980caed0680dab0a346b82f8b260a Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Mon, 18 Aug 2014 12:06:57 -0500 Subject: [PATCH] LU-2675 lustre: remove linux/lustre_handles.h Remove the cfs_rcu_head_t typedef and remove lustre/include/linux/lustre_handles.h. Signed-off-by: John L. Hammond Change-Id: I75a9d455ae68de6173b3c47b9e10a6a6eda65989 Reviewed-on: http://review.whamcloud.com/11498 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Bob Glossman --- lustre/include/linux/Makefile.am | 2 +- lustre/include/linux/lustre_handles.h | 53 ----------------------------------- lustre/include/lustre_handles.h | 10 +++---- lustre/obdclass/lustre_handles.c | 9 ++++-- 4 files changed, 11 insertions(+), 63 deletions(-) delete mode 100644 lustre/include/linux/lustre_handles.h diff --git a/lustre/include/linux/Makefile.am b/lustre/include/linux/Makefile.am index 19197ae..d646b21 100644 --- a/lustre/include/linux/Makefile.am +++ b/lustre/include/linux/Makefile.am @@ -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 index ecf1840..0000000 --- a/lustre/include/linux/lustre_handles.h +++ /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 instead -#endif - -#include -#include -#include -#include -#include -#include - -#include /* for rcu_head{} */ -typedef struct rcu_head cfs_rcu_head_t; - - -#endif diff --git a/lustre/include/lustre_handles.h b/lustre/include/lustre_handles.h index a3c16f6..c46bd79 100644 --- a/lustre/include/lustre_handles.h +++ b/lustre/include/lustre_handles.h @@ -42,11 +42,10 @@ * @{ */ -#include - +#include +#include #include - 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); diff --git a/lustre/obdclass/lustre_handles.c b/lustre/obdclass/lustre_handles.c index 0827178..8327a6c 100644 --- a/lustre/obdclass/lustre_handles.c +++ b/lustre/obdclass/lustre_handles.c @@ -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); -- 1.8.3.1