*
* 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
*/
* 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, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
static int orphan_object_destroy(const struct lu_env *env,
- struct mdd_object *obj,
- struct dt_key *key)
+ struct mdd_object *obj,
+ struct dt_key *key)
{
- struct thandle *th = NULL;
- struct mdd_device *mdd = mdo2mdd(&obj->mod_obj);
- int rc = 0;
- ENTRY;
+ struct thandle *th = NULL;
+ struct mdd_device *mdd = mdo2mdd(&obj->mod_obj);
+ int rc = 0;
+ ENTRY;
th = mdd_trans_create(env, mdd);
if (IS_ERR(th)) {
RETURN(PTR_ERR(th));
}
- rc = orph_declare_index_delete(env, obj, th);
- if (rc)
- GOTO(stop, rc);
+ rc = orph_declare_index_delete(env, obj, th);
+ if (rc)
+ GOTO(stop, rc);
rc = mdo_declare_destroy(env, obj, th);
- if (rc)
- GOTO(stop, rc);
+ if (rc)
+ GOTO(stop, rc);
- rc = mdd_trans_start(env, mdd, th);
- if (rc)
- GOTO(stop, rc);
+ rc = mdd_trans_start(env, mdd, th);
+ if (rc)
+ GOTO(stop, rc);
- mdd_write_lock(env, obj, MOR_TGT_CHILD);
- if (likely(obj->mod_count == 0)) {
- mdd_orphan_write_lock(env, mdd);
- rc = mdd_orphan_delete_obj(env, mdd, key, th);
+ mdd_write_lock(env, obj, MOR_TGT_CHILD);
+ if (likely(obj->mod_count == 0)) {
+ mdd_orphan_write_lock(env, mdd);
+ rc = mdd_orphan_delete_obj(env, mdd, key, th);
if (rc == 0) {
mdo_ref_del(env, obj, th);
if (S_ISDIR(mdd_object_type(obj))) {
}
rc = mdo_destroy(env, obj, th);
} else
- CERROR("could not delete object: rc = %d\n",rc);
- mdd_orphan_write_unlock(env, mdd);
- }
- mdd_write_unlock(env, obj);
+ CERROR("could not delete object: rc = %d\n", rc);
+ mdd_orphan_write_unlock(env, mdd);
+ }
+ mdd_write_unlock(env, obj);
stop:
- mdd_trans_stop(env, mdd, 0, th);
+ rc = mdd_trans_stop(env, mdd, 0, th);
- RETURN(rc);
+ RETURN(rc);
}
/**