Whamcloud - gitweb
LU-1534 osd: Fix LBUGs when destroying IGIF objects
[fs/lustre-release.git] / lustre / lov / lov_object.c
index 658b34d..40ca89b 100644 (file)
@@ -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.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -152,7 +152,7 @@ static int lov_init_sub(const struct lu_env *env, struct lov_object *lov,
                 r0->lo_sub[idx]->lso_index = idx;
                 result = 0;
         } else {
-                CERROR("Stripe is already owned by other file (%i).\n", idx);
+                CERROR("Stripe is already owned by other file (%d).\n", idx);
                 LU_OBJECT_DEBUG(D_ERROR, env, &stripe->co_lu, "\n");
                 LU_OBJECT_DEBUG(D_ERROR, env, lu_object_top(&parent->coh_lu),
                                 "old\n");
@@ -183,7 +183,7 @@ static int lov_init_raid0(const struct lu_env *env,
         r0->lo_lsm = conf->u.coc_md->lsm;
         LASSERT(r0->lo_nr <= lov_targets_nr(dev));
 
-        OBD_ALLOC(r0->lo_sub, r0->lo_nr * sizeof r0->lo_sub[0]);
+        OBD_ALLOC_LARGE(r0->lo_sub, r0->lo_nr * sizeof r0->lo_sub[0]);
         if (r0->lo_sub != NULL) {
                 result = 0;
                 subconf->coc_inode = conf->coc_inode;
@@ -224,6 +224,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov,
         struct cl_object        *sub;
         struct lov_layout_raid0 *r0;
         struct lu_site          *site;
+        struct lu_site_bkt_data *bkt;
         cfs_waitlink_t          *waiter;
 
         r0  = &lov->u.raid0;
@@ -231,6 +232,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov,
 
         sub  = lovsub2cl(los);
         site = sub->co_lu.lo_dev->ld_site;
+        bkt  = lu_site_bkt_from_fid(site, &sub->co_lu.lo_header->loh_fid);
 
         cl_object_kill(env, sub);
         /* release a reference to the sub-object and ... */
@@ -242,7 +244,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov,
         if (r0->lo_sub[idx] == los) {
                 waiter = &lov_env_info(env)->lti_waiter;
                 cfs_waitlink_init(waiter);
-                cfs_waitq_add(&site->ls_marche_funebre, waiter);
+                cfs_waitq_add(&bkt->lsb_marche_funebre, waiter);
                 cfs_set_current_state(CFS_TASK_UNINT);
                 while (1) {
                         /* this wait-queue is signaled at the end of
@@ -258,7 +260,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov,
                                 break;
                         }
                 }
-                cfs_waitq_del(&site->ls_marche_funebre, waiter);
+                cfs_waitq_del(&bkt->lsb_marche_funebre, waiter);
         }
         LASSERT(r0->lo_sub[idx] == NULL);
 }
@@ -298,7 +300,7 @@ static void lov_fini_raid0(const struct lu_env *env, struct lov_object *lov,
 
         ENTRY;
         if (r0->lo_sub != NULL) {
-                OBD_FREE(r0->lo_sub, r0->lo_nr * sizeof r0->lo_sub[0]);
+                OBD_FREE_LARGE(r0->lo_sub, r0->lo_nr * sizeof r0->lo_sub[0]);
                 r0->lo_sub = NULL;
         }
         EXIT;