mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Pull in timespec, list, and type compat changes to support
building against a wider range of kernels. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@152 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef _SPL_LIST_COMPAT_H
|
||||
#define _SPL_LIST_COMPAT_H
|
||||
|
||||
#include <linux/list.h>
|
||||
|
||||
#ifndef list_for_each_entry_safe_reverse
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_reverse
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate backwards over list of given type, safe against removal
|
||||
* of list entry.
|
||||
*/
|
||||
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
|
||||
for (pos = list_entry((head)->prev, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.prev, typeof(*n), member))
|
||||
|
||||
#endif /* list_for_each_entry_safe_reverse */
|
||||
|
||||
#endif /* SPL_LIST_COMPAT_H */
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _SPL_TIME_COMPAT_H
|
||||
#define _SPL_TIME_COMPAT_H
|
||||
|
||||
#include <linux/time.h>
|
||||
|
||||
/* timespec_sub() API changes
|
||||
* 2.6.18 - 2.6.x: Inline function provided by linux/time.h
|
||||
*/
|
||||
#ifndef HAVE_TIMESPEC_SUB
|
||||
static inline struct timespec
|
||||
timespec_sub(struct timespec lhs, struct timespec rhs)
|
||||
{
|
||||
struct timespec ts_delta;
|
||||
set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
|
||||
lhs.tv_nsec - rhs.tv_nsec);
|
||||
return ts_delta;
|
||||
}
|
||||
#endif /* HAVE_TIMESPEC_SUB */
|
||||
|
||||
#endif /* _SPL_TIME_COMPAT_H */
|
||||
|
||||
@@ -13,6 +13,14 @@ extern "C" {
|
||||
typedef unsigned long uintptr_t;
|
||||
#endif
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
#define ULLONG_MAX (~0ULL)
|
||||
#endif
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
#define LLONG_MAX ((long long)(~0ULL>>1))
|
||||
#endif
|
||||
|
||||
typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t;
|
||||
typedef unsigned long intptr_t;
|
||||
typedef unsigned long ulong_t;
|
||||
|
||||
Reference in New Issue
Block a user