X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_dev.c;h=b511a22189eb72cd7c163a6615c9f1f354d1f229;hb=57c575265c5daa25874081b9d121396eb6628d4a;hp=a0216e352493b4879d6264e0aefde396190e08cb;hpb=e768e65ce59b6294813b538f308049ae2cbe74a0;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_dev.c b/lustre/osc/osc_dev.c index a0216e3..b511a22 100644 --- a/lustre/osc/osc_dev.c +++ b/lustre/osc/osc_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. @@ -28,12 +26,14 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * Implementation of cl_device, cl_req for OSC layer. + * Implementation of cl_device, for OSC layer. * * Author: Nikita Danilov */ @@ -49,20 +49,15 @@ * @{ */ -cfs_mem_cache_t *osc_page_kmem; -cfs_mem_cache_t *osc_lock_kmem; -cfs_mem_cache_t *osc_object_kmem; -cfs_mem_cache_t *osc_thread_kmem; -cfs_mem_cache_t *osc_session_kmem; -cfs_mem_cache_t *osc_req_kmem; +struct kmem_cache *osc_lock_kmem; +struct kmem_cache *osc_object_kmem; +struct kmem_cache *osc_thread_kmem; +struct kmem_cache *osc_session_kmem; +struct kmem_cache *osc_extent_kmem; +struct kmem_cache *osc_quota_kmem; struct lu_kmem_descr osc_caches[] = { { - .ckd_cache = &osc_page_kmem, - .ckd_name = "osc_page_kmem", - .ckd_size = sizeof (struct osc_page) - }, - { .ckd_cache = &osc_lock_kmem, .ckd_name = "osc_lock_kmem", .ckd_size = sizeof (struct osc_lock) @@ -83,17 +78,20 @@ struct lu_kmem_descr osc_caches[] = { .ckd_size = sizeof (struct osc_session) }, { - .ckd_cache = &osc_req_kmem, - .ckd_name = "osc_req_kmem", - .ckd_size = sizeof (struct osc_req) - }, - { + .ckd_cache = &osc_extent_kmem, + .ckd_name = "osc_extent_kmem", + .ckd_size = sizeof (struct osc_extent) + }, + { + .ckd_cache = &osc_quota_kmem, + .ckd_name = "osc_quota_kmem", + .ckd_size = sizeof(struct osc_quota_info) + }, + { .ckd_cache = NULL } }; -cfs_lock_class_key_t osc_ast_guard_class; - /***************************************************************************** * * Type conversions. @@ -112,14 +110,14 @@ static struct lu_device *osc2lu_dev(struct osc_device *osc) */ static void *osc_key_init(const struct lu_context *ctx, - struct lu_context_key *key) + struct lu_context_key *key) { - struct osc_thread_info *info; + struct osc_thread_info *info; - OBD_SLAB_ALLOC_PTR_GFP(info, osc_thread_kmem, CFS_ALLOC_IO); - if (info == NULL) - info = ERR_PTR(-ENOMEM); - return info; + OBD_SLAB_ALLOC_PTR_GFP(info, osc_thread_kmem, GFP_NOFS); + if (info == NULL) + info = ERR_PTR(-ENOMEM); + return info; } static void osc_key_fini(const struct lu_context *ctx, @@ -136,14 +134,14 @@ struct lu_context_key osc_key = { }; static void *osc_session_init(const struct lu_context *ctx, - struct lu_context_key *key) + struct lu_context_key *key) { - struct osc_session *info; + struct osc_session *info; - OBD_SLAB_ALLOC_PTR_GFP(info, osc_session_kmem, CFS_ALLOC_IO); - if (info == NULL) - info = ERR_PTR(-ENOMEM); - return info; + OBD_SLAB_ALLOC_PTR_GFP(info, osc_session_kmem, GFP_NOFS); + if (info == NULL) + info = ERR_PTR(-ENOMEM); + return info; } static void osc_session_fini(const struct lu_context *ctx, @@ -175,23 +173,16 @@ static const struct lu_device_operations osc_lu_ops = { .ldo_recovery_complete = NULL }; -static const struct cl_device_operations osc_cl_ops = { - .cdo_req_init = osc_req_init -}; - static int osc_device_init(const struct lu_env *env, struct lu_device *d, const char *name, struct lu_device *next) { - struct osc_device *od = lu2osc_dev(d); - - od->od_lockless_truncate = 1; RETURN(0); } static struct lu_device *osc_device_fini(const struct lu_env *env, struct lu_device *d) { - return 0; + return NULL; } static struct lu_device *osc_device_free(const struct lu_env *env, @@ -220,7 +211,6 @@ static struct lu_device *osc_device_alloc(const struct lu_env *env, cl_device_init(&od->od_cl, t); d = osc2lu_dev(od); d->ld_ops = &osc_lu_ops; - od->od_cl.cd_ops = &osc_cl_ops; /* Setup OSC OBD */ obd = class_name2obd(lustre_cfg_string(cfg, 0));