X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Flu_ref.c;h=73f8cc5ff076167602be792ec75662bbee63f319;hb=2d617260aaa5f778ab8dcb006e2a827f4b8f8567;hp=fdaac5fddca42d29085ebce958a7e7522fae2c3c;hpb=a6527b28ba2082a445fbf584909a7791ce407ef3;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/lu_ref.c b/lustre/obdclass/lu_ref.c index fdaac5f..73f8cc5 100644 --- a/lustre/obdclass/lu_ref.c +++ b/lustre/obdclass/lu_ref.c @@ -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. @@ -41,9 +39,6 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #ifdef __KERNEL__ # include @@ -62,18 +57,17 @@ * Asserts a condition for a given lu_ref. Must be called with * lu_ref::lf_guard held. */ -#define REFASSERT(ref, expr) \ - do { \ - struct lu_ref *__ref = (ref); \ - \ - if (unlikely(!(expr))) { \ - lu_ref_print(__ref); \ - cfs_spin_unlock(&__ref->lf_guard); \ - lu_ref_print_all(); \ - LASSERT(0); \ - cfs_spin_lock(&__ref->lf_guard); \ - } \ - } while (0) +#define REFASSERT(ref, expr) do { \ + struct lu_ref *__tmp = (ref); \ + \ + if (unlikely(!(expr))) { \ + lu_ref_print(__tmp); \ + cfs_spin_unlock(&__tmp->lf_guard); \ + lu_ref_print_all(); \ + LASSERT(0); \ + cfs_spin_lock(&__tmp->lf_guard); \ + } \ +} while (0) struct lu_ref_link { struct lu_ref *ll_ref; @@ -103,7 +97,7 @@ static struct lu_kmem_descr lu_ref_caches[] = { static CFS_LIST_HEAD(lu_ref_refs); static cfs_spinlock_t lu_ref_refs_guard; static struct lu_ref lu_ref_marker = { - .lf_guard = CFS_SPIN_LOCK_UNLOCKED, + .lf_guard = DEFINE_SPINLOCK(lu_ref_marker.lf_guard), .lf_list = CFS_LIST_HEAD_INIT(lu_ref_marker.lf_list), .lf_linkage = CFS_LIST_HEAD_INIT(lu_ref_marker.lf_linkage) }; @@ -239,7 +233,7 @@ static struct lu_ref_link *lu_ref_find(struct lu_ref *ref, const char *scope, ++iterations; if (lu_ref_link_eq(link, scope, source)) { if (iterations > lu_ref_chain_max_length) { - CWARN("Long lu_ref chain %i \"%s\":%p\n", + CWARN("Long lu_ref chain %d \"%s\":%p\n", iterations, scope, source); lu_ref_chain_max_length = iterations * 3 / 2; }