X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flovsub_dev.c;h=2feecf9b0f36f759ed3ab3e5ed31fe69acdd4d6b;hb=4311cdaa832fc4a444d48e50174dde09f21146d2;hp=359def45f45ed296ff1c3bfadcad5a19ed92bfeb;hpb=fbf5870b9848929d352460f1f005b79c0b5ccc5a;p=fs%2Flustre-release.git diff --git a/lustre/lov/lovsub_dev.c b/lustre/lov/lovsub_dev.c index 359def4..2feecf9 100644 --- a/lustre/lov/lovsub_dev.c +++ b/lustre/lov/lovsub_dev.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. @@ -26,8 +24,10 @@ * 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. + * + * Copyright (c) 2013, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -42,7 +42,9 @@ #include "lov_cl_internal.h" -/** \addtogroup lov lov @{ */ +/** \addtogroup lov + * @{ + */ /***************************************************************************** * @@ -132,29 +134,33 @@ static struct lu_device *lovsub_device_fini(const struct lu_env *env, } static struct lu_device *lovsub_device_free(const struct lu_env *env, - struct lu_device *d) + struct lu_device *d) { - struct lovsub_device *lsd = lu2lovsub_dev(d); - struct lu_device *next = cl2lu_dev(lsd->acid_next); - - cl_device_fini(lu2cl_dev(d)); - OBD_FREE_PTR(lsd); - return next; + struct lovsub_device *lsd = lu2lovsub_dev(d); + struct lu_device *next = cl2lu_dev(lsd->acid_next); + + if (atomic_read(&d->ld_ref) && d->ld_site) { + LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_ERROR, NULL); + lu_site_print(env, d->ld_site, &msgdata, lu_cdebug_printer); + } + cl_device_fini(lu2cl_dev(d)); + OBD_FREE_PTR(lsd); + return next; } static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev, - struct cl_req *req) + struct cl_req *req) { - struct lovsub_req *lsr; - int result; - - OBD_SLAB_ALLOC_PTR(lsr, lovsub_req_kmem); - if (lsr != NULL) { - cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops); - result = 0; - } else - result = -ENOMEM; - return result; + struct lovsub_req *lsr; + int result; + + OBD_SLAB_ALLOC_PTR_GFP(lsr, lovsub_req_kmem, GFP_NOFS); + if (lsr != NULL) { + cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops); + result = 0; + } else + result = -ENOMEM; + return result; } static const struct lu_device_operations lovsub_lu_ops = {