X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fofd%2Fofd_fmd.c;h=f25ce935125d7fb34fd770a2d33edc24c863e22a;hb=e7d6dcdedc9c676c84e6bee3ed6cbf73d56ff791;hp=b23b7133e1d3b57ba3623a3a3e95c0271f8cda79;hpb=9fb46705ae86aa2c0ac29427f0ff24f923560eb7;p=fs%2Flustre-release.git diff --git a/lustre/ofd/ofd_fmd.c b/lustre/ofd/ofd_fmd.c index b23b713..f25ce93 100644 --- a/lustre/ofd/ofd_fmd.c +++ b/lustre/ofd/ofd_fmd.c @@ -27,7 +27,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Whamcloud, Inc. + * Copyright (c) 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -40,7 +40,7 @@ #include "ofd_internal.h" -static cfs_mem_cache_t *ll_fmd_cachep; +static struct kmem_cache *ll_fmd_cachep; /* drop fmd reference, free it if last ref. must be called with fed_lock held.*/ static inline void ofd_fmd_put_nolock(struct obd_export *exp, @@ -48,7 +48,7 @@ static inline void ofd_fmd_put_nolock(struct obd_export *exp, { struct filter_export_data *fed = &exp->exp_filter_data; - LASSERT_SPIN_LOCKED(&fed->fed_lock); + LASSERT(spin_is_locked(&fed->fed_lock)); if (--fmd->fmd_refcount == 0) { /* XXX when we have persistent reservations and the handle * is stored herein we need to drop it here. */ @@ -115,7 +115,7 @@ static struct ofd_mod_data *ofd_fmd_find_nolock(struct obd_export *exp, cfs_time_t now = cfs_time_current(); - LASSERT_SPIN_LOCKED(&fed->fed_lock); + LASSERT(spin_is_locked(&fed->fed_lock)); cfs_list_for_each_entry_reverse(fmd, &fed->fed_mod_list, fmd_list) { if (lu_fid_eq(&fmd->fmd_fid, fid)) { @@ -227,9 +227,9 @@ void ofd_fmd_cleanup(struct obd_export *exp) int ofd_fmd_init(void) { - ll_fmd_cachep = cfs_mem_cache_create("ll_fmd_cache", - sizeof(struct ofd_mod_data), - 0, 0); + ll_fmd_cachep = kmem_cache_create("ll_fmd_cache", + sizeof(struct ofd_mod_data), + 0, 0, NULL); if (!ll_fmd_cachep) return -ENOMEM; else @@ -239,9 +239,7 @@ int ofd_fmd_init(void) void ofd_fmd_exit(void) { if (ll_fmd_cachep) { - int rc = cfs_mem_cache_destroy(ll_fmd_cachep); - - LASSERTF(rc == 0, "Cannot destroy ll_fmd_cachep: rc %d\n", rc); + kmem_cache_destroy(ll_fmd_cachep); ll_fmd_cachep = NULL; } }