diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/include/interval_tree.h')
-rw-r--r-- | drivers/staging/lustre/lustre/include/interval_tree.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lustre/include/interval_tree.h b/drivers/staging/lustre/lustre/include/interval_tree.h index 5d387d372547..0d4f92ec8334 100644 --- a/drivers/staging/lustre/lustre/include/interval_tree.h +++ b/drivers/staging/lustre/lustre/include/interval_tree.h @@ -36,7 +36,9 @@ #ifndef _INTERVAL_H__ #define _INTERVAL_H__ -#include "../../include/linux/libcfs/libcfs.h" /* LASSERT. */ +#include <linux/errno.h> +#include <linux/string.h> +#include <linux/types.h> struct interval_node { struct interval_node *in_left; @@ -73,13 +75,15 @@ static inline __u64 interval_high(struct interval_node *node) return node->in_extent.end; } -static inline void interval_set(struct interval_node *node, - __u64 start, __u64 end) +static inline int interval_set(struct interval_node *node, + __u64 start, __u64 end) { - LASSERT(start <= end); + if (start > end) + return -ERANGE; node->in_extent.start = start; node->in_extent.end = end; node->in_max_high = end; + return 0; } /* |