X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=inline;f=lustre%2Ffid%2Ffid_store.c;h=1565d80811d2907524639c143124d533e97e7511;hb=f843facff59226d3788d855d1d6948523ab8d944;hp=8cd6c411704819f6940e51bd95daa82b7ac35698;hpb=72057a3af19ee02d9a686bd7e7d074917e381310;p=fs%2Flustre-release.git diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index 8cd6c41..1565d80 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -23,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/ @@ -107,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); @@ -231,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; }