Whamcloud - gitweb
LU-12635 build: Support for gcc -Wimplicit-fallthrough
[fs/lustre-release.git] / lustre / fid / fid_store.c
index 8cd6c41..1565d80 100644 (file)
@@ -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;
 }