if (it.d.lustre.it_lock_mode)
ldlm_lock_decref(lockh, it.d.lustre.it_lock_mode);
}
+
+ EXIT;
cleanup:
lmv_unlock_obj(obj);
lmv_put_obj(obj);
- RETURN(rc);
+ return rc;
}
int lmv_intent_lookup(struct obd_export *exp, struct lustre_id *pid,
oit->d.lustre.it_lock_mode = master_lock_mode;
rc = 1;
}
+
+ EXIT;
cleanup:
lmv_unlock_obj(obj);
lmv_put_obj(obj);
- RETURN(rc);
+ return rc;
}
}
rc = 0;
-
+
+ LASSERT(oa->o_id != 0);
id_ino(&mid) = oa->o_id;
id_fid(&mid) = oa->o_fid;
id_gen(&mid) = oa->o_generation;
class_disconnect(exp, 0);
}
class_export_put(exp);
-
return rc;
}
}
RETURN(rc);
}
+
static int mds_init_export(struct obd_export *exp)
{
struct mds_export_data *med = &exp->exp_mds_data;
INIT_LIST_HEAD(&med->med_open_head);
spin_lock_init(&med->med_open_lock);
- RETURN(0);
+ return 0;
}
static int mds_destroy_export(struct obd_export *export)
spin_unlock(&med->med_open_lock);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ EXIT;
out:
mds_client_free(export, !(export->exp_flags & OBD_OPT_FAILOVER));
-
- RETURN(rc);
+ return rc;
}
static int mds_disconnect(struct obd_export *exp, int flags)
int mds_get_md(struct obd_device *obd, struct inode *inode, void *md,
int *size, int lock)
{
- int rc = 0;
int lmm_size;
+ int rc = 0;
+ ENTRY;
if (lock)
down(&inode->i_sem);
if (OBD_FAIL_CHECK(OBD_FAIL_MDS_GETATTR_PACK)) {
CERROR("failed MDS_GETATTR_PACK test\n");
req->rq_status = -ENOMEM;
- GOTO(out, rc = -ENOMEM);
+ RETURN(-ENOMEM);
}
rc = lustre_pack_reply(req, 1, size, NULL);
if (rc) {
+ req->rq_status = rc;
CERROR("lustre_pack_reply failed: rc %d\n", rc);
GOTO(out, req->rq_status = rc);
}
- out:
- RETURN(rc);
+ EXIT;
+out:
+ return rc;
}
static int mds_getattr_pack_msg(struct ptlrpc_request *req, struct inode *inode,
req->rq_status = mds_getattr_internal(obd, de, req, body, 0);
l_dput(de);
- GOTO(out_pop, rc);
+
+ EXIT;
out_pop:
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
mds_exit_ucred(&uc);
- RETURN(rc);
+ return rc;
}
static int mds_obd_statfs(struct obd_device *obd, struct obd_statfs *osfs,
GOTO(out, rc);
}
+ EXIT;
out:
req->rq_status = rc;
- RETURN(0);
+ return 0;
}
static int mds_sync(struct ptlrpc_request *req, int offset)
mds_pack_inode2body(obd, body, de->d_inode, 0);
l_dput(de);
}
+
+ EXIT;
out:
req->rq_status = rc;
- RETURN(0);
+ return 0;
}
/* mds_readpage does not take a DLM lock on the inode, because the client must
/* body->size is actually the offset -eeb */
rc = mds_sendpage(req, file, body->size, body->nlink);
+ EXIT;
out_file:
filp_close(file, 0);
out_pop:
mds_exit_ucred(&uc);
out:
req->rq_status = rc;
- RETURN(0);
+ return 0;
}
/* update master MDS ID, which is stored in local inode EA. */
GOTO(out_commit, rc);
}
+ EXIT;
out_commit:
fsfilt_commit(obd, mds->mds_sb, dentry->d_inode,
handle, 0);
out_dentry:
l_dput(dentry);
out:
- RETURN(rc);
+ return rc;
}
EXPORT_SYMBOL(mds_update_mid);
GOTO(out_dentry, rc);
}
+ EXIT;
out_dentry:
l_dput(dentry);
out:
- RETURN(rc);
+ return rc;
}
EXPORT_SYMBOL(mds_read_mid);
/* rc will be used to interrupt a for loop over multiple records */
rc = mds_reint_rec(rec, offset, req, lockh);
mds_exit_ucred(&rec->ur_uc);
+ EXIT;
out:
OBD_FREE(rec, sizeof(*rec));
- RETURN(rc);
+ return rc;
}
static int mds_filter_recovery_request(struct ptlrpc_request *req,
}
}
+ EXIT;
cleanup:
switch (cleanup_phase) {
case 2: /* object has been created, but we'll may want to replay it later */
l_dput(new);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
mds_put_group_entry(mds, uc.luc_ghash);
- RETURN(rc);
+ return rc;
}
static int mdt_get_info(struct ptlrpc_request *req)
}
RETURN(rc);
-
err_cleanup:
mds_lov_clean(obd);
err_llog:
obd_llog_cleanup(llog_get_context(&obd->obd_llogs,
LLOG_CONFIG_ORIG_CTXT));
- RETURN(rc);
+ return rc;
}
int mds_postrecov(struct obd_device *obd)
int mds_lov_clean(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
+ ENTRY;
if (mds->mds_profile) {
char * cln_prof;
int mds_lmv_clean(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
+ ENTRY;
if (mds->mds_lmv_name) {
OBD_FREE(mds->mds_lmv_name, strlen(mds->mds_lmv_name) + 1);
mds->mds_lmv_obd = ERR_PTR(rc);
err_last:
up(&mds->mds_lmv_sem);
- RETURN(rc);
+ return rc;
}
int mds_lmv_postsetup(struct obd_device *obd)
GOTO(cleanup, err);
}
+ EXIT;
cleanup:
for (i = 0; i < mea->mea_count; i++) {
struct list_head *cur, *tmp;
OBD_FREE(dc.cache, sizeof(struct dir_cache) * mea->mea_count);
OBD_FREE(file_name, nlen);
- RETURN(err);
+ return err;
}
#define MAX_DIR_SIZE (64 * 1024)
err_oa:
obdo_free(oa);
- RETURN(rc);
+ return rc;
}
static int filter_start_page_write(struct inode *inode,
struct page *page = alloc_pages(GFP_HIGHUSER, 0);
if (page == NULL) {
CERROR("no memory for a temp page\n");
- RETURN(lnb->rc = -ENOMEM);
+ return lnb->rc = -ENOMEM;
}
POISON_PAGE(page, 0xf1);
page->index = lnb->offset >> PAGE_SHIFT;
lnb->page = page;
-
return 0;
}
struct dentry *dentry;
struct lustre_id id;
ENTRY;
+
LASSERT(objcount == 1);
LASSERT(obj->ioo_bufcnt > 0);
OBD_FREE(lockh, sizeof(struct lustre_handle) * mea->mea_count);
OBD_FREE(mea, mea_size);
- return;
}
int mds_unlink_slave_objs(struct obd_device *obd, struct dentry *dentry)
struct mdc_op_data op_data;
struct mea *mea = NULL;
int mea_size, rc;
+ ENTRY;
/* clustered MD ? */
if (!mds->mds_lmv_obd)
- return 0;
+ RETURN(0);
/* a dir can be splitted only */
if (!S_ISDIR(dentry->d_inode->i_mode))
RETURN(rc);
if (mea == NULL)
- return 0;
+ RETURN(0);
+
if (mea->mea_count == 0)
GOTO(cleanup, rc = 0);
op_data.mea1 = mea;
rc = md_unlink(mds->mds_lmv_exp, &op_data, &req);
LASSERT(req == NULL);
+ EXIT;
cleanup:
OBD_FREE(mea, mea_size);
- RETURN(rc);
+ return rc;
}
struct ide_tracking {
if (!mds_is_dir_empty(obd, dentry))
rc = -ENOTEMPTY;
+ EXIT;
cleanup:
switch(cleanup_phase) {
case 1:
default:
break;
}
- RETURN(rc);
+ return rc;
}
int mds_convert_mea_ea(struct obd_device *obd, struct inode *inode,
err = fsfilt_commit(obd, obd->u.mds.mds_sb, inode, handle, 0);
if (!rc)
rc = err ? err : size;
- GOTO(conv_free, rc);
+ EXIT;
conv_free:
OBD_FREE(new, size);
return rc;
obd_disconnect(mds->mds_lov_exp, 0);
mds->mds_lov_exp = NULL;
mds->mds_lov_obd = ERR_PTR(rc);
- RETURN(rc);
+ return rc;
}
int mds_lov_disconnect(struct obd_device *obd, int flags)
err = fsfilt_commit(obd, inode->i_sb, inode, handle, 0);
if (!rc)
rc = err;
+
+ EXIT;
out_oa:
obdo_free(oa);
out_lsm:
obd_free_memmd(osc_exp, &lsm);
- RETURN(rc);
+ return rc;
}
}
CDEBUG(log_pri, "wrote objids: err = %d\n", err);
+ EXIT;
out_commit:
err = fsfilt_commit(obd, mds->mds_sb, inode, handle, 0);
if (err) {
rc = err;
}
- RETURN(rc);
+ return rc;
}
/* this gives the same functionality as the code between
body = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*body));
mds_pack_inode2body(obd, body, inode, 1);
}
- EXIT;
+ EXIT;
cleanup:
err = mds_finish_transno(mds, dir, handle, req, rc, 0);
memset(child_res_id, 0, sizeof(*child_res_id));
}
+ EXIT;
cleanup:
if (rc) {
switch(cleanup_phase) {
ldlm_lock_decref(parent_lockh, parent_mode);
}
}
- RETURN(rc);
+ return rc;
}
int mds_get_parent_child_locked(struct obd_device *obd, struct mds_obd *mds,
GOTO(cleanup, rc);
}
+ EXIT;
cleanup:
if (rc) {
switch (cleanup_phase) {
l_dput(*dparentp);
}
}
- RETURN(rc);
+ return rc;
}
void mds_reconstruct_generic(struct ptlrpc_request *req)
{
struct mds_export_data *med = &req->rq_export->exp_mds_data;
-
mds_req_from_mcd(req, med->med_mcd);
}
+
/* If we are unlinking an open file/dir (i.e. creating an orphan) then
* we instead link the inode into the PENDING directory until it is
* finally released. We can't simply call mds_reint_rename() or some
mark_inode_dirty(pending_dir);
}
- GOTO(out_dput, rc = 1);
+ EXIT;
out_dput:
l_dput(pending_child);
- RETURN(rc);
+ return rc;
}
int mds_create_local_dentry(struct mds_update_record *rec,
id_fid(rec->ur_id1) = id_fid(&sid);
id_group(rec->ur_id1) = id_group(&sid);
+
+ EXIT;
cleanup:
switch(cleanup_phase) {
case 2:
case 0:
break;
}
- RETURN(rc);
+ return rc;
}
static int mds_copy_unlink_reply(struct ptlrpc_request *master,
rc = mds_add_local_dentry(rec, offset, req, rec->ur_id1,
de_tgtdir, de_new, 0);
- GOTO(cleanup, rc);
-cleanup:
EXIT;
+cleanup:
if (cleanup_phase == 1) {
#ifdef S_PDIROPS
}
req->rq_status = rc;
- RETURN(0);
+ return 0;
}
static int mds_reint_rename_to_remote(struct mds_update_record *rec, int offset,
rc = mds_del_local_dentry(rec, offset, req, de_srcdir,
de_old);
+
+ EXIT;
cleanup:
if (req2)
ptlrpc_req_finished(req2);
l_dput(de_srcdir);
req->rq_status = rc;
- RETURN(0);
+ return 0;
}
static int mds_reint_rename(struct mds_update_record *rec, int offset,
}
}
- GOTO(cleanup, rc);
-cleanup:
EXIT;
+cleanup:
rc = mds_finish_transno(mds, (de_tgtdir ? de_tgtdir->d_inode : NULL),
handle, req, rc, 0);