RETURN(rc);
}
-/* Common method for remote and local use. */
static int cmm_is_subdir(const struct lu_env *env, struct md_object *mo,
const struct lu_fid *fid, struct lu_fid *sfid)
{
const struct md_create_spec *spec,
struct md_attr *ma)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_permission(const struct lu_env *env, struct md_object *mo,
int mask)
{
- RETURN(-EREMOTE);
+ return -EREMOTE;
}
static int cmr_attr_get(const struct lu_env *env, struct md_object *mo,
struct md_attr *attr)
{
- RETURN(-EREMOTE);
+ return -EREMOTE;
}
static int cmr_attr_set(const struct lu_env *env, struct md_object *mo,
const struct md_attr *attr)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_xattr_get(const struct lu_env *env, struct md_object *mo,
struct lu_buf *buf, const char *name)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_readlink(const struct lu_env *env, struct md_object *mo,
struct lu_buf *buf)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_xattr_list(const struct lu_env *env, struct md_object *mo,
struct lu_buf *buf)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_xattr_set(const struct lu_env *env, struct md_object *mo,
const struct lu_buf *buf, const char *name, int fl)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_xattr_del(const struct lu_env *env, struct md_object *mo,
const char *name)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_ref_add(const struct lu_env *env, struct md_object *mo)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_ref_del(const struct lu_env *env, struct md_object *mo,
struct md_attr *ma)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_open(const struct lu_env *env, struct md_object *mo,
int flags)
{
- RETURN(-EREMOTE);
+ return -EREMOTE;
}
static int cmr_close(const struct lu_env *env, struct md_object *mo,
struct md_attr *ma)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static int cmr_readpage(const struct lu_env *env, struct md_object *mo,
const struct lu_rdpg *rdpg)
{
- RETURN(-EREMOTE);
+ return -EREMOTE;
}
static int cmr_capa_get(const struct lu_env *env, struct md_object *mo,
struct lustre_capa *capa, int renewal)
{
- RETURN(-EFAULT);
+ return -EFAULT;
}
static struct md_object_operations cmr_mo_ops = {
* will happen here.
*/
- RETURN(-EREMOTE);
+ return -EREMOTE;
}
static mdl_mode_t cmr_lock_mode(const struct lu_env *env,
struct md_object *mo, mdl_mode_t lm)
{
- RETURN(MDL_MINMODE);
+ return MDL_MINMODE;
}
/*
static int mdt_is_subdir(struct mdt_thread_info *info)
{
- struct mdt_object *obj = info->mti_object;
- struct req_capsule *pill = &info->mti_pill;
+ struct mdt_object *o = info->mti_object;
+ struct req_capsule *pill = &info->mti_pill;
const struct mdt_body *body = info->mti_body;
- struct mdt_body *repbody;
- int rc;
-
- obj = info->mti_object;
- LASSERT(obj != NULL);
- LASSERT(lu_object_assert_exists(&obj->mot_obj.mo_lu));
+ struct mdt_body *repbody;
+ int rc;
ENTRY;
+ LASSERT(o != NULL);
+ LASSERT(lu_object_assert_exists(&o->mot_obj.mo_lu));
+
repbody = req_capsule_server_get(pill, &RMF_MDT_BODY);
/*
LASSERT(fid_is_sane(&body->fid2));
mdt_set_capainfo(info, 0, &body->fid1, BYPASS_CAPA);
mdt_set_capainfo(info, 1, &body->fid2, BYPASS_CAPA);
- rc = mdo_is_subdir(info->mti_env, mdt_object_child(obj),
+
+ LASSERT(mdt_object_exists(o) > 0);
+ rc = mdo_is_subdir(info->mti_env, mdt_object_child(o),
&body->fid2, &repbody->fid1);
if (rc < 0)
RETURN(rc);
static void mdt_rename_unlock(struct lustre_handle *lh)
{
ENTRY;
+ LASSERT(lustre_handle_is_used(lh));
ldlm_lock_decref(lh, LCK_EX);
EXIT;
}
struct mdt_lock_handle *lhc)
{
struct mdt_reint_record *rr = &info->mti_rr;
- struct req_capsule *pill = &info->mti_pill;
struct md_attr *ma = &info->mti_attr;
struct ptlrpc_request *req = mdt_info_req(info);
struct mdt_object *msrcdir;
int rc;
ENTRY;
- rc = req_capsule_get_size(pill, &RMF_NAME, RCL_CLIENT);
- if (rc == 1) {
- /* if (rr->rr_name[0] == 0) {*/
+ if (rr->rr_namelen == 1) {
rc = mdt_reint_rename_tgt(info);
RETURN(rc);
}
rc = mdt_rename_lock(info, &rename_lh);
if (rc) {
- CERROR("can't lock FS for rename, rc %d\n", rc);
+ CERROR("Can't lock FS for rename, rc %d\n", rc);
GOTO(out, rc);
}