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 <linux/fs_struct.h>
44 #include <libcfs/libcfs.h>
46 #if defined(CONFIG_KGDB)
50 void cfs_enter_debugger(void)
52 #if defined(CONFIG_KGDB)
54 #elif defined(__arch_um__)
61 void cfs_daemonize(char *str) {
66 SIGNAL_MASK_LOCK(current, flags);
67 sigfillset(¤t->blocked);
69 SIGNAL_MASK_UNLOCK(current, flags);
73 int cfs_daemonize_ctxt(char *str) {
76 #ifndef HAVE_UNSHARE_FS_STRUCT
78 struct task_struct *tsk = current;
79 struct fs_struct *fs = NULL;
80 fs = copy_fs_struct(tsk->fs);
93 cfs_get_blockedsigs(void)
98 SIGNAL_MASK_LOCK(current, flags);
99 old = current->blocked;
100 SIGNAL_MASK_UNLOCK(current, flags);
105 cfs_block_allsigs(void)
110 SIGNAL_MASK_LOCK(current, flags);
111 old = current->blocked;
112 sigfillset(¤t->blocked);
114 SIGNAL_MASK_UNLOCK(current, flags);
120 cfs_block_sigs(sigset_t bits)
125 SIGNAL_MASK_LOCK(current, flags);
126 old = current->blocked;
127 current->blocked = bits;
129 SIGNAL_MASK_UNLOCK(current, flags);
134 cfs_restore_sigs (cfs_sigset_t old)
138 SIGNAL_MASK_LOCK(current, flags);
139 current->blocked = old;
141 SIGNAL_MASK_UNLOCK(current, flags);
145 cfs_signal_pending(void)
147 return signal_pending(current);
151 cfs_clear_sigpending(void)
155 SIGNAL_MASK_LOCK(current, flags);
157 SIGNAL_MASK_UNLOCK(current, flags);
161 libcfs_arch_init(void)
167 libcfs_arch_cleanup(void)
172 EXPORT_SYMBOL(libcfs_arch_init);
173 EXPORT_SYMBOL(libcfs_arch_cleanup);
174 EXPORT_SYMBOL(cfs_daemonize);
175 EXPORT_SYMBOL(cfs_daemonize_ctxt);
176 EXPORT_SYMBOL(cfs_block_allsigs);
177 EXPORT_SYMBOL(cfs_block_sigs);
178 EXPORT_SYMBOL(cfs_get_blockedsigs);
179 EXPORT_SYMBOL(cfs_restore_sigs);
180 EXPORT_SYMBOL(cfs_signal_pending);
181 EXPORT_SYMBOL(cfs_clear_sigpending);