X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flovsub_object.c;h=a0b5da35bba7e12e6475d004203681363f8f3da9;hb=12e09a0c2a116de01c373f0915ed56e928bd3bd0;hp=e49d43d5c72af6a3929a7b42cab44b529362cc85;hpb=fbf5870b9848929d352460f1f005b79c0b5ccc5a;p=fs%2Flustre-release.git diff --git a/lustre/lov/lovsub_object.c b/lustre/lov/lovsub_object.c index e49d43d..a0b5da3 100644 --- a/lustre/lov/lovsub_object.c +++ b/lustre/lov/lovsub_object.c @@ -26,7 +26,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -42,7 +42,9 @@ #include "lov_cl_internal.h" -/** \addtogroup lov lov @{ */ +/** \addtogroup lov + * @{ + */ /***************************************************************************** * @@ -74,8 +76,20 @@ int lovsub_object_init(const struct lu_env *env, struct lu_object *obj, static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj) { struct lovsub_object *los = lu2lovsub(obj); - + struct lov_object *lov = los->lso_super; ENTRY; + + /* We can't assume lov was assigned here, because of the shadow + * object handling in lu_object_find. + */ + if (lov) { + LASSERT(lov->lo_type == LLT_RAID0); + LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los); + cfs_spin_lock(&lov->u.raid0.lo_sub_lock); + lov->u.raid0.lo_sub[los->lso_index] = NULL; + cfs_spin_unlock(&lov->u.raid0.lo_sub_lock); + } + lu_object_fini(obj); lu_object_header_fini(&los->lso_header.coh_lu); OBD_SLAB_FREE_PTR(los, lovsub_object_kmem); @@ -87,7 +101,7 @@ static int lovsub_object_print(const struct lu_env *env, void *cookie, { struct lovsub_object *los = lu2lovsub(obj); - return (*p)(env, cookie, "[%i]", los->lso_index); + return (*p)(env, cookie, "[%d]", los->lso_index); } static int lovsub_attr_set(const struct lu_env *env, struct cl_object *obj, @@ -129,14 +143,14 @@ static const struct lu_object_operations lovsub_lu_obj_ops = { }; struct lu_object *lovsub_object_alloc(const struct lu_env *env, - const struct lu_object_header *_, + const struct lu_object_header *unused, struct lu_device *dev) { struct lovsub_object *los; struct lu_object *obj; ENTRY; - OBD_SLAB_ALLOC_PTR(los, lovsub_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(los, lovsub_object_kmem, CFS_ALLOC_IO); if (los != NULL) { struct cl_object_header *hdr;