From 6de9710b24417b857c74fefc44f86e8f236fdb3a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 11 Jul 2014 23:28:12 -0700 Subject: [PATCH] staging: lustre: delete linux-lock.h It was a few empty defines, so just remove the thing. Cc: Andreas Dilger Cc: Oleg Drokin Cc: hpdd-discuss Signed-off-by: Greg Kroah-Hartman --- .../include/linux/libcfs/linux/libcfs.h | 2 +- .../include/linux/libcfs/linux/linux-lock.h | 196 ------------------ drivers/staging/lustre/lnet/lnet/acceptor.c | 8 +- .../lustre/libcfs/linux/linux-tracefile.c | 2 - drivers/staging/lustre/lustre/libcfs/module.c | 3 - 5 files changed, 2 insertions(+), 209 deletions(-) delete mode 100644 drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h index d647389e3ed9..fce30efad859 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h @@ -43,12 +43,12 @@ #include +#include #include #include "linux-cpu.h" #include "linux-time.h" #include "linux-mem.h" #include "linux-prim.h" -#include "linux-lock.h" #include "linux-tcpip.h" #include "linux-types.h" #include "kp30.h" diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h deleted file mode 100644 index 7581a14e884f..000000000000 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h +++ /dev/null @@ -1,196 +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) 2008, 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. - * - * libcfs/include/libcfs/linux/linux-lock.h - * - * Basic library routines. - */ - -#ifndef __LIBCFS_LINUX_CFS_LOCK_H__ -#define __LIBCFS_LINUX_CFS_LOCK_H__ - -#ifndef __LIBCFS_LIBCFS_H__ -#error Do not #include this file directly. #include instead -#endif - -#include - -/* - * IMPORTANT !!!!!!!! - * - * All locks' declaration are not guaranteed to be initialized, - * although some of them are initialized in Linux. All locks - * declared by CFS_DECL_* should be initialized explicitly. - */ - -/* - * spin_lock "implementation" (use Linux kernel's primitives) - * - * - spin_lock_init(x) - * - spin_lock(x) - * - spin_lock_bh(x) - * - spin_lock_bh_init(x) - * - spin_unlock(x) - * - spin_unlock_bh(x) - * - spin_trylock(x) - * - assert_spin_locked(x) - * - * - spin_lock_irq(x) - * - spin_lock_irqsave(x, f) - * - spin_unlock_irqrestore(x, f) - * - read_lock_irqsave(lock, f) - * - write_lock_irqsave(lock, f) - * - write_unlock_irqrestore(lock, f) - */ - -/* - * spinlock "implementation" - */ - - -/* - * rw_semaphore "implementation" (use Linux kernel's primitives) - * - * - sema_init(x) - * - init_rwsem(x) - * - down_read(x) - * - up_read(x) - * - down_write(x) - * - up_write(x) - */ - -#define fini_rwsem(s) do {} while (0) - -/* - * rwlock_t "implementation" (use Linux kernel's primitives) - * - * - rwlock_init(x) - * - read_lock(x) - * - read_unlock(x) - * - write_lock(x) - * - write_unlock(x) - * - write_lock_bh(x) - * - write_unlock_bh(x) - * - * - RW_LOCK_UNLOCKED - */ - -#ifndef DEFINE_RWLOCK -#define DEFINE_RWLOCK(lock) rwlock_t lock = __RW_LOCK_UNLOCKED(lock) -#endif - -/* - * completion "implementation" (use Linux kernel's primitives) - * - * - DECLARE_COMPLETION(work) - * - INIT_COMPLETION(c) - * - COMPLETION_INITIALIZER(work) - * - init_completion(c) - * - complete(c) - * - wait_for_completion(c) - * - wait_for_completion_interruptible(c) - * - fini_completion(c) - */ -#define fini_completion(c) do { } while (0) - -/* - * semaphore "implementation" (use Linux kernel's primitives) - * - DEFINE_SEMAPHORE(name) - * - sema_init(sem, val) - * - up(sem) - * - down(sem) - * - down_interruptible(sem) - * - down_trylock(sem) - */ - -/* - * mutex "implementation" (use Linux kernel's primitives) - * - * - DEFINE_MUTEX(name) - * - mutex_init(x) - * - mutex_lock(x) - * - mutex_unlock(x) - * - mutex_trylock(x) - * - mutex_is_locked(x) - * - mutex_destroy(x) - */ - -#ifndef lockdep_set_class - -/************************************************************************** - * - * Lockdep "implementation". Also see liblustre.h - * - **************************************************************************/ - -struct lock_class_key { - ; -}; - -#define lockdep_set_class(lock, key) \ - do { (void)sizeof(lock); (void)sizeof(key); } while (0) -/* This has to be a macro, so that `subclass' can be undefined in kernels - * that do not support lockdep. */ - -static inline void lockdep_off(void) -{ -} - -static inline void lockdep_on(void) -{ -} -#else - -#endif /* lockdep_set_class */ - -#ifndef CONFIG_DEBUG_LOCK_ALLOC -#ifndef mutex_lock_nested -#define mutex_lock_nested(mutex, subclass) mutex_lock(mutex) -#endif - -#ifndef spin_lock_nested -#define spin_lock_nested(lock, subclass) spin_lock(lock) -#endif - -#ifndef down_read_nested -#define down_read_nested(lock, subclass) down_read(lock) -#endif - -#ifndef down_write_nested -#define down_write_nested(lock, subclass) down_write(lock) -#endif -#endif /* CONFIG_DEBUG_LOCK_ALLOC */ - -#endif /* __LIBCFS_LINUX_CFS_LOCK_H__ */ diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 66e6b2b18c22..640daa173b02 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -457,10 +457,8 @@ lnet_acceptor_start(void) init_completion(&lnet_acceptor_state.pta_signal); rc = accept2secure(accept_type, &secure); - if (rc <= 0) { - fini_completion(&lnet_acceptor_state.pta_signal); + if (rc <= 0) return rc; - } if (lnet_count_acceptor_nis() == 0) /* not required */ return 0; @@ -470,7 +468,6 @@ lnet_acceptor_start(void) "acceptor_%03ld", secure)); if (IS_ERR_VALUE(rc2)) { CERROR("Can't start acceptor thread: %ld\n", rc2); - fini_completion(&lnet_acceptor_state.pta_signal); return -ESRCH; } @@ -485,7 +482,6 @@ lnet_acceptor_start(void) } LASSERT(lnet_acceptor_state.pta_sock == NULL); - fini_completion(&lnet_acceptor_state.pta_signal); return -ENETDOWN; } @@ -501,6 +497,4 @@ lnet_acceptor_stop(void) /* block until acceptor signals exit */ wait_for_completion(&lnet_acceptor_state.pta_signal); - - fini_completion(&lnet_acceptor_state.pta_signal); } diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c index bc38b99d8ca2..976c61ed49f4 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c @@ -112,8 +112,6 @@ void cfs_tracefile_fini_arch(void) kfree(cfs_trace_data[i]); cfs_trace_data[i] = NULL; } - - fini_rwsem(&cfs_tracefile_sem); } void cfs_tracefile_read_lock(void) diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index d138368e632d..3396858098b0 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -439,9 +439,6 @@ static void exit_libcfs_module(void) printk(KERN_ERR "LustreError: libcfs_debug_cleanup: %d\n", rc); - fini_rwsem(&ioctl_list_sem); - fini_rwsem(&cfs_tracefile_sem); - libcfs_arch_cleanup(); } -- 2.34.1