X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flovsub_object.c;h=66130eac0b5810e8518be160f19ed3e77cea193d;hb=41998544b8a34b3c385f2a6adb7ebc01ba496182;hp=e8097e103ead1419a0d8d43b40756c194ce54327;hpb=ee8b8845c03fb5a8c6b86732e4161d1a5e162fd6;p=fs%2Flustre-release.git diff --git a/lustre/lov/lovsub_object.c b/lustre/lov/lovsub_object.c index e8097e1..66130ea 100644 --- a/lustre/lov/lovsub_object.c +++ b/lustre/lov/lovsub_object.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) 2012, 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 + * @{ + */ /***************************************************************************** * @@ -64,6 +66,7 @@ int lovsub_object_init(const struct lu_env *env, struct lu_object *obj, below = under->ld_ops->ldo_object_alloc(env, obj->lo_header, under); if (below != NULL) { lu_object_add(obj, below); + cl_object_page_init(lu2cl(obj), sizeof(struct lovsub_page)); result = 0; } else result = -ENOMEM; @@ -83,7 +86,9 @@ static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj) if (lov) { LASSERT(lov->lo_type == LLT_RAID0); LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los); - lov->u.raid0.lo_sub[los->lso_index] = NULL; + spin_lock(&lov->u.raid0.lo_sub_lock); + lov->u.raid0.lo_sub[los->lso_index] = NULL; + spin_unlock(&lov->u.raid0.lo_sub_lock); } lu_object_fini(obj); @@ -97,7 +102,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, @@ -146,7 +151,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env, struct lu_object *obj; ENTRY; - OBD_SLAB_ALLOC_PTR_GFP(los, lovsub_object_kmem, CFS_ALLOC_IO); + OBD_SLAB_ALLOC_PTR_GFP(los, lovsub_object_kmem, __GFP_IO); if (los != NULL) { struct cl_object_header *hdr;