X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ffid%2Ffid_store.c;h=1565d80811d2907524639c143124d533e97e7511;hb=a294ea9a0e0494af345c2203a691b3bf16ac9dbd;hp=5ed1c3c0a9ab048355f39e9541b6c9d3af83b255;hpb=2b294992edce5af7b79d4300ed3aa1ea6a8db850;p=fs%2Flustre-release.git diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index 5ed1c3c..1565d80 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -15,11 +15,7 @@ * * 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. + * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ @@ -27,7 +23,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2014, Intel Corporation. + * Copyright (c) 2011, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -45,7 +41,6 @@ #include #include #include -#include #include #include #include "fid_internal.h" @@ -112,6 +107,9 @@ int seq_store_update(const struct lu_env *env, struct lu_server_seq *seq, loff_t pos = 0; int rc; + if (dt_dev->dd_rdonly) + RETURN(0); + info = lu_context_key_get(&env->le_ctx, &seq_thread_key); LASSERT(info != NULL); @@ -180,9 +178,7 @@ int seq_store_read(struct lu_server_seq *seq, info = lu_context_key_get(&env->le_ctx, &seq_thread_key); LASSERT(info != NULL); - rc = seq->lss_obj->do_body_ops->dbo_read(env, seq->lss_obj, - seq_store_buf(info), - &pos, BYPASS_CAPA); + rc = dt_read(env, seq->lss_obj, seq_store_buf(info), &pos); if (rc == sizeof(info->sti_space)) { range_le_to_cpu(&seq->lss_space, &info->sti_space); @@ -238,16 +234,15 @@ int seq_store_init(struct lu_server_seq *seq, RETURN(rc); } -void seq_store_fini(struct lu_server_seq *seq, - const struct lu_env *env) +void seq_store_fini(struct lu_server_seq *seq, const struct lu_env *env) { - ENTRY; + ENTRY; - if (seq->lss_obj != NULL) { - if (!IS_ERR(seq->lss_obj)) - lu_object_put(env, &seq->lss_obj->do_lu); - seq->lss_obj = NULL; - } + if (seq->lss_obj != NULL) { + if (!IS_ERR(seq->lss_obj)) + dt_object_put(env, seq->lss_obj); + seq->lss_obj = NULL; + } - EXIT; + EXIT; }