summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/include/interval_tree.h
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2017-01-28 19:05:04 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-03 13:01:38 +0100
commit8e7a7362c3cbb67b867a39548f6b6e2eac58c01c (patch)
tree565e208fdcc51880eecb7805b2651ddd3e1ce07f /drivers/staging/lustre/lustre/include/interval_tree.h
parent098b325b8fc3bb1e000cadbae538e20cd1ee1fa7 (diff)
downloadop-kernel-dev-8e7a7362c3cbb67b867a39548f6b6e2eac58c01c.zip
op-kernel-dev-8e7a7362c3cbb67b867a39548f6b6e2eac58c01c.tar.gz
staging: lustre: header: remove assert from interval_set()
In the case of interval_tree.h only interval_set() uses LASSERT which is removed in this patch and interval_set() instead reports a real error. The header libcfs.h for interval_tree.h is not needed anymore so we can just use the standard linux kernel headers instead.h Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22522 Reviewed-on: https://review.whamcloud.com/24323 Reviewed-by: Frank Zago <fzago@cray.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/include/interval_tree.h')
-rw-r--r--drivers/staging/lustre/lustre/include/interval_tree.h12
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 5d387d3..0d4f92e 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;
}
/*
OpenPOWER on IntegriCloud