Whamcloud - gitweb
LU-1866 lfsck: enhance otable-based iteration
[fs/lustre-release.git] / lustre / fld / fld_index.c
index f8e3646..c0295ab 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -206,11 +206,11 @@ int fld_index_create(const struct lu_env *env, struct lu_server_fld *fld,
        if (IS_ERR(flde))
                GOTO(out, rc = PTR_ERR(flde));
 
-       spin_lock(&fld->lsf_cache->fci_lock);
+       write_lock(&fld->lsf_cache->fci_lock);
        if (deleted)
                fld_cache_delete_nolock(fld->lsf_cache, new_range);
        rc = fld_cache_insert_nolock(fld->lsf_cache, flde);
-       spin_unlock(&fld->lsf_cache->fci_lock);
+       write_unlock(&fld->lsf_cache->fci_lock);
        if (rc)
                OBD_FREE_PTR(flde);
 out: