* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
(void)link;
}
+void cfs_waitq_add_exclusive_head(struct cfs_waitq *waitq, struct cfs_waitlink *link)
+{
+ cfs_waitq_add_exclusive(waitq, link);
+}
+
void cfs_waitq_del(struct cfs_waitq *waitq, struct cfs_waitlink *link)
{
LASSERT(waitq != NULL);
{
LASSERT(link != NULL);
(void)link;
+
+ /* well, wait for something to happen */
+ cfs_call_wait_handler(0);
}
int64_t cfs_waitq_timedwait(struct cfs_waitlink *link, cfs_task_state_t state,
{
LASSERT(link != NULL);
(void)link;
+ cfs_call_wait_handler(timeout);
return 0;
}
-void cfs_schedule_timeout(cfs_task_state_t state, int64_t timeout)
+void cfs_schedule_timeout_and_set_state(cfs_task_state_t state, int64_t timeout)
{
cfs_waitlink_t l;
/* sleep(timeout) here instead? */
(void)f(arg);
return NULL;
}
-int cfs_create_thread(cfs_thread_t func, void *arg)
+
+int cfs_create_thread(cfs_thread_t func, void *arg, unsigned long flags)
{
pthread_t tid;
pthread_attr_t tattr;
return getuid();
}
+gid_t cfs_curproc_gid(void)
+{
+ return getgid();
+}
+
+uid_t cfs_curproc_fsuid(void)
+{
+ return getuid();
+}
+
+gid_t cfs_curproc_fsgid(void)
+{
+ return getgid();
+}
+
void cfs_enter_debugger(void)
{
/*
return old;
}
+/* Block all signals except for the @sigs. It's only used in
+ * Linux kernel, just a dummy here. */
+cfs_sigset_t cfs_block_sigsinv(unsigned long sigs)
+{
+ cfs_sigset_t old;
+ int rc;
+
+ /* Return old blocked sigs */
+ rc = sigprocmask(SIG_SETMASK, NULL, &old);
+ LASSERT(rc == 0);
+
+ return old;
+}
+
void cfs_restore_sigs(cfs_sigset_t old)
{
int rc = sigprocmask(SIG_SETMASK, &old, NULL);