1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
37 #define DEBUG_SUBSYSTEM S_LNET
38 #ifndef AUTOCONF_INCLUDED
39 #include <linux/config.h>
41 #include <linux/module.h>
42 #include <linux/kernel.h>
43 #include <libcfs/libcfs.h>
45 #if defined(CONFIG_KGDB)
49 void cfs_enter_debugger(void)
51 #if defined(CONFIG_KGDB)
53 #elif defined(__arch_um__)
60 void cfs_daemonize(char *str) {
65 SIGNAL_MASK_LOCK(current, flags);
66 sigfillset(¤t->blocked);
68 SIGNAL_MASK_UNLOCK(current, flags);
72 int cfs_daemonize_ctxt(char *str) {
73 struct task_struct *tsk = current;
74 struct fs_struct *fs = NULL;
77 fs = copy_fs_struct(tsk->fs);
87 cfs_get_blockedsigs(void)
92 SIGNAL_MASK_LOCK(current, flags);
93 old = current->blocked;
94 SIGNAL_MASK_UNLOCK(current, flags);
99 cfs_block_allsigs(void)
104 SIGNAL_MASK_LOCK(current, flags);
105 old = current->blocked;
106 sigfillset(¤t->blocked);
108 SIGNAL_MASK_UNLOCK(current, flags);
114 cfs_block_sigs(sigset_t bits)
119 SIGNAL_MASK_LOCK(current, flags);
120 old = current->blocked;
121 current->blocked = bits;
123 SIGNAL_MASK_UNLOCK(current, flags);
128 cfs_restore_sigs (cfs_sigset_t old)
132 SIGNAL_MASK_LOCK(current, flags);
133 current->blocked = old;
135 SIGNAL_MASK_UNLOCK(current, flags);
139 cfs_signal_pending(void)
141 return signal_pending(current);
145 cfs_clear_sigpending(void)
149 SIGNAL_MASK_LOCK(current, flags);
151 SIGNAL_MASK_UNLOCK(current, flags);
155 libcfs_arch_init(void)
161 libcfs_arch_cleanup(void)
166 EXPORT_SYMBOL(libcfs_arch_init);
167 EXPORT_SYMBOL(libcfs_arch_cleanup);
168 EXPORT_SYMBOL(cfs_daemonize);
169 EXPORT_SYMBOL(cfs_daemonize_ctxt);
170 EXPORT_SYMBOL(cfs_block_allsigs);
171 EXPORT_SYMBOL(cfs_block_sigs);
172 EXPORT_SYMBOL(cfs_get_blockedsigs);
173 EXPORT_SYMBOL(cfs_restore_sigs);
174 EXPORT_SYMBOL(cfs_signal_pending);
175 EXPORT_SYMBOL(cfs_clear_sigpending);