*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define DEBUG_SUBSYSTEM S_FLD
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-# include <linux/math64.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-# include <libcfs/list.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
+#include <linux/math64.h>
#include <obd_support.h>
#include <lustre_fld.h>
#include "fld_internal.h"
}
CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name);
- CDEBUG(D_INFO, " Total reqs: "LPU64"\n", cache->fci_stat.fst_count);
- CDEBUG(D_INFO, " Cache reqs: "LPU64"\n", cache->fci_stat.fst_cache);
- CDEBUG(D_INFO, " Cache hits: "LPU64"%%\n", pct);
+ CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count);
+ CDEBUG(D_INFO, " Cache reqs: %llu\n", cache->fci_stat.fst_cache);
+ CDEBUG(D_INFO, " Cache hits: %llu%%\n", pct);
OBD_FREE_PTR(cache);
restart_fixup:
list_for_each_entry_safe(f_curr, f_next, head, fce_list) {
- c_range = &f_curr->fce_range;
- n_range = &f_next->fce_range;
+ c_range = &f_curr->fce_range;
+ n_range = &f_next->fce_range;
- LASSERT(range_is_sane(c_range));
- if (&f_next->fce_list == head)
- break;
+ LASSERT(lu_seq_range_is_sane(c_range));
+ if (&f_next->fce_list == head)
+ break;
if (c_range->lsr_flags != n_range->lsr_flags)
continue;
struct fld_cache_entry *f_new)
{
const struct lu_seq_range *range = &f_new->fce_range;
- const seqno_t new_start = range->lsr_start;
- const seqno_t new_end = range->lsr_end;
+ const u64 new_start = range->lsr_start;
+ const u64 new_end = range->lsr_end;
struct fld_cache_entry *fldt;
ENTRY;
struct fld_cache_entry *f_curr,
struct fld_cache_entry *f_new)
{
- const struct lu_seq_range *range = &f_new->fce_range;
- const seqno_t new_start = range->lsr_start;
- const seqno_t new_end = range->lsr_end;
- const mdsno_t mdt = range->lsr_index;
+ const struct lu_seq_range *range = &f_new->fce_range;
+ const u64 new_start = range->lsr_start;
+ const u64 new_end = range->lsr_end;
+ const u32 mdt = range->lsr_index;
/* this is overlap case, these case are checking overlapping with
* prev range only. fixup will handle overlaping with next range. */
{
struct fld_cache_entry *f_new;
- LASSERT(range_is_sane(range));
+ LASSERT(lu_seq_range_is_sane(range));
OBD_ALLOC_PTR(f_new);
if (!f_new)
struct fld_cache_entry *n;
struct list_head *head;
struct list_head *prev = NULL;
- const seqno_t new_start = f_new->fce_range.lsr_start;
- const seqno_t new_end = f_new->fce_range.lsr_end;
+ const u64 new_start = f_new->fce_range.lsr_start;
+ const u64 new_end = f_new->fce_range.lsr_end;
__u32 new_flags = f_new->fce_range.lsr_flags;
ENTRY;
* lookup \a seq sequence for range in fld cache.
*/
int fld_cache_lookup(struct fld_cache *cache,
- const seqno_t seq, struct lu_seq_range *range)
+ const u64 seq, struct lu_seq_range *range)
{
struct fld_cache_entry *flde;
struct fld_cache_entry *prev = NULL;
}
prev = flde;
- if (range_within(&flde->fce_range, seq)) {
- *range = flde->fce_range;
+ if (lu_seq_range_within(&flde->fce_range, seq)) {
+ *range = flde->fce_range;
- cache->fci_stat.fst_cache++;
+ cache->fci_stat.fst_cache++;
read_unlock(&cache->fci_lock);
RETURN(0);
}