1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (c) 2002, 2003 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
9 #define DEBUG_SUBSYSTEM S_LNET
10 #ifndef AUTOCONF_INCLUDED
11 #include <linux/config.h>
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <libcfs/libcfs.h>
17 #if defined(CONFIG_KGDB)
21 void cfs_enter_debugger(void)
23 #if defined(CONFIG_KGDB)
25 #elif defined(__arch_um__)
32 void cfs_daemonize(char *str) {
36 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,63))
42 snprintf (current->comm, sizeof (current->comm), "%s", str);
44 SIGNAL_MASK_LOCK(current, flags);
45 sigfillset(¤t->blocked);
47 SIGNAL_MASK_UNLOCK(current, flags);
51 int cfs_daemonize_ctxt(char *str) {
52 struct task_struct *tsk = current;
53 struct fs_struct *fs = NULL;
56 fs = copy_fs_struct(tsk->fs);
66 cfs_get_blockedsigs(void)
71 SIGNAL_MASK_LOCK(current, flags);
72 old = current->blocked;
73 SIGNAL_MASK_UNLOCK(current, flags);
78 cfs_block_allsigs(void)
83 SIGNAL_MASK_LOCK(current, flags);
84 old = current->blocked;
85 sigfillset(¤t->blocked);
87 SIGNAL_MASK_UNLOCK(current, flags);
93 cfs_block_sigs(sigset_t bits)
98 SIGNAL_MASK_LOCK(current, flags);
99 old = current->blocked;
100 current->blocked = bits;
102 SIGNAL_MASK_UNLOCK(current, flags);
107 cfs_restore_sigs (cfs_sigset_t old)
111 SIGNAL_MASK_LOCK(current, flags);
112 current->blocked = old;
114 SIGNAL_MASK_UNLOCK(current, flags);
118 cfs_signal_pending(void)
120 return signal_pending(current);
124 cfs_clear_sigpending(void)
128 SIGNAL_MASK_LOCK(current, flags);
130 SIGNAL_MASK_UNLOCK(current, flags);
134 libcfs_arch_init(void)
140 libcfs_arch_cleanup(void)
145 EXPORT_SYMBOL(libcfs_arch_init);
146 EXPORT_SYMBOL(libcfs_arch_cleanup);
147 EXPORT_SYMBOL(cfs_daemonize);
148 EXPORT_SYMBOL(cfs_daemonize_ctxt);
149 EXPORT_SYMBOL(cfs_block_allsigs);
150 EXPORT_SYMBOL(cfs_block_sigs);
151 EXPORT_SYMBOL(cfs_get_blockedsigs);
152 EXPORT_SYMBOL(cfs_restore_sigs);
153 EXPORT_SYMBOL(cfs_signal_pending);
154 EXPORT_SYMBOL(cfs_clear_sigpending);