* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
int orph_declare_index_insert(const struct lu_env *env,
struct mdd_object *obj,
- cfs_umode_t mode, struct thandle *th)
+ umode_t mode, struct thandle *th)
{
struct mdd_device *mdd = mdo2mdd(&obj->mod_obj);
struct dt_key *key;
mdo_ref_add(env, obj, th);
if (!S_ISDIR(mdd_object_type(obj)))
- goto out;
+ GOTO(out, rc = 0);
mdo_ref_add(env, obj, th);
mdd_orphan_ref_add(env, mdd, th);
/* try best to fixup directory, dont return errors
* from here */
if (!dt_try_as_dir(env, next))
- goto out;
+ GOTO(out, rc = 0);
next->do_index_ops->dio_delete(env, next,
(const struct dt_key *)dotdot,
th, BYPASS_CAPA);
int rc = 0;
ENTRY;
- th = mdd_trans_create(env, mdd);
- if (IS_ERR(th)) {
- CERROR("Cannot get thandle\n");
- RETURN(-ENOMEM);
- }
+ th = mdd_trans_create(env, mdd);
+ if (IS_ERR(th)) {
+ CERROR("Cannot get thandle\n");
+ RETURN(PTR_ERR(th));
+ }
+
rc = orph_declare_index_delete(env, obj, th);
if (rc)
GOTO(stop, rc);