Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2446 build: Update Whamcloud copyright messages for Intel
[fs/lustre-release.git]
/
libcfs
/
include
/
libcfs
/
libcfs.h
diff --git
a/libcfs/include/libcfs/libcfs.h
b/libcfs/include/libcfs/libcfs.h
index
d888670
..
2375ed9
100644
(file)
--- a/
libcfs/include/libcfs/libcfs.h
+++ b/
libcfs/include/libcfs/libcfs.h
@@
-1,6
+1,4
@@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@
-26,8
+24,10
@@
* GPL HEADER END
*/
/*
* 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.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-63,6
+63,10
@@
#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
#endif
#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
#endif
+#if !defined(swap)
+#define swap(x,y) do { typeof(x) z = x; x = y; y = z; } while (0)
+#endif
+
#if !defined(container_of)
/* given a pointer @ptr to the field @member embedded into type (usually
* struct) @type, return pointer to the embedding instance of @type. */
#if !defined(container_of)
/* given a pointer @ptr to the field @member embedded into type (usually
* struct) @type, return pointer to the embedding instance of @type. */
@@
-103,6
+107,10
@@
static inline int __is_po2(unsigned long long val)
#include <libcfs/list.h>
#include <libcfs/list.h>
+#ifndef cfs_for_each_possible_cpu
+# error cfs_for_each_possible_cpu is not supported by kernel!
+#endif
+
/* libcfs tcpip */
int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int libcfs_ipif_enumerate(char ***names);
/* libcfs tcpip */
int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int libcfs_ipif_enumerate(char ***names);
@@
-130,8
+138,10
@@
struct lc_watchdog *lc_watchdog_add(int time,
void *data);
/* Enables a watchdog and resets its timer. */
void *data);
/* Enables a watchdog and resets its timer. */
-void lc_watchdog_touch_ms(struct lc_watchdog *lcw, int timeout_ms);
-void lc_watchdog_touch(struct lc_watchdog *lcw);
+void lc_watchdog_touch(struct lc_watchdog *lcw, int timeout);
+#define CFS_GET_TIMEOUT(svc) (max_t(int, obd_timeout, \
+ AT_OFF ? 0 : at_get(&svc->srv_at_estimate)) * \
+ svc->srv_watchdog_factor)
/* Disable a watchdog; touch it to restart it. */
void lc_watchdog_disable(struct lc_watchdog *lcw);
/* Disable a watchdog; touch it to restart it. */
void lc_watchdog_disable(struct lc_watchdog *lcw);
@@
-194,14
+204,17
@@
enum cfs_alloc_flags {
/* standard allocator flag combination */
CFS_ALLOC_STD = CFS_ALLOC_FS | CFS_ALLOC_IO,
CFS_ALLOC_USER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO,
/* standard allocator flag combination */
CFS_ALLOC_STD = CFS_ALLOC_FS | CFS_ALLOC_IO,
CFS_ALLOC_USER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO,
+ CFS_ALLOC_NOFS = CFS_ALLOC_WAIT | CFS_ALLOC_IO,
+ CFS_ALLOC_KERNEL = CFS_ALLOC_WAIT | CFS_ALLOC_IO | CFS_ALLOC_FS,
};
/* flags for cfs_page_alloc() in addition to enum cfs_alloc_flags */
enum cfs_alloc_page_flags {
};
/* flags for cfs_page_alloc() in addition to enum cfs_alloc_flags */
enum cfs_alloc_page_flags {
- /* allow to return page beyond KVM. It has to be mapped into KVM by
- * cfs_page_map(); */
- CFS_ALLOC_HIGH = 0x40,
- CFS_ALLOC_HIGHUSER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO | CFS_ALLOC_HIGH,
+ /* allow to return page beyond KVM. It has to be mapped into KVM by
+ * cfs_kmap() and unmapped with cfs_kunmap(). */
+ CFS_ALLOC_HIGHMEM = 0x40,
+ CFS_ALLOC_HIGHUSER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO |
+ CFS_ALLOC_HIGHMEM,
};
/*
};
/*
@@
-217,10
+230,12
@@
void cfs_daemonize(char *str);
int cfs_daemonize_ctxt(char *str);
cfs_sigset_t cfs_get_blocked_sigs(void);
cfs_sigset_t cfs_block_allsigs(void);
int cfs_daemonize_ctxt(char *str);
cfs_sigset_t cfs_get_blocked_sigs(void);
cfs_sigset_t cfs_block_allsigs(void);
-cfs_sigset_t cfs_block_sigs(cfs_sigset_t bits);
+cfs_sigset_t cfs_block_sigs(unsigned long sigs);
+cfs_sigset_t cfs_block_sigsinv(unsigned long sigs);
void cfs_restore_sigs(cfs_sigset_t);
int cfs_signal_pending(void);
void cfs_clear_sigpending(void);
void cfs_restore_sigs(cfs_sigset_t);
int cfs_signal_pending(void);
void cfs_clear_sigpending(void);
+
/*
* XXX Liang:
* these macros should be removed in the future,
/*
* XXX Liang:
* these macros should be removed in the future,
@@
-254,10
+269,15
@@
void cfs_stack_trace_fill(struct cfs_stack_trace *trace);
*/
void *cfs_stack_trace_frame(struct cfs_stack_trace *trace, int frame_no);
*/
void *cfs_stack_trace_frame(struct cfs_stack_trace *trace, int frame_no);
+#ifndef O_NOACCESS
+#define O_NOACCESS O_NONBLOCK
+#endif
+
/*
* Universal open flags.
*/
/*
* Universal open flags.
*/
-#define CFS_O_ACCMODE 0003
+#define CFS_O_NOACCESS 0003
+#define CFS_O_ACCMODE CFS_O_NOACCESS
#define CFS_O_CREAT 0100
#define CFS_O_EXCL 0200
#define CFS_O_NOCTTY 0400
#define CFS_O_CREAT 0100
#define CFS_O_EXCL 0200
#define CFS_O_NOCTTY 0400
@@
-278,12
+298,30
@@
int cfs_oflags2univ(int flags);
/* convert universal open flags to local open flags */
int cfs_univ2oflags(int flags);
/* convert universal open flags to local open flags */
int cfs_univ2oflags(int flags);
+/*
+ * Random number handling
+ */
+
+/* returns a random 32-bit integer */
+unsigned int cfs_rand(void);
+/* seed the generator */
+void cfs_srand(unsigned int, unsigned int);
+void cfs_get_random_bytes(void *buf, int size);
+
#include <libcfs/libcfs_debug.h>
#include <libcfs/libcfs_debug.h>
+#include <libcfs/libcfs_cpu.h>
#include <libcfs/libcfs_private.h>
#include <libcfs/libcfs_ioctl.h>
#include <libcfs/libcfs_prim.h>
#include <libcfs/libcfs_time.h>
#include <libcfs/libcfs_string.h>
#include <libcfs/libcfs_private.h>
#include <libcfs/libcfs_ioctl.h>
#include <libcfs/libcfs_prim.h>
#include <libcfs/libcfs_time.h>
#include <libcfs/libcfs_string.h>
+#include <libcfs/libcfs_kernelcomm.h>
+#include <libcfs/libcfs_workitem.h>
+#include <libcfs/libcfs_hash.h>
+#include <libcfs/libcfs_heap.h>
+#include <libcfs/libcfs_fail.h>
+#include <libcfs/params_tree.h>
+#include <libcfs/libcfs_crypto.h>
/* container_of depends on "likely" which is defined in libcfs_private.h */
static inline void *__container_of(void *ptr, unsigned long shift)
/* container_of depends on "likely" which is defined in libcfs_private.h */
static inline void *__container_of(void *ptr, unsigned long shift)
@@
-297,6
+335,8
@@
static inline void *__container_of(void *ptr, unsigned long shift)
#define container_of0(ptr, type, member) \
((type *)__container_of((void *)(ptr), offsetof(type, member)))
#define container_of0(ptr, type, member) \
((type *)__container_of((void *)(ptr), offsetof(type, member)))
+#define SET_BUT_UNUSED(a) do { } while(sizeof(a) - sizeof(a))
+
#define _LIBCFS_H
#endif /* _LIBCFS_H */
#define _LIBCFS_H
#endif /* _LIBCFS_H */