/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. * * GPL HEADER END */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2011, 2012, Intel, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/osp/osp_object.c * * Lustre OST Proxy Device * * Author: Alex Zhuravlev * Author: Mikhail Pershin */ #ifndef EXPORT_SYMTAB # define EXPORT_SYMTAB #endif #define DEBUG_SUBSYSTEM S_MDS #include "osp_internal.h" struct dt_object_operations osp_obj_ops = { }; static int osp_object_init(const struct lu_env *env, struct lu_object *o, const struct lu_object_conf *unused) { struct osp_object *po = lu2osp_obj(o); po->opo_obj.do_ops = &osp_obj_ops; return 0; } static void osp_object_free(const struct lu_env *env, struct lu_object *o) { struct osp_object *obj = lu2osp_obj(o); struct lu_object_header *h = o->lo_header; dt_object_fini(&obj->opo_obj); lu_object_header_fini(h); OBD_SLAB_FREE_PTR(obj, osp_object_kmem); } static void osp_object_release(const struct lu_env *env, struct lu_object *o) { return; } static int osp_object_print(const struct lu_env *env, void *cookie, lu_printer_t p, const struct lu_object *l) { const struct osp_object *o = lu2osp_obj((struct lu_object *)l); return (*p)(env, cookie, LUSTRE_OSP_NAME"-object@%p", o); } static int osp_object_invariant(const struct lu_object *o) { LBUG(); } struct lu_object_operations osp_lu_obj_ops = { .loo_object_init = osp_object_init, .loo_object_free = osp_object_free, .loo_object_release = osp_object_release, .loo_object_print = osp_object_print, .loo_object_invariant = osp_object_invariant };