renamed to dt_exp and lmv_exp is renamed to md_exp. Related changes.
- removed OBD_MD_FID. And fid is now fetched on MDS on all constructive requests. It
is not fetched on unlink(), rename(), etc. This is because OBD_MD_FID flag lost
the sense as lmv layer needs it for all operations (to check if object is splitted).
#define OBD_MD_MDS (0x0000000010000000) /* where an inode lives on */
#define OBD_MD_FLDIREA (0x0000000020000000) /* dir's extended attribute data */
#define OBD_MD_REINT (0x0000000040000000) /* reintegrate oa */
-#define OBD_MD_FID (0x0000000080000000) /* take care about fid component */
#define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME | \
OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | \
struct dentry *mds_logs_dir;
struct dentry *mds_objects_dir;
struct llog_handle *mds_cfg_llh;
- struct obd_device *mds_lov_obd;
- struct obd_uuid mds_lov_uuid;
char *mds_profile;
- struct obd_export *mds_lov_exp;
- int mds_has_lov_desc;
- struct lov_desc mds_lov_desc;
- obd_id *mds_lov_objids;
- int mds_lov_objids_valid;
- int mds_lov_nextid_set;
- struct file *mds_lov_objid_filp;
- spinlock_t mds_lov_lock;
+ struct obd_device *mds_dt_obd;
+ struct obd_uuid mds_dt_uuid;
+ struct obd_export *mds_dt_exp;
+ int mds_has_dt_desc;
+ struct lov_desc mds_dt_desc;
+ obd_id *mds_dt_objids;
+ int mds_dt_objids_valid;
+ int mds_dt_nextid_set;
+ struct file *mds_dt_objid_filp;
+ spinlock_t mds_dt_lock;
unsigned long *mds_client_bitmap;
struct semaphore mds_orphan_recovery_sem;
int mds_num;
int mds_config_version;
- char *mds_lmv_name;
- struct obd_device *mds_lmv_obd;
- struct obd_export *mds_lmv_exp;
+ char *mds_md_name;
+ struct obd_device *mds_md_obd;
+ struct obd_export *mds_md_exp;
+ struct semaphore mds_md_sem;
+ struct obd_uuid mds_md_uuid;
+ int mds_md_connected;
struct ptlrpc_service *mds_create_service;
- struct semaphore mds_lmv_sem;
uid_t mds_squash_uid;
gid_t mds_squash_gid;
ptl_nid_t mds_nosquash_nid;
atomic_t mds_real_clients;
- struct obd_uuid mds_lmv_uuid;
struct dentry *mds_id_dir;
int mds_obd_type;
- int mds_lmv_connected;
struct dentry *mds_unnamed_dir; /* for mdt_obd_create only */
};
struct mds_body *body;
struct lookup_intent it = { .it_op = IT_READDIR };
struct mdc_op_data data;
- struct obd_device *obddev = class_exp2obd(sbi->ll_lmv_exp);
+ struct obd_device *obddev = class_exp2obd(sbi->ll_md_exp);
struct ldlm_res_id res_id =
{ .name = {id_fid(&lli->lli_id), id_group(&lli->lli_id)} };
ldlm_policy_data_t policy = { .l_inodebits = { MDS_INODELOCK_UPDATE } };
if (!rc) {
llu_prepare_mdc_data(&data, inode, NULL, NULL, 0, 0);
- rc = mdc_enqueue(sbi->ll_lmv_exp, LDLM_IBITS, &it, LCK_PR,
+ rc = mdc_enqueue(sbi->ll_md_exp, LDLM_IBITS, &it, LCK_PR,
&data, &lockh, NULL, 0,
ldlm_completion_ast, llu_mdc_blocking_ast,
inode);
S_IFDIR, 0, 0);
offset = page->index << PAGE_SHIFT;
- rc = mdc_readpage(sbi->ll_lmv_exp, &id, offset, page, &request);
+ rc = mdc_readpage(sbi->ll_md_exp, &id, offset, page, &request);
if (!rc) {
body = lustre_msg_buf(request->rq_repmsg, 0, sizeof (*body));
LASSERT (body != NULL); /* checked by mdc_readpage() */
OBD_ALLOC(fd, sizeof(*fd));
/* We can't handle this well without reorganizing ll_file_open and
- * ll_mdc_close, so don't even try right now. */
+ * ll_md_close(), so don't even try right now. */
LASSERT(fd != NULL);
memcpy(&fd->fd_mds_och.och_fh, &body->handle, sizeof(body->handle));
GOTO(out, rc = -EPROTO);
}
- rc = obd_unpackmd(llu_i2obdexp(dir), &lsm, eadata, body->eadatasize);
+ rc = obd_unpackmd(llu_i2dtexp(dir), &lsm, eadata, body->eadatasize);
if (rc < 0) {
CERROR("obd_unpackmd: %d\n", rc);
GOTO(out, rc);
}
}
- rc = obd_destroy(llu_i2obdexp(dir), oa, lsm, &oti);
+ rc = obd_destroy(llu_i2dtexp(dir), oa, lsm, &oti);
obdo_free(oa);
if (rc)
CERROR("obd destroy objid 0x"LPX64" error %d\n",
lsm->lsm_object_id, rc);
out_free_memmd:
- obd_free_memmd(llu_i2obdexp(dir), &lsm);
+ obd_free_memmd(llu_i2dtexp(dir), &lsm);
out:
return rc;
}
if (!fd) /* no process opened the file after an mcreate */
RETURN(0);
- rc2 = llu_mdc_close(sbi->ll_lmv_exp, inode);
+ rc2 = llu_mdc_close(sbi->ll_md_exp, inode);
if (rc2 && !rc)
rc = rc2;
oa.o_id, lli->lli_st_size);
/* truncate == punch from new size to absolute end of file */
- err = obd_punch(llu_i2obdexp(inode), &oa, lsm, lli->lli_st_size,
+ err = obd_punch(llu_i2dtexp(inode), &oa, lsm, lli->lli_st_size,
OBD_OBJECT_EOF, NULL);
if (err)
CERROR("obd_truncate fails (%d) ino %lu\n", err, lli->lli_st_ino);
struct llu_sb_info
{
struct obd_uuid ll_sb_uuid;
- struct obd_export *ll_lmv_exp;
- struct obd_export *ll_lov_exp;
+ struct obd_export *ll_md_exp;
+ struct obd_export *ll_dt_exp;
obd_id ll_rootino;
int ll_flags;
struct list_head ll_conn_chain;
return llu_i2info(inode)->lli_sbi;
}
-static inline struct obd_export *llu_i2obdexp(struct inode *inode)
+static inline struct obd_export *llu_i2dtexp(struct inode *inode)
{
- return llu_i2info(inode)->lli_sbi->ll_lov_exp;
+ return llu_i2info(inode)->lli_sbi->ll_dt_exp;
}
-static inline struct obd_export *llu_i2mdcexp(struct inode *inode)
+static inline struct obd_export *llu_i2mdexp(struct inode *inode)
{
- return llu_i2info(inode)->lli_sbi->ll_lmv_exp;
+ return llu_i2info(inode)->lli_sbi->ll_md_exp;
}
static inline int llu_is_root_inode(struct inode *inode)
if (it_disposition(it, DISP_LOOKUP_NEG))
RETURN(-ENOENT);
- rc = mdc_req2lustre_md(llu_i2sbi(inode)->ll_lmv_exp, req, offset,
- llu_i2sbi(inode)->ll_lov_exp, &md);
+ rc = mdc_req2lustre_md(llu_i2sbi(inode)->ll_md_exp, req, offset,
+ llu_i2sbi(inode)->ll_dt_exp, &md);
if (rc)
RETURN(rc);
}
}
- exp = llu_i2mdcexp(pb->pb_ino);
+ exp = llu_i2mdexp(pb->pb_ino);
ll_inode2id(&pid, pnode->p_parent->p_base->pb_ino);
ll_inode2id(&cid, pb->pb_ino);
icbd.icbd_parent = pnode->p_parent->p_base->pb_ino;
struct llu_inode_info *lli;
ENTRY;
- rc = mdc_req2lustre_md(sbi->ll_lmv_exp, request, offset,
- sbi->ll_lov_exp, &md);
+ rc = mdc_req2lustre_md(sbi->ll_md_exp, request, offset,
+ sbi->ll_dt_exp, &md);
if (rc)
RETURN(rc);
if (!inode || IS_ERR(inode)) {
/* free the lsm if we allocated one above */
if (md.lsm != NULL)
- obd_free_memmd(sbi->ll_lov_exp, &md.lsm);
+ obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
RETURN(inode ? PTR_ERR(inode) : -ENOMEM);
} else if (md.lsm != NULL &&
llu_i2info(inode)->lli_smd != md.lsm) {
- obd_free_memmd(sbi->ll_lov_exp, &md.lsm);
+ obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
}
lli = llu_i2info(inode);
icbd.icbd_child = pnode;
ll_inode2id(&pid, parent);
- rc = mdc_intent_lock(llu_i2mdcexp(parent), &pid,
+ rc = mdc_intent_lock(llu_i2mdexp(parent), &pid,
pnode->p_base->pb_name.name,
pnode->p_base->pb_name.len,
NULL, 0, NULL, it, flags, &req,
{
struct llu_inode_info *lli = llu_i2info(inode);
struct lov_stripe_md *lsm = lli->lli_smd;
- struct obd_export *exp = llu_i2obdexp(inode);
+ struct obd_export *exp = llu_i2dtexp(inode);
struct {
char name[16];
struct ldlm_lock *lock;
CDEBUG(D_DLMTRACE, "Glimpsing inode %lu\n", lli->lli_st_ino);
- rc = obd_enqueue(sbi->ll_lov_exp, lli->lli_smd, LDLM_EXTENT, &policy,
+ rc = obd_enqueue(sbi->ll_dt_exp, lli->lli_smd, LDLM_EXTENT, &policy,
LCK_PR, &flags, llu_extent_lock_callback,
ldlm_completion_ast, llu_glimpse_callback, inode,
sizeof(struct ost_lvb), lustre_swab_ost_lvb, &lockh);
CDEBUG(D_DLMTRACE, "glimpse: size: %llu, blocks: %lu\n",
lli->lli_st_size, lli->lli_st_blocks);
- obd_cancel(sbi->ll_lov_exp, lli->lli_smd, LCK_PR, &lockh);
+ obd_cancel(sbi->ll_dt_exp, lli->lli_smd, LCK_PR, &lockh);
RETURN(rc);
}
CDEBUG(D_DLMTRACE, "Locking inode %lu, start "LPU64" end "LPU64"\n",
lli->lli_st_ino, policy->l_extent.start, policy->l_extent.end);
- rc = obd_enqueue(sbi->ll_lov_exp, lsm, LDLM_EXTENT, policy, mode,
+ rc = obd_enqueue(sbi->ll_dt_exp, lsm, LDLM_EXTENT, policy, mode,
&ast_flags, llu_extent_lock_callback,
ldlm_completion_ast, llu_glimpse_callback, inode,
sizeof(struct ost_lvb), lustre_swab_ost_lvb, lockh);
(sbi->ll_flags & LL_SBI_NOLCK))
RETURN(0);
- rc = obd_cancel(sbi->ll_lov_exp, lsm, mode, lockh);
+ rc = obd_cancel(sbi->ll_dt_exp, lsm, mode, lockh);
RETURN(rc);
}
{
struct llu_inode_info *lli = llu_i2info(group->lig_inode);
struct lov_stripe_md *lsm = lli->lli_smd;
- struct obd_export *exp = llu_i2obdexp(group->lig_inode);
+ struct obd_export *exp = llu_i2dtexp(group->lig_inode);
struct page *pages = &group->lig_pages[group->lig_npages];
struct ll_async_page *llap = &group->lig_llap[group->lig_npages];
int i, rc, npages = 0, ret_bytes = 0;
void put_io_group(struct llu_io_group *group)
{
struct lov_stripe_md *lsm = llu_i2info(group->lig_inode)->lli_smd;
- struct obd_export *exp = llu_i2obdexp(group->lig_inode);
+ struct obd_export *exp = llu_i2dtexp(group->lig_inode);
struct ll_async_page *llap = group->lig_llap;
int i;
*/
liblustre_wait_event(0);
- exp = llu_i2obdexp(inode);
+ exp = llu_i2dtexp(inode);
if (exp == NULL)
RETURN(-EINVAL);
static void llu_fsop_gone(struct filesys *fs)
{
struct llu_sb_info *sbi = (struct llu_sb_info *) fs->fs_private;
- struct obd_device *obd = class_exp2obd(sbi->ll_lmv_exp);
+ struct obd_device *obd = class_exp2obd(sbi->ll_md_exp);
struct lustre_cfg lcfg;
int next = 0;
ENTRY;
list_del(&sbi->ll_conn_chain);
- obd_disconnect(sbi->ll_lov_exp, 0);
- obd_disconnect(sbi->ll_lmv_exp, 0);
+ obd_disconnect(sbi->ll_dt_exp, 0);
+ obd_disconnect(sbi->ll_md_exp, 0);
while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) != NULL)
{
}
}
- obd_disconnect(sbi->ll_lmv_exp, 0);
+ obd_disconnect(sbi->ll_md_exp, 0);
OBD_FREE(sbi, sizeof(*sbi));
EXIT;
}
}
}
- /*
- * updating inode lustre id. We try optimize things a little bit here,
- * thus do not do it all the time.
- */
- if (body->valid & OBD_MD_FID)
- id_assign_fid(&lli->lli_id, &body->id1);
- if ((body->valid & OBD_MD_FLID) || (body->valid & OBD_MD_FLGENER))
+ id_assign_fid(&lli->lli_id, &body->id1);
+
+ if ((body->valid & OBD_MD_FLID) || (body->valid & OBD_MD_FLGENER))
id_assign_stc(&lli->lli_id, &body->id1);
if (body->valid & OBD_MD_FLID)
lli->lli_st_ino = id_ino(&body->id1);
int llu_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm)
{
struct llu_inode_info *lli = llu_i2info(inode);
- struct obd_export *exp = llu_i2obdexp(inode);
+ struct obd_export *exp = llu_i2dtexp(inode);
struct ptlrpc_request_set *set;
struct obdo oa;
obd_valid refresh_valid;
LASSERT(inode);
- obddev = sbi->ll_lmv_exp->exp_obd;
+ obddev = sbi->ll_md_exp->exp_obd;
res_id.name[0] = id_fid(&lli->lli_id);
res_id.name[1] = id_group(&lli->lli_id);
/* Why don't we update all valid MDS fields here, if we're doing
* an RPC anyways? -phil */
if (S_ISREG(lli->lli_st_mode)) {
- ealen = obd_size_diskmd(sbi->ll_lov_exp, NULL);
+ ealen = obd_size_diskmd(sbi->ll_dt_exp, NULL);
valid |= OBD_MD_FLEASIZE;
}
ll_inode2id(&id, inode);
- rc = mdc_getattr(sbi->ll_lmv_exp, &id, valid, ealen, &req);
+ rc = mdc_getattr(sbi->ll_md_exp, &id, valid, ealen, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, lli->lli_st_ino);
RETURN(-abs(rc));
}
- rc = mdc_req2lustre_md(sbi->ll_lmv_exp, req, 0,
- sbi->ll_lov_exp, &md);
+ rc = mdc_req2lustre_md(sbi->ll_md_exp, req, 0,
+ sbi->ll_dt_exp, &md);
/* XXX Too paranoid? */
if (((md.body->valid ^ valid) & OBD_MD_FLEASIZE) &&
llu_update_inode(inode, md.body, md.lsm);
if (md.lsm != NULL && llu_i2info(inode)->lli_smd != md.lsm)
- obd_free_memmd(sbi->ll_lov_exp, &md.lsm);
+ obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
if (md.body->valid & OBD_MD_FLSIZE)
set_bit(LLI_F_HAVE_MDS_SIZE_LOCK,
ll_inode2id(&id, inode);
clear_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &(lli->lli_flags));
- mdc_change_cbdata(sbi->ll_lmv_exp, &id, null_if_equal, inode);
+ mdc_change_cbdata(sbi->ll_md_exp, &id, null_if_equal, inode);
if (lli->lli_smd)
- obd_change_cbdata(sbi->ll_lov_exp, lli->lli_smd,
+ obd_change_cbdata(sbi->ll_dt_exp, lli->lli_smd,
null_if_equal, inode);
if (lli->lli_smd) {
- obd_free_memmd(sbi->ll_lov_exp, &lli->lli_smd);
+ obd_free_memmd(sbi->ll_dt_exp, &lli->lli_smd);
lli->lli_smd = NULL;
}
struct lustre_md md;
llu_prepare_mdc_data(&op_data, inode, NULL, NULL, 0, 0);
- rc = mdc_setattr(sbi->ll_lmv_exp, &op_data,
+ rc = mdc_setattr(sbi->ll_md_exp, &op_data,
attr, NULL, 0, NULL, 0, &request);
if (rc) {
RETURN(rc);
}
- rc = mdc_req2lustre_md(sbi->ll_lmv_exp, request, 0,
- sbi->ll_lov_exp, &md);
+ rc = mdc_req2lustre_md(sbi->ll_md_exp, request, 0,
+ sbi->ll_dt_exp, &md);
if (rc) {
ptlrpc_req_finished(request);
RETURN(rc);
oa.o_valid = OBD_MD_FLID;
obdo_from_inode(&oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
- rc = obd_setattr(sbi->ll_lov_exp, &oa, lsm, NULL);
+ rc = obd_setattr(sbi->ll_dt_exp, &oa, lsm, NULL);
if (rc)
CERROR("obd_setattr fails: rc=%d\n", rc);
}
RETURN(err);
llu_prepare_mdc_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(sbi->ll_lmv_exp, &op_data,
+ err = mdc_create(sbi->ll_md_exp, &op_data,
tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
current->fsuid, current->fsgid, 0, &request);
ptlrpc_req_finished(request);
}
ll_inode2id(&id, inode);
- rc = mdc_getattr(sbi->ll_lmv_exp, &id,
+ rc = mdc_getattr(sbi->ll_md_exp, &id,
OBD_MD_LINKNAME, symlen, request);
if (rc) {
CERROR("inode %lu: rc = %d\n", lli->lli_st_ino, rc);
pno->p_base->pb_name.name,
pno->p_base->pb_name.len,
0);
- err = mdc_create(sbi->ll_lmv_exp, &op_data, NULL, 0, mode,
+ err = mdc_create(sbi->ll_md_exp, &op_data, NULL, 0, mode,
current->fsuid, current->fsgid, dev, &request);
ptlrpc_req_finished(request);
break;
liblustre_wait_event(0);
llu_prepare_mdc_data(&op_data, src, dir, name, namelen, 0);
- rc = mdc_link(llu_i2sbi(src)->ll_lmv_exp, &op_data, &request);
+ rc = mdc_link(llu_i2sbi(src)->ll_md_exp, &op_data, &request);
ptlrpc_req_finished(request);
liblustre_wait_event(0);
liblustre_wait_event(0);
llu_prepare_mdc_data(&op_data, dir, NULL, name, len, 0);
- rc = mdc_unlink(llu_i2sbi(dir)->ll_lmv_exp, &op_data, &request);
+ rc = mdc_unlink(llu_i2sbi(dir)->ll_md_exp, &op_data, &request);
if (!rc)
rc = llu_objects_destroy(request, dir);
ptlrpc_req_finished(request);
LASSERT(tgt);
llu_prepare_mdc_data(&op_data, src, tgt, NULL, 0, 0);
- rc = mdc_rename(llu_i2sbi(src)->ll_lmv_exp, &op_data,
+ rc = mdc_rename(llu_i2sbi(src)->ll_md_exp, &op_data,
oldname, oldnamelen, newname, newnamelen,
&request);
if (!rc) {
int rc;
ENTRY;
- rc = obd_statfs(class_exp2obd(sbi->ll_lmv_exp), osfs, max_age);
+ rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age);
if (rc) {
CERROR("mdc_statfs fails: rc = %d\n", rc);
RETURN(rc);
CDEBUG(D_SUPER, "MDC blocks "LPU64"/"LPU64" objects "LPU64"/"LPU64"\n",
osfs->os_bavail, osfs->os_blocks, osfs->os_ffree,osfs->os_files);
- rc = obd_statfs(class_exp2obd(sbi->ll_lov_exp), &obd_osfs, max_age);
+ rc = obd_statfs(class_exp2obd(sbi->ll_dt_exp), &obd_osfs, max_age);
if (rc) {
CERROR("obd_statfs fails: rc = %d\n", rc);
RETURN(rc);
mode = (mode & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
llu_prepare_mdc_data(&op_data, dir, NULL, name, len, 0);
- err = mdc_create(llu_i2sbi(dir)->ll_lmv_exp, &op_data, NULL, 0, mode,
+ err = mdc_create(llu_i2sbi(dir)->ll_md_exp, &op_data, NULL, 0, mode,
current->fsuid, current->fsgid, 0, &request);
ptlrpc_req_finished(request);
RETURN(err);
name, lli->lli_st_ino, lli->lli_st_generation, dir);
llu_prepare_mdc_data(&op_data, dir, NULL, name, len, S_IFDIR);
- rc = mdc_unlink(llu_i2sbi(dir)->ll_lmv_exp, &op_data, &request);
+ rc = mdc_unlink(llu_i2sbi(dir)->ll_md_exp, &op_data, &request);
ptlrpc_req_finished(request);
RETURN(rc);
CERROR("cannot connect to %s: rc = %d\n", lmv, err);
GOTO(out_free, err);
}
- sbi->ll_lmv_exp = class_conn2export(&lmv_conn);
+ sbi->ll_md_exp = class_conn2export(&lmv_conn);
err = obd_statfs(obd, &osfs, 100000000);
if (err)
CERROR("cannot connect to %s: rc = %d\n", lov, err);
GOTO(out_lmv, err);
}
- sbi->ll_lov_exp = class_conn2export(&lov_conn);
+ sbi->ll_dt_exp = class_conn2export(&lov_conn);
- err = mdc_getstatus(sbi->ll_lmv_exp, &rootid);
+ err = mdc_getstatus(sbi->ll_md_exp, &rootid);
if (err) {
CERROR("cannot mds_connect: rc = %d\n", err);
GOTO(out_lov, err);
sbi->ll_rootino = rootid.li_stc.u.e3s.l3s_ino;
/* fetch attr of root inode */
- err = mdc_getattr(sbi->ll_lmv_exp, &rootid,
+ err = mdc_getattr(sbi->ll_md_exp, &rootid,
OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request);
if (err) {
CERROR("mdc_getattr failed for root: rc = %d\n", err);
GOTO(out_lov, err);
}
- err = mdc_req2lustre_md(sbi->ll_lmv_exp, request, 0,
- sbi->ll_lov_exp, &md);
+ err = mdc_req2lustre_md(sbi->ll_md_exp, request, 0,
+ sbi->ll_dt_exp, &md);
if (err) {
CERROR("failed to understand root inode md: rc = %d\n",err);
GOTO(out_request, err);
out_request:
ptlrpc_req_finished(request);
out_lov:
- obd_disconnect(sbi->ll_lov_exp, 0);
+ obd_disconnect(sbi->ll_dt_exp, 0);
out_lmv:
- obd_disconnect(sbi->ll_lmv_exp, 0);
+ obd_disconnect(sbi->ll_md_exp, 0);
out_free:
OBD_FREE(sbi, sizeof(*sbi));
return err;
RETURN(-ENOENT);
sbi = ll_i2sbi(de->d_inode);
- rc = ll_prep_inode(sbi->ll_lov_exp, sbi->ll_lmv_exp,
+ rc = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&de->d_inode, request, offset, NULL);
RETURN(rc);
(unsigned long) de->d_inode->i_ino,
(unsigned long) de->d_inode->i_generation);
- exp = ll_i2lmvexp(de->d_inode);
+ exp = ll_i2mdexp(de->d_inode);
ll_inode2id(&pid, de->d_parent->d_inode);
ll_inode2id(&cid, de->d_inode);
LASSERT(id_fid(&cid) != 0);
unlock_kernel();
handle = (flag) ? &ldd->lld_mnt_och : &ldd->lld_cwd_och;
- rc = obd_pin(sbi->ll_lmv_exp, inode->i_ino, inode->i_generation,
+ rc = obd_pin(sbi->ll_md_exp, inode->i_ino, inode->i_generation,
inode->i_mode & S_IFMT, handle, flag);
if (rc) {
return;
}
- rc = obd_unpin(sbi->ll_lmv_exp, &handle, flag);
+ rc = obd_unpin(sbi->ll_md_exp, &handle, flag);
EXIT;
}
LASSERT(dentry->d_parent && dentry->d_parent->d_inode);
ll_inode2id(&parent, dentry->d_parent->d_inode);
ll_inode2id(&child, inode);
- md_change_cbdata_name(sbi->ll_lmv_exp, &parent,
+ md_change_cbdata_name(sbi->ll_md_exp, &parent,
(char *)dentry->d_name.name,
dentry->d_name.len, &child,
null_if_equal, inode);
LASSERT(dentry->d_parent && dentry->d_parent->d_inode);
ll_inode2id(&parent, dentry->d_parent->d_inode);
ll_inode2id(&child, inode);
- md_change_cbdata_name(sbi->ll_lmv_exp, &parent,
+ md_change_cbdata_name(sbi->ll_md_exp, &parent,
(char *)dentry->d_name.name,
dentry->d_name.len, &child,
null_if_equal, inode);
id_fid(&ll_i2info(inode)->lli_id));
offset = page->index << PAGE_SHIFT;
- rc = md_readpage(ll_i2sbi(inode)->ll_lmv_exp, &id, offset,
+ rc = md_readpage(ll_i2sbi(inode)->ll_md_exp, &id, offset,
page, &request);
if (!rc) {
body = lustre_msg_buf(request->rq_repmsg, 0, sizeof(*body));
struct ldlm_res_id res_id =
{ .name = { id_fid(&li->lli_id), id_group(&li->lli_id)} };
struct lustre_handle lockh;
- struct obd_device *obddev = class_exp2obd(ll_i2sbi(dir)->ll_lmv_exp);
+ struct obd_device *obddev = class_exp2obd(ll_i2sbi(dir)->ll_md_exp);
struct address_space *mapping = dir->i_mapping;
struct page *page;
ldlm_policy_data_t policy = { .l_inodebits = { MDS_INODELOCK_UPDATE } };
int rc;
- obddev = md_get_real_obd(ll_i2sbi(dir)->ll_lmv_exp, NULL, 0);
+ obddev = md_get_real_obd(ll_i2sbi(dir)->ll_md_exp, NULL, 0);
rc = ldlm_lock_match(obddev->obd_namespace, LDLM_FL_BLOCK_GRANTED,
&res_id, LDLM_IBITS, &policy, LCK_PR, &lockh);
if (!rc) {
ll_prepare_mdc_data(op_data, dir, NULL, NULL, 0, 0);
- rc = md_enqueue(ll_i2sbi(dir)->ll_lmv_exp, LDLM_IBITS, &it,
+ rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, LDLM_IBITS, &it,
LCK_PR, op_data, &lockh, NULL, 0,
ldlm_completion_ast, ll_mdc_blocking_ast, dir);
OBD_FREE(op_data, sizeof(*op_data));
if (op_data == NULL)
GOTO(out, err = -ENOMEM);
ll_prepare_mdc_data(op_data, inode, NULL, name,lums.lums_namelen,0);
- err = md_create(sbi->ll_lmv_exp, op_data, &nstripes, sizeof(nstripes),
+ err = md_create(sbi->ll_md_exp, op_data, &nstripes, sizeof(nstripes),
mode, current->fsuid, current->fsgid, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
ptlrpc_req_finished(request);
valid = OBD_MD_FLID;
ll_inode2id(&id, inode);
- rc = md_getattr_lock(sbi->ll_lmv_exp, &id,
+ rc = md_getattr_lock(sbi->ll_md_exp, &id,
filename, namelen, valid, 0, &request);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_lock: %d\n", rc);
ll_prepare_mdc_data(op_data, inode, NULL, NULL, 0, 0);
- rc = md_setattr(sbi->ll_lmv_exp, op_data, &attr, &lum,
+ rc = md_setattr(sbi->ll_md_exp, op_data, &attr, &lum,
sizeof(lum), NULL, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
ptlrpc_req_finished(request);
valid |= OBD_MD_FLDIREA;
ll_inode2id(&id, inode);
- rc = md_getattr(sbi->ll_lmv_exp, &id, valid,
- obd_size_diskmd(sbi->ll_lov_exp, NULL),
+ rc = md_getattr(sbi->ll_md_exp, &id, valid,
+ obd_size_diskmd(sbi->ll_dt_exp, NULL),
&request);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr failed: rc = %d\n", rc);
ll_inode2id(&id, inode);
- rc = ll_get_fid(sbi->ll_lmv_exp, &id, filename, &id);
+ rc = ll_get_fid(sbi->ll_md_exp, &id, filename, &id);
if (rc < 0)
GOTO(out_filename, rc);
RETURN(PTR_ERR(filename));
ll_inode2id(&id, inode);
- rc = md_getattr_lock(sbi->ll_lmv_exp, &id, filename,
+ rc = md_getattr_lock(sbi->ll_md_exp, &id, filename,
strlen(filename) + 1, OBD_MD_FLEASIZE,
- obd_size_diskmd(sbi->ll_lov_exp, NULL),
+ obd_size_diskmd(sbi->ll_dt_exp, NULL),
&request);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_lock failed on %s: rc %d\n",
bufs[1] = NULL;
}
size = data->ioc_plen1;
- req = ptlrpc_prep_req(sbi2lmv(sbi)->cl_import,
+ req = ptlrpc_prep_req(sbi2md(sbi)->cl_import,
LUSTRE_LOG_VERSION, LLOG_CATINFO,
2, lens, bufs);
if (!req)
RETURN(rc);
}
default:
- return obd_iocontrol(cmd, sbi->ll_lov_exp, 0,
+ return obd_iocontrol(cmd, sbi->ll_dt_exp, 0,
NULL, (void *)arg);
}
}
#include "llite_internal.h"
#include <linux/obd_lov.h>
-int ll_mdc_close(struct obd_export *lmv_exp, struct inode *inode,
- struct file *file)
+int ll_md_close(struct obd_export *md_exp, struct inode *inode,
+ struct file *file)
{
struct ll_file_data *fd = file->private_data;
struct ptlrpc_request *req = NULL;
obdo->o_valid |= OBD_MD_FLFLAGS;
}
obdo->o_mds = id_group(&ll_i2info(inode)->lli_id);
- rc = md_close(lmv_exp, obdo, och, &req);
+ rc = md_close(md_exp, obdo, och, &req);
obdo_free(obdo);
if (rc == EAGAIN) {
inode->i_ino, rc);
}
- mdc_clear_open_replay_data(lmv_exp, och);
+ mdc_clear_open_replay_data(md_exp, och);
ptlrpc_req_finished(req);
och->och_fh.cookie = DEAD_HANDLE_MAGIC;
file->private_data = NULL;
fd = (struct ll_file_data *)file->private_data;
LASSERT(fd != NULL);
- rc = ll_mdc_close(sbi->ll_lmv_exp, inode, file);
+ rc = ll_md_close(sbi->ll_md_exp, inode, file);
RETURN(rc);
}
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, parent->d_inode, NULL, name, len, O_RDWR);
- rc = md_enqueue(sbi->ll_lmv_exp, LDLM_IBITS, itp, LCK_PR, op_data,
+ rc = md_enqueue(sbi->ll_md_exp, LDLM_IBITS, itp, LCK_PR, op_data,
&lockh, lmm, lmmsize, ldlm_completion_ast,
ll_mdc_blocking_ast, NULL);
OBD_FREE(op_data, sizeof(*op_data));
{
struct ptlrpc_request *req = it->d.lustre.it_data;
struct ll_inode_info *lli = ll_i2info(file->f_dentry->d_inode);
- struct obd_export *lmv_exp = ll_i2lmvexp(file->f_dentry->d_inode);
+ struct obd_export *md_exp = ll_i2mdexp(file->f_dentry->d_inode);
struct ll_file_data *fd;
struct mds_body *body;
ENTRY;
OBD_SLAB_ALLOC(fd, ll_file_data_slab, SLAB_KERNEL, sizeof *fd);
/* We can't handle this well without reorganizing ll_file_open and
- * ll_mdc_close, so don't even try right now. */
+ * ll_md_close(), so don't even try right now. */
LASSERT(fd != NULL);
memcpy(&fd->fd_mds_och.och_fh, &body->handle, sizeof(body->handle));
lli->lli_io_epoch = body->io_epoch;
- mdc_set_open_replay_data(lmv_exp, &fd->fd_mds_och, it->d.lustre.it_data);
+ mdc_set_open_replay_data(md_exp, &fd->fd_mds_och, it->d.lustre.it_data);
RETURN(0);
}
{
struct ll_inode_info *lli = ll_i2info(inode);
struct lov_stripe_md *lsm = lli->lli_smd;
- struct obd_export *exp = ll_i2obdexp(inode);
+ struct obd_export *exp = ll_i2dtexp(inode);
struct {
char name[16];
struct ldlm_lock *lock;
CDEBUG(D_DLMTRACE, "Glimpsing inode %lu\n", inode->i_ino);
- rc = obd_enqueue(sbi->ll_lov_exp, lli->lli_smd, LDLM_EXTENT, &policy,
+ rc = obd_enqueue(sbi->ll_dt_exp, lli->lli_smd, LDLM_EXTENT, &policy,
LCK_PR, &flags, ll_extent_lock_callback,
ldlm_completion_ast, ll_glimpse_callback, inode,
sizeof(struct ost_lvb), lustre_swab_ost_lvb, &lockh);
CDEBUG(D_DLMTRACE, "glimpse: size: "LPU64", blocks: "LPU64"\n",
(__u64)inode->i_size, (__u64)inode->i_blocks);
- obd_cancel(sbi->ll_lov_exp, lli->lli_smd, LCK_PR, &lockh);
+ obd_cancel(sbi->ll_dt_exp, lli->lli_smd, LCK_PR, &lockh);
RETURN(rc);
}
inode->i_ino, policy->l_extent.start, policy->l_extent.end);
do_gettimeofday(&start);
- rc = obd_enqueue(sbi->ll_lov_exp, lsm, LDLM_EXTENT, policy, mode,
+ rc = obd_enqueue(sbi->ll_dt_exp, lsm, LDLM_EXTENT, policy, mode,
&ast_flags, ll_extent_lock_callback,
ldlm_completion_ast, ll_glimpse_callback, inode,
sizeof(struct ost_lvb), lustre_swab_ost_lvb, lockh);
(sbi->ll_flags & LL_SBI_NOLCK))
RETURN(0);
- rc = obd_cancel(sbi->ll_lov_exp, lsm, mode, lockh);
+ rc = obd_cancel(sbi->ll_dt_exp, lsm, mode, lockh);
RETURN(rc);
}
unsigned long arg)
{
struct ll_inode_info *lli = ll_i2info(inode);
- struct obd_export *exp = ll_i2obdexp(inode);
+ struct obd_export *exp = ll_i2dtexp(inode);
struct ll_recreate_obj ucreatp;
struct obd_trans_info oti = { 0 };
struct obdo *oa = NULL;
{
struct ll_inode_info *lli = ll_i2info(inode);
struct file *f;
- struct obd_export *exp = ll_i2obdexp(inode);
+ struct obd_export *exp = ll_i2dtexp(inode);
struct lov_stripe_md *lsm;
struct lookup_intent oit = {.it_op = IT_OPEN, .it_flags = flags};
struct ptlrpc_request *req = NULL;
if (rc < 0)
GOTO(out, rc);
- rc = mdc_req2lustre_md(ll_i2lmvexp(inode), req, 1, exp, &md);
+ rc = mdc_req2lustre_md(ll_i2mdexp(inode), req, 1, exp, &md);
if (rc)
GOTO(out, rc);
ll_update_inode(f->f_dentry->d_inode, &md);
rc = ll_lov_setstripe_ea_info(inode, file, flags, &lum, sizeof(lum));
if (rc == 0) {
put_user(0, &lump->lmm_stripe_count);
- rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2obdexp(inode),
+ rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2dtexp(inode),
0, ll_i2info(inode)->lli_smd, lump);
}
RETURN(rc);
if (!lsm)
RETURN(-ENODATA);
- return obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2obdexp(inode), 0, lsm,
+ return obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2dtexp(inode), 0, lsm,
(void *)arg);
}
ll_inode2id(&id, inode);
- rc = ll_get_fid(sbi->ll_lmv_exp, &id, filename, &id);
+ rc = ll_get_fid(sbi->ll_md_exp, &id, filename, &id);
if (rc < 0)
GOTO(out_filename, rc);
case EXT3_IOC_SETVERSION:
*/
default:
- RETURN( obd_iocontrol(cmd, ll_i2obdexp(inode), 0, NULL,
+ RETURN( obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
(void *)arg) );
}
}
rc = filemap_fdatawait(inode->i_mapping);
ll_inode2id(&id, inode);
- err = md_sync(ll_i2sbi(inode)->ll_lmv_exp, &id, &req);
+ err = md_sync(ll_i2sbi(inode)->ll_md_exp, &id, &req);
if (!rc)
rc = err;
if (!err)
OBD_MD_FLMTIME | OBD_MD_FLCTIME |
OBD_MD_FLGROUP));
- err = obd_sync(ll_i2sbi(inode)->ll_lov_exp, oa, lsm,
+ err = obd_sync(ll_i2sbi(inode)->ll_dt_exp, oa, lsm,
0, OBD_OBJECT_EOF);
if (!rc)
rc = err;
"start="LPU64", end="LPU64"\n", inode->i_ino, flock.l_flock.pid,
flags, mode, flock.l_flock.start, flock.l_flock.end);
- obddev = md_get_real_obd(sbi->ll_lmv_exp, NULL, 0);
+ obddev = md_get_real_obd(sbi->ll_md_exp, NULL, 0);
rc = ldlm_cli_enqueue(obddev->obd_self_export, NULL,
obddev->obd_namespace,
res_id, LDLM_FLOCK, &flock, mode, &flags,
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_REVALIDATE);
#endif
- rc = md_intent_lock(sbi->ll_lmv_exp, &id, NULL, 0, NULL, 0, &id,
+ rc = md_intent_lock(sbi->ll_md_exp, &id, NULL, 0, NULL, 0, &id,
&oit, 0, &req, ll_mdc_blocking_ast);
if (rc < 0)
GOTO(out, rc);
GOTO(out, rc);
}
- rc = ll_lsm_getattr(ll_i2obdexp(inode), lli->lli_smd, obdo);
+ rc = ll_lsm_getattr(ll_i2dtexp(inode), lli->lli_smd, obdo);
if (rc) {
CERROR("inode_getattr failed (%d): unable to send DONE_WRITING "
"for inode %lu/%u\n", rc, inode->i_ino,
spinlock_t ll_lock;
struct obd_uuid ll_sb_uuid;
- struct obd_export *ll_lmv_exp;
- struct lmv_desc ll_lmv_desc;
- struct obd_export *ll_lov_exp;
- struct lov_desc ll_lov_desc;
+ struct obd_export *ll_md_exp;
+ struct obd_export *ll_dt_exp;
+ struct lov_desc ll_dt_desc;
struct proc_dir_entry *ll_proc_root;
struct lustre_id ll_rootid; /* root lustre id */
int ll_lsm_getattr(struct obd_export *, struct lov_stripe_md *, struct obdo *);
int ll_glimpse_size(struct inode *inode);
int ll_local_open(struct file *file, struct lookup_intent *it);
-int ll_mdc_close(struct obd_export *lmv_exp, struct inode *inode,
+int ll_md_close(struct obd_export *md_exp, struct inode *inode,
struct file *file);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
int ll_getattr(struct vfsmount *mnt, struct dentry *de,
#endif
/* don't need an addref as the sb_info should be holding one */
-static inline struct obd_export *ll_s2obdexp(struct super_block *sb)
+static inline struct obd_export *ll_s2dtexp(struct super_block *sb)
{
- return ll_s2sbi(sb)->ll_lov_exp;
+ return ll_s2sbi(sb)->ll_dt_exp;
}
/* don't need an addref as the sb_info should be holding one */
-static inline struct obd_export *ll_s2lmvexp(struct super_block *sb)
+static inline struct obd_export *ll_s2mdexp(struct super_block *sb)
{
- return ll_s2sbi(sb)->ll_lmv_exp;
+ return ll_s2sbi(sb)->ll_md_exp;
}
-static inline struct client_obd *sbi2lmv(struct ll_sb_info *sbi)
+static inline struct client_obd *sbi2md(struct ll_sb_info *sbi)
{
- struct obd_device *obd = sbi->ll_lmv_exp->exp_obd;
+ struct obd_device *obd = sbi->ll_md_exp->exp_obd;
if (obd == NULL)
LBUG();
return &obd->u.cli;
return ll_s2sbi(inode->i_sb);
}
-static inline struct obd_export *ll_i2obdexp(struct inode *inode)
+static inline struct obd_export *ll_i2dtexp(struct inode *inode)
{
- return ll_s2obdexp(inode->i_sb);
+ return ll_s2dtexp(inode->i_sb);
}
-static inline struct obd_export *ll_i2lmvexp(struct inode *inode)
+static inline struct obd_export *ll_i2mdexp(struct inode *inode)
{
- return ll_s2lmvexp(inode->i_sb);
+ return ll_s2mdexp(inode->i_sb);
}
static inline int ll_mds_max_easize(struct super_block *sb)
{
- return sbi2lmv(ll_s2sbi(sb))->cl_max_mds_easize;
+ return sbi2md(ll_s2sbi(sb))->cl_max_mds_easize;
}
static inline __u64 ll_file_maxbytes(struct inode *inode)
EXIT;
}
-int lustre_init_lov_desc(struct ll_sb_info *sbi)
+int lustre_init_dt_desc(struct ll_sb_info *sbi)
{
int valsize, rc;
ENTRY;
- valsize = sizeof(sbi->ll_lov_desc);
- memset(&sbi->ll_lov_desc, 0, sizeof(sbi->ll_lov_desc));
- rc = obd_get_info(sbi->ll_lov_exp, strlen("lovdesc") + 1,
- "lovdesc", &valsize, &sbi->ll_lov_desc);
- RETURN(rc);
-}
-
-int lustre_init_lmv_desc(struct ll_sb_info *sbi)
-{
- int valsize, rc;
- ENTRY;
-
- valsize = sizeof(sbi->ll_lmv_desc);
- memset(&sbi->ll_lmv_desc, 0, sizeof(sbi->ll_lmv_desc));
- rc = obd_get_info(sbi->ll_lmv_exp, strlen("lmvdesc") + 1,
- "lmvdesc", &valsize, &sbi->ll_lmv_desc);
+ valsize = sizeof(sbi->ll_dt_desc);
+ memset(&sbi->ll_dt_desc, 0, sizeof(sbi->ll_dt_desc));
+ rc = obd_get_info(sbi->ll_dt_exp, strlen("lovdesc") + 1,
+ "lovdesc", &valsize, &sbi->ll_dt_desc);
RETURN(rc);
}
{
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct ptlrpc_request *request = NULL;
- struct lustre_handle lov_conn = {0, };
- struct lustre_handle lmv_conn = {0, };
+ struct lustre_handle dt_conn = {0, };
+ struct lustre_handle md_conn = {0, };
struct inode *root = NULL;
struct obd_device *obd;
struct obd_statfs osfs;
CERROR("could not register mount in /proc/lustre");
}
- err = obd_connect(&lmv_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
+ err = obd_connect(&md_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
if (err == -EBUSY) {
CERROR("An MDS (mdc %s) is performing recovery, of which this"
" client is not a part. Please wait for recovery to "
CERROR("cannot connect to %s: rc = %d\n", lmv, err);
GOTO(out, err);
}
- sbi->ll_lmv_exp = class_conn2export(&lmv_conn);
-
- lustre_init_lmv_desc(sbi);
-
+ sbi->ll_md_exp = class_conn2export(&md_conn);
err = obd_statfs(obd, &osfs, jiffies - HZ);
if (err)
GOTO(out_lmv, err);
sb->s_blocksize_bits = log2(osfs.os_bsize);
sb->s_maxbytes = PAGE_CACHE_MAXBYTES;
- devno = get_uuid2int(sbi->ll_lmv_exp->exp_obd->obd_uuid.uuid,
- strlen(sbi->ll_lmv_exp->exp_obd->obd_uuid.uuid));
+ devno = get_uuid2int(sbi->ll_md_exp->exp_obd->obd_uuid.uuid,
+ strlen(sbi->ll_md_exp->exp_obd->obd_uuid.uuid));
sb->s_dev = devno;
GOTO(out_lmv, err);
}
- err = obd_connect(&lov_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
+ err = obd_connect(&dt_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
if (err == -EBUSY) {
CERROR("An OST (osc %s) is performing recovery, of which this"
" client is not a part. Please wait for recovery to "
CERROR("cannot connect to %s: rc = %d\n", lov, err);
GOTO(out_lmv, err);
}
- sbi->ll_lov_exp = class_conn2export(&lov_conn);
+ sbi->ll_dt_exp = class_conn2export(&dt_conn);
- err = lustre_init_lov_desc(sbi);
+ err = lustre_init_dt_desc(sbi);
if (err == 0) {
- int mdsize = obd_size_diskmd(sbi->ll_lov_exp, NULL);
- obd_init_ea_size(sbi->ll_lmv_exp, mdsize,
- sbi->ll_lov_desc.ld_tgt_count *
+ int mdsize = obd_size_diskmd(sbi->ll_dt_exp, NULL);
+ obd_init_ea_size(sbi->ll_md_exp, mdsize,
+ sbi->ll_dt_desc.ld_tgt_count *
sizeof(struct llog_cookie));
}
- err = md_getstatus(sbi->ll_lmv_exp, &sbi->ll_rootid);
+ err = md_getstatus(sbi->ll_md_exp, &sbi->ll_rootid);
if (err) {
CERROR("cannot mds_connect: rc = %d\n", err);
GOTO(out_lov, err);
/* make root inode
* XXX: move this to after cbd setup? */
- err = md_getattr(sbi->ll_lmv_exp, &sbi->ll_rootid,
- OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS | OBD_MD_FID,
+ err = md_getattr(sbi->ll_md_exp, &sbi->ll_rootid,
+ OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS,
0, &request);
if (err) {
CERROR("md_getattr failed for root: rc = %d\n", err);
GOTO(out_lov, err);
}
- err = mdc_req2lustre_md(sbi->ll_lmv_exp, request, 0,
- sbi->ll_lov_exp, &md);
+ err = mdc_req2lustre_md(sbi->ll_md_exp, request, 0,
+ sbi->ll_dt_exp, &md);
if (err) {
CERROR("failed to understand root inode md: rc = %d\n", err);
ptlrpc_req_finished(request);
if (root)
iput(root);
out_lov:
- obd_disconnect(sbi->ll_lov_exp, 0);
+ obd_disconnect(sbi->ll_dt_exp, 0);
out_lmv:
- obd_disconnect(sbi->ll_lmv_exp, 0);
+ obd_disconnect(sbi->ll_md_exp, 0);
out:
lprocfs_unregister_mountpoint(sbi);
return err;
ll_close_thread_shutdown(sbi->ll_lcq);
list_del(&sbi->ll_conn_chain);
- obd_disconnect(sbi->ll_lov_exp, 0);
+ obd_disconnect(sbi->ll_dt_exp, 0);
lprocfs_unregister_mountpoint(sbi);
if (sbi->ll_proc_root) {
sbi->ll_proc_root = NULL;
}
- obd_disconnect(sbi->ll_lmv_exp, 0);
+ obd_disconnect(sbi->ll_md_exp, 0);
// We do this to get rid of orphaned dentries. That is not really trw.
spin_lock(&dcache_lock);
struct portals_cfg pcfg;
char *peer = "MDS_PEER_UUID";
struct obd_device *obd;
- struct lustre_handle lmv_conn = {0, };
+ struct lustre_handle md_conn = {0, };
struct obd_export *exp;
char *name = "mdc_dev";
class_uuid_t uuid;
if (err)
GOTO(out_cleanup, err);
- err = obd_connect(&lmv_conn, obd, &lmv_uuid, 0);
+ err = obd_connect(&md_conn, obd, &lmv_uuid, 0);
if (err) {
CERROR("cannot connect to %s: rc = %d\n", lmd->lmd_mds, err);
GOTO(out_cleanup, err);
}
- exp = class_conn2export(&lmv_conn);
+ exp = class_conn2export(&md_conn);
ctxt = llog_get_context(&exp->exp_obd->obd_llogs,LLOG_CONFIG_REPL_CTXT);
rc = class_config_process_llog(ctxt, profile, cfg);
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
- obd = class_exp2obd(sbi->ll_lmv_exp);
+ obd = class_exp2obd(sbi->ll_md_exp);
if (obd)
force_umount = obd->obd_no_recov;
obd = NULL;
int ll_process_config_update(struct ll_sb_info *sbi, int clean)
{
- struct obd_export *lmv_exp = sbi->ll_lmv_exp;
+ struct obd_export *md_exp = sbi->ll_md_exp;
struct lustre_mount_data *lmd = sbi->ll_lmd;
struct llog_ctxt *ctxt;
struct config_llog_instance cfg;
RETURN(0);
}
- rc = ldlm_cli_cancel_unused(lmv_exp->exp_obd->obd_namespace, NULL,
+ rc = ldlm_cli_cancel_unused(md_exp->exp_obd->obd_namespace, NULL,
LDLM_FL_CONFIG_CHANGE, NULL);
if (rc != 0)
CWARN("ldlm_cli_cancel_unused(mdc): %d\n", rc);
- rc = obd_cancel_unused(sbi->ll_lov_exp, NULL, LDLM_FL_CONFIG_CHANGE,
+ rc = obd_cancel_unused(sbi->ll_dt_exp, NULL, LDLM_FL_CONFIG_CHANGE,
NULL);
if (rc != 0)
CWARN("obd_cancel_unused(lov): %d\n", rc);
CWARN("Applying configuration log %s\n", name);
- ctxt = llog_get_context(&lmv_exp->exp_obd->obd_llogs,
+ ctxt = llog_get_context(&md_exp->exp_obd->obd_llogs,
LLOG_CONFIG_REPL_CTXT);
rc = class_config_process_llog(ctxt, name, &cfg);
if (rc == 0)
struct lov_desc desc;
int rc, valsize;
valsize = sizeof(desc);
- rc = obd_get_info(sbi->ll_lov_exp, strlen("lovdesc") + 1,
+ rc = obd_get_info(sbi->ll_dt_exp, strlen("lovdesc") + 1,
"lovdesc", &valsize, &desc);
- rc = obd_init_ea_size(lmv_exp,
- obd_size_diskmd(sbi->ll_lov_exp, NULL),
+ rc = obd_init_ea_size(md_exp,
+ obd_size_diskmd(sbi->ll_dt_exp, NULL),
(desc.ld_tgt_count *
sizeof(struct llog_cookie)));
}
ll_inode2id(&id, inode);
clear_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &(ll_i2info(inode)->lli_flags));
- md_change_cbdata(sbi->ll_lmv_exp, &id, null_if_equal, inode);
+ md_change_cbdata(sbi->ll_md_exp, &id, null_if_equal, inode);
if (lli->lli_smd)
- obd_change_cbdata(sbi->ll_lov_exp, lli->lli_smd,
+ obd_change_cbdata(sbi->ll_dt_exp, lli->lli_smd,
null_if_equal, inode);
if (lli->lli_smd) {
- obd_free_memmd(sbi->ll_lov_exp, &lli->lli_smd);
+ obd_free_memmd(sbi->ll_dt_exp, &lli->lli_smd);
lli->lli_smd = NULL;
}
if (lli->lli_mea) {
- obd_free_memmd(sbi->ll_lmv_exp,
+ obd_free_memmd(sbi->ll_md_exp,
(struct lov_stripe_md **) &lli->lli_mea);
lli->lli_mea = NULL;
}
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, inode, NULL, NULL, 0, 0);
- rc = md_setattr(sbi->ll_lmv_exp, op_data,
+ rc = md_setattr(sbi->ll_md_exp, op_data,
attr, NULL, 0, NULL, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc) {
RETURN(rc);
}
- rc = mdc_req2lustre_md(sbi->ll_lmv_exp, request, 0,
- sbi->ll_lov_exp, &md);
+ rc = mdc_req2lustre_md(sbi->ll_md_exp, request, 0,
+ sbi->ll_dt_exp, &md);
if (rc) {
ptlrpc_req_finished(request);
RETURN(rc);
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
obdo_from_inode(oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
- rc = obd_setattr(sbi->ll_lov_exp, oa, lsm, NULL);
+ rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL);
obdo_free(oa);
if (rc)
CERROR("obd_setattr fails: rc = %d\n", rc);
int rc;
ENTRY;
- rc = obd_statfs(class_exp2obd(sbi->ll_lmv_exp), osfs, max_age);
+ rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age);
if (rc) {
CERROR("mdc_statfs fails: rc = %d\n", rc);
RETURN(rc);
CDEBUG(D_SUPER, "MDC blocks "LPU64"/"LPU64" objects "LPU64"/"LPU64"\n",
osfs->os_bavail, osfs->os_blocks, osfs->os_ffree,osfs->os_files);
- rc = obd_statfs(class_exp2obd(sbi->ll_lov_exp), &obd_osfs, max_age);
+ rc = obd_statfs(class_exp2obd(sbi->ll_dt_exp), &obd_osfs, max_age);
if (rc) {
CERROR("obd_statfs fails: rc = %d\n", rc);
RETURN(rc);
void ll_update_inode(struct inode *inode, struct lustre_md *md)
{
- struct ll_sb_info *sbi = ll_s2sbi(inode->i_sb);
struct ll_inode_info *lli = ll_i2info(inode);
struct lov_stripe_md *lsm = md->lsm;
struct mds_body *body = md->body;
LASSERTF(lsm->lsm_xfersize != 0, "%lu\n", lsm->lsm_xfersize);
inode->i_blksize = min(lsm->lsm_xfersize, LL_MAX_BLKSIZE);
if (lli->lli_smd != lsm)
- obd_free_memmd(ll_i2obdexp(inode), &lsm);
+ obd_free_memmd(ll_i2dtexp(inode), &lsm);
}
if (mea != NULL) {
}
}
if (lli->lli_mea != mea)
- obd_free_memmd(ll_i2lmvexp(inode),
+ obd_free_memmd(ll_i2mdexp(inode),
(struct lov_stripe_md **) &mea);
}
- /*
- * updating inode lustre id. We try optimize things a little bit here,
- * thus do not do it all the time.
- */
- if (body->valid & OBD_MD_FID) {
- LASSERT(id_fid(&body->id1) != 0);
- id_assign_fid(&lli->lli_id, &body->id1);
- }
+ LASSERT(id_fid(&body->id1) != 0);
+ id_assign_fid(&lli->lli_id, &body->id1);
if ((body->valid & OBD_MD_FLID) || (body->valid & OBD_MD_FLGENER))
id_assign_stc(&lli->lli_id, &body->id1);
inode->i_dev = (kdev_t)id_group(&lli->lli_id);
#endif
LASSERT(id_fid(&lli->lli_id) != 0);
-
- LASSERT(!sbi->ll_lmv_desc.ld_tgt_count ||
- id_group(&lli->lli_id) < sbi->ll_lmv_desc.ld_tgt_count);
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
ll_inode2id(&id, inode);
- rc = md_delete_inode(sbi->ll_lmv_exp, &id);
+ rc = md_delete_inode(sbi->ll_md_exp, &id);
if (rc) {
CERROR("md_delete_inode() failed, error %d\n",
rc);
struct mds_body *body;
ll_inode2id(&id, inode);
- rc = md_getattr(sbi->ll_lmv_exp, &id, valid, 0, &req);
+ rc = md_getattr(sbi->ll_md_exp, &id, valid, 0, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
RETURN(-abs(rc));
attr.ia_attr_flags = flags;
attr.ia_valid |= ATTR_ATTR_FLAG;
- rc = md_setattr(sbi->ll_lmv_exp, op_data,
+ rc = md_setattr(sbi->ll_md_exp, op_data,
&attr, NULL, 0, NULL, 0, &req);
OBD_FREE(op_data, sizeof(*op_data));
if (rc) {
oa->o_flags = flags;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
- rc = obd_setattr(sbi->ll_lov_exp, oa, lsm, NULL);
+ rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL);
obdo_free(oa);
if (rc) {
if (rc != -EPERM && rc != -EACCES)
CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb,
sb->s_count, atomic_read(&sb->s_active));
- obd = class_exp2obd(sbi->ll_lmv_exp);
+ obd = class_exp2obd(sbi->ll_md_exp);
if (obd == NULL) {
CERROR("Invalid MDC connection handle "LPX64"\n",
- sbi->ll_lmv_exp->exp_handle.h_cookie);
+ sbi->ll_md_exp->exp_handle.h_cookie);
EXIT;
return;
}
obd->obd_no_recov = 1;
- obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_lmv_exp,
+ obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_md_exp,
sizeof(ioc_data), &ioc_data, NULL);
- obd = class_exp2obd(sbi->ll_lov_exp);
+ obd = class_exp2obd(sbi->ll_dt_exp);
if (obd == NULL) {
CERROR("Invalid LOV connection handle "LPX64"\n",
- sbi->ll_lov_exp->exp_handle.h_cookie);
+ sbi->ll_dt_exp->exp_handle.h_cookie);
EXIT;
return;
}
obd->obd_no_recov = 1;
- obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_lov_exp,
+ obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_dt_exp,
sizeof(ioc_data), &ioc_data, NULL);
/*
EXIT;
}
-int ll_prep_inode(struct obd_export *lov_exp, struct obd_export *lmv_exp,
+int ll_prep_inode(struct obd_export *dt_exp, struct obd_export *md_exp,
struct inode **inode, struct ptlrpc_request *req,
int offset, struct super_block *sb)
{
struct lustre_md md;
int rc = 0;
- rc = mdc_req2lustre_md(lmv_exp, req, offset, lov_exp, &md);
+ rc = mdc_req2lustre_md(md_exp, req, offset, dt_exp, &md);
if (rc)
RETURN(rc);
if (*inode == NULL || is_bad_inode(*inode)) {
/* free the lsm if we allocated one above */
if (md.lsm != NULL)
- obd_free_memmd(lov_exp, &md.lsm);
+ obd_free_memmd(dt_exp, &md.lsm);
if (md.mea != NULL)
- obd_free_memmd(lmv_exp,
+ obd_free_memmd(md_exp,
(struct lov_stripe_md**)&md.mea);
rc = -ENOMEM;
CERROR("new_inode -fatal: rc %d\n", rc);
{
struct ptlrpc_request *request = NULL;
struct mds_body *body;
- __u64 valid = 0;
int rc;
- valid |= OBD_MD_FID;
-
rc = md_getattr_lock(exp, idp, filename, strlen(filename) + 1,
- valid, 0, &request);
+ 0, 0, &request);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_lock failed on %s: rc %d\n",
filename, rc);
if (inode)
return inode;
if (S_ISREG(mode)) {
- eadatalen = obd_size_diskmd(sbi->ll_lov_exp, NULL);
+ eadatalen = obd_size_diskmd(sbi->ll_dt_exp, NULL);
valid |= OBD_MD_FLEASIZE;
}
id_type(&id) = mode;
id_ino(&id) = (__u64)ino;
id_gen(&id) = generation;
- rc = md_getattr(sbi->ll_lmv_exp, &id, valid, eadatalen, &req);
+ rc = md_getattr(sbi->ll_md_exp, &id, valid, eadatalen, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, ino);
return ERR_PTR(rc);
}
- rc = ll_prep_inode(sbi->ll_lov_exp, sbi->ll_lmv_exp,
+ rc = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&inode, req, 0, sb);
if (rc) {
ptlrpc_req_finished(req);
if (!it_disposition(it, DISP_LOOKUP_NEG)) {
ENTRY;
- rc = ll_prep_inode(sbi->ll_lov_exp, sbi->ll_lmv_exp,
+ rc = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&inode, request, offset, dentry->d_sb);
if (rc)
RETURN(rc);
icbd.icbd_parent = parent;
ll_inode2id(&pid, parent);
- rc = md_intent_lock(ll_i2lmvexp(parent), &pid,
+ rc = md_intent_lock(ll_i2mdexp(parent), &pid,
dentry->d_name.name, dentry->d_name.len, NULL, 0,
NULL, it, flags, &req, ll_mdc_blocking_ast);
if (rc < 0)
LASSERT(it && it->d.lustre.it_disposition);
request = it->d.lustre.it_data;
- rc = ll_prep_inode(sbi->ll_lov_exp, sbi->ll_lmv_exp,
+ rc = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&inode, request, 1, dir->i_sb);
if (rc)
GOTO(out, inode = ERR_PTR(rc));
{
struct inode *inode;
struct ptlrpc_request *request = it->d.lustre.it_data;
- struct obd_export *lmv_exp = ll_i2lmvexp(dir);
+ struct obd_export *md_exp = ll_i2mdexp(dir);
int rc = 0;
ENTRY;
if (rc)
RETURN(rc);
- mdc_store_inode_generation(lmv_exp, request, MDS_REQ_INTENT_REC_OFF, 1);
+ mdc_store_inode_generation(md_exp, request, MDS_REQ_INTENT_REC_OFF, 1);
inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
NULL, 0, mode, 0, it);
if (IS_ERR(inode))
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, 0);
- err = md_create(sbi->ll_lmv_exp, op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, rdev,
&request);
OBD_FREE(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, 0);
- err = md_create(sbi->ll_lmv_exp, op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, rdev,
&request);
OBD_FREE(op_data, sizeof(*op_data));
ll_update_times(request, 0, dir);
- err = ll_prep_inode(sbi->ll_lov_exp, sbi->ll_lmv_exp,
+ err = ll_prep_inode(sbi->ll_dt_exp, sbi->ll_md_exp,
&inode, request, 0, child->d_sb);
if (err)
GOTO(out_err, err);
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, 0);
- err = md_create(sbi->ll_lmv_exp, op_data,
+ err = md_create(sbi->ll_md_exp, op_data,
tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
current->fsuid, current->fsgid, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, src, dir, name, len, 0);
- err = md_link(sbi->ll_lmv_exp, op_data, &request);
+ err = md_link(sbi->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (err == 0)
ll_update_times(request, 0, dir);
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, 0);
- err = md_create(sbi->ll_lmv_exp, op_data, NULL, 0, mode,
+ err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (err == 0)
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, S_IFDIR);
- rc = md_unlink(ll_i2sbi(dir)->ll_lmv_exp, op_data, &request);
+ rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc == 0)
ll_update_times(request, 0, dir);
GOTO(out, rc = -EPROTO);
}
- rc = obd_unpackmd(ll_i2obdexp(dir), &lsm, eadata, body->eadatasize);
+ rc = obd_unpackmd(ll_i2dtexp(dir), &lsm, eadata, body->eadatasize);
if (rc < 0) {
CERROR("obd_unpackmd: %d\n", rc);
GOTO(out, rc);
}
}
- rc = obd_destroy(ll_i2obdexp(dir), oa, lsm, &oti);
+ rc = obd_destroy(ll_i2dtexp(dir), oa, lsm, &oti);
obdo_free(oa);
if (rc)
CERROR("obd destroy objid "LPX64" error %d\n",
lsm->lsm_object_id, rc);
EXIT;
out_free_memmd:
- obd_free_memmd(ll_i2obdexp(dir), &lsm);
+ obd_free_memmd(ll_i2dtexp(dir), &lsm);
out:
return rc;
}
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, dir, NULL, name, len, 0);
- rc = md_unlink(ll_i2sbi(dir)->ll_lmv_exp, op_data, &request);
+ rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc)
GOTO(out, rc);
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, src, tgt, NULL, 0, 0);
- err = md_rename(sbi->ll_lmv_exp, op_data, oldname, oldlen,
+ err = md_rename(sbi->ll_md_exp, op_data, oldname, oldlen,
newname, newlen, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (!err) {
else
lprocfs_counter_add(ll_i2sbi(inode)->ll_stats,
LPROC_LL_BRW_READ, pg.count);
- rc = obd_brw(cmd, ll_i2obdexp(inode), oa, lsm, 1, &pg, NULL);
+ rc = obd_brw(cmd, ll_i2dtexp(inode), oa, lsm, 1, &pg, NULL);
if (rc == 0)
obdo_to_inode(inode, oa, OBD_MD_FLBLOCKS);
else if (rc != -EIO)
/* truncate == punch from new size to absolute end of file */
/* NB: obd_punch must be called with i_sem held! It updates the kms! */
- rc = obd_punch(ll_i2obdexp(inode), oa, lsm, inode->i_size,
+ rc = obd_punch(ll_i2dtexp(inode), oa, lsm, inode->i_size,
OBD_OBJECT_EOF, NULL);
if (rc)
CERROR("obd_truncate fails (%d) ino %lu\n", rc, inode->i_ino);
oa->o_valid = OBD_MD_FLID | OBD_MD_FLMODE |
OBD_MD_FLTYPE | OBD_MD_FLGROUP;
- rc = obd_brw(OBD_BRW_CHECK, ll_i2obdexp(inode), oa, lsm,
+ rc = obd_brw(OBD_BRW_CHECK, ll_i2dtexp(inode), oa, lsm,
1, &pga, NULL);
if (rc)
GOTO(out_free_oa, rc);
if (llap != NULL)
RETURN(llap);
- exp = ll_i2obdexp(page->mapping->host);
+ exp = ll_i2dtexp(page->mapping->host);
if (exp == NULL)
RETURN(ERR_PTR(-EINVAL));
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats,
LPROC_LL_DIRTY_MISSES);
- exp = ll_i2obdexp(inode);
+ exp = ll_i2dtexp(inode);
if (exp == NULL)
RETURN(-EINVAL);
LASSERT(!PageDirty(page));
LASSERT(PageLocked(page));
- exp = ll_i2obdexp(inode);
+ exp = ll_i2dtexp(inode);
if (exp == NULL)
GOTO(out, rc = -EINVAL);
LL_CDEBUG_PAGE(D_PAGE, page, "being evicted\n");
- exp = ll_i2obdexp(inode);
+ exp = ll_i2dtexp(inode);
if (exp == NULL) {
CERROR("page %p ind %lu gave null export\n", page, page->index);
EXIT;
page_extent.l_extent.end =
page_extent.l_extent.start + PAGE_CACHE_SIZE - 1;
flags = LDLM_FL_CBPENDING | LDLM_FL_BLOCK_GRANTED | LDLM_FL_TEST_LOCK;
- matches = obd_match(ll_i2sbi(inode)->ll_lov_exp,
+ matches = obd_match(ll_i2sbi(inode)->ll_dt_exp,
ll_i2info(inode)->lli_smd, LDLM_EXTENT,
&page_extent, LCK_PR | LCK_PW, &flags, inode,
&match_lockh);
if (rc < 0)
GOTO(out, rc);
- exp = ll_i2obdexp(inode);
+ exp = ll_i2dtexp(inode);
if (exp == NULL)
GOTO(out, rc = -EINVAL);
lprocfs_counter_add(ll_i2sbi(inode)->ll_stats,
LPROC_LL_DIRECT_READ, iobuf->length);
rc = obd_brw_async(rw == WRITE ? OBD_BRW_WRITE : OBD_BRW_READ,
- ll_i2obdexp(inode), oa, lsm, iobuf->nr_pages, pga,
+ ll_i2dtexp(inode), oa, lsm, iobuf->nr_pages, pga,
set, NULL);
if (rc) {
CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR,
void lov_increase_kms(struct obd_export *,
struct lov_stripe_md *, obd_off size);
obd_off size = offset + length;
- lov_increase_kms(ll_i2obdexp(inode), lsm, size);
+ lov_increase_kms(ll_i2dtexp(inode), lsm, size);
if (size > inode->i_size)
inode->i_size = size;
}
}
lprocfs_counter_incr(sbi->ll_stats, LPROC_LL_RELEASE);
- err = ll_mdc_close(sbi->ll_lmv_exp, inode, filp);
+ err = ll_md_close(sbi->ll_md_exp, inode, filp);
if (err && rc == 0)
rc = err;
err = ll_local_open(filp, it);
if (rc != 0) {
CERROR("error opening special file: rc %d\n", rc);
- ll_mdc_close(ll_i2sbi(inode)->ll_lmv_exp, inode, filp);
+ ll_md_close(ll_i2sbi(inode)->ll_md_exp, inode, filp);
} else if (err) {
if (pfop && *pfop) {
if ((*pfop)->release)
}
ll_inode2id(&id, inode);
- rc = md_getattr(sbi->ll_lmv_exp, &id, OBD_MD_LINKNAME, symlen,
+ rc = md_getattr(sbi->ll_md_exp, &id, OBD_MD_LINKNAME, symlen,
request);
if (rc) {
if (rc != -ENOENT)
}
rc = md_intent_lock(lmv->tgts[id_group(&rpid)].ltd_exp, &rpid, name,
- len, lmm, lmmsize, cid, it, flags, reqp,
- cb_blocking);
+ len, lmm, lmmsize, cid, it, flags, reqp, cb_blocking);
if (rc == -ERESTART) {
/* directory got splitted. time to update local object and
* repeat the request with proper MDS */
mds, OLID4(&rpid));
}
}
+
+ /* the same about fid returning. */
rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &rpid, name,
- len, lmm, lmmsize, cid, it, flags, reqp,
- cb_blocking);
+ len, lmm, lmmsize, cid, it, flags,
+ reqp, cb_blocking);
if (rc < 0)
RETURN(rc);
CDEBUG(D_OTHER, "attrs from slaves for "DLID4", rc %d\n",
OLID4(cid), rc);
- rc = lmv_revalidate_slaves(exp, reqp, cid, it, 1, cb_blocking);
+ rc = lmv_revalidate_slaves(exp, reqp, cid, it, 1,
+ cb_blocking);
lmv_put_obj(obj2);
}
RETURN(rc);
}
}
rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &rpid, name,
- len, lmm, lmmsize, cid, it, flags, reqp,
- cb_blocking);
+ len, lmm, lmmsize, cid, it, flags,
+ reqp, cb_blocking);
if (rc > 0) {
LASSERT(cid != 0);
RETURN(rc);
/* okay, MDS has returned success. Probably name has been resolved in
* remote inode. */
- rc = lmv_handle_remote_inode(exp, lmm, lmmsize, it, flags,
- reqp, cb_blocking);
+ rc = lmv_handle_remote_inode(exp, lmm, lmmsize, it,
+ flags, reqp, cb_blocking);
if (rc == 0 && (mea = lmv_splitted_dir_body(*reqp, 1))) {
/* wow! this is splitted dir, we'd like to handle it */
struct lustre_id rid = *id;
struct mds_body *body;
struct lmv_obj *obj;
- __u64 old_valid;
ENTRY;
rc = lmv_check_connect(obd);
CDEBUG(D_OTHER, "getattr_lock for %*s on "DLID4" -> "DLID4"\n",
namelen, filename, OLID4(id), OLID4(&rid));
- old_valid = valid;
-
- /*
- * here should be applied OBD_MD_FID to ->valid, because otherwise,
- * mds_getattr_lock() will not fetch fid component of lustre_id and
- * thus, next call to md_getattr_lock() will be performed to wrong mds.
- */
- if (!(old_valid & OBD_MD_FID))
- valid |= OBD_MD_FID;
-
rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp,
&rid, filename, namelen, valid,
ea_size, request);
rid = body->id1;
CDEBUG(D_OTHER, "request attrs for "DLID4"\n", OLID4(&rid));
- /*
- * turning OBD_MD_FID fetching off, as we already have
- * full lustre_id and do need to fetch fid component
- * again. This will help to make thing slightly faster.
- */
- if (!(old_valid & OBD_MD_FID))
- valid &= ~OBD_MD_FID;
-
rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp,
&rid, NULL, 1, valid, ea_size, &req);
ptlrpc_req_finished(*request);
#endif
/* setup mdsnum in underlying fs */
#ifdef EXT3_FEATURE_INCOMPAT_MDSNUM
- if (mds->mds_lmv_obd) {
+ if (mds->mds_md_obd) {
struct ext3_sb_info *sbi = EXT3_SB(sb);
struct ext3_super_block *es = sbi->s_es;
handle_t *handle;
mdc_id2mdc_data(op_data, pid, cid, name, len, 0);
- /*
- * if we get inode by name (ll_lookup_it() case), we
- * always should ask for fid, as we will not be able to
- * take locks, revalidate dentry, etc. later with
- * invalid fid in inode.
- */
- if (cid == NULL && name != NULL)
- op_data->valid |= OBD_MD_FID;
-
rc = mdc_enqueue(exp, LDLM_IBITS, it, it_to_lock_mode(it),
op_data, &lockh, lmm, lmmsize,
ldlm_completion_ast, cb_blocking, NULL);
atomic_read(&mds->mds_real_clients));
exp->exp_flags |= OBD_OPT_REAL_CLIENT;
}
- if (mds->mds_lmv_name)
- rc = mds_lmv_connect(obd, mds->mds_lmv_name);
+ if (mds->mds_md_name)
+ rc = mds_md_connect(obd, mds->mds_md_name);
}
RETURN(rc);
}
if (!(exp->exp_flags & OBD_OPT_REAL_CLIENT)
&& !atomic_read(&mds->mds_real_clients)) {
/* there was no client at all */
- mds_lmv_disconnect(obd, flags);
+ mds_md_disconnect(obd, flags);
}
if ((exp->exp_flags & OBD_OPT_REAL_CLIENT)
CDEBUG(D_OTHER, "%s: last real client %s disconnected. "
"Disconnnect from LMV now\n",
obd->obd_name, exp->exp_client_uuid.uuid);
- mds_lmv_disconnect(obd, flags);
+ mds_md_disconnect(obd, flags);
}
spin_lock_irqsave(&exp->exp_lock, irqflags);
}
body = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*body));
-
- body->valid |= OBD_MD_FID;
memcpy(&body->id1, &mds->mds_rootid, sizeof(body->id1));
/*
LASSERT(body != NULL); /* caller prepped reply */
if (dentry->d_flags & DCACHE_CROSS_REF) {
- mds_pack_dentry2body(obd, body, dentry,
- (reqbody->valid & OBD_MD_FID) ? 1 : 0);
+ mds_pack_dentry2body(obd, body, dentry, 1);
CDEBUG(D_OTHER, "cross reference: "DLID4"\n",
OLID4(&body->id1));
RETURN(0);
}
- mds_pack_inode2body(obd, body, inode,
- (reqbody->valid & OBD_MD_FID) ? 1 : 0);
+ mds_pack_inode2body(obd, body, inode, 1);
if ((S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE)) ||
(S_ISDIR(inode->i_mode) && (reqbody->valid & OBD_MD_FLDIREA))) {
int mea_size, rc = 0;
ENTRY;
- rc = mds_get_lmv_attr(obd, inode, &mea, &mea_size);
+ rc = mds_md_get_attr(obd, inode, &mea, &mea_size);
if (rc)
RETURN(rc);
if (mea != NULL) {
obdo_from_inode(&repbody->oa, new->d_inode, FILTER_VALID_FLAGS);
repbody->oa.o_id = new->d_inode->i_ino;
repbody->oa.o_generation = new->d_inode->i_generation;
- repbody->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGENER | OBD_MD_FID;
+ repbody->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGENER;
if ((body->oa.o_flags & OBD_FL_RECREATE_OBJS) ||
lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
if (body->oa.o_valid & OBD_MD_FLID) {
/* this is new object for splitted dir. We have to prevent
* recursive splitting on it -bzzz */
- mealen = obd_size_diskmd(mds->mds_lmv_exp, NULL);
+ mealen = obd_size_diskmd(mds->mds_md_exp, NULL);
OBD_ALLOC(mea, mealen);
if (mea == NULL)
/* mds number has been changed, so the corresponding obdfilter
* exp need to be changed too. */
- rc = obd_set_info(mds->mds_lov_exp, strlen("mds_conn"),
+ rc = obd_set_info(mds->mds_dt_exp, strlen("mds_conn"),
"mds_conn", valsize, &group);
RETURN(rc);
}
lcfg->lcfg_inlbuf4);
/* we have to know mdsnum before touching underlying fs -bzzz */
- sema_init(&mds->mds_lmv_sem, 1);
- mds->mds_lmv_connected = 0;
- mds->mds_lmv_name = NULL;
+ sema_init(&mds->mds_md_sem, 1);
+ mds->mds_md_connected = 0;
+ mds->mds_md_name = NULL;
if (lcfg->lcfg_inllen5 > 0 && lcfg->lcfg_inlbuf5 &&
strncmp(lcfg->lcfg_inlbuf5, "dumb", lcfg->lcfg_inllen5)) {
obd->obd_name, lcfg->lcfg_inlbuf5);
generate_random_uuid(uuid);
- class_uuid_unparse(uuid, &mds->mds_lmv_uuid);
+ class_uuid_unparse(uuid, &mds->mds_md_uuid);
- OBD_ALLOC(mds->mds_lmv_name, lcfg->lcfg_inllen5);
- if (mds->mds_lmv_name == NULL)
+ OBD_ALLOC(mds->mds_md_name, lcfg->lcfg_inllen5);
+ if (mds->mds_md_name == NULL)
RETURN(rc = -ENOMEM);
- memcpy(mds->mds_lmv_name, lcfg->lcfg_inlbuf5,
+ memcpy(mds->mds_md_name, lcfg->lcfg_inlbuf5,
lcfg->lcfg_inllen5);
- rc = mds_lmv_connect(obd, mds->mds_lmv_name);
+ rc = mds_md_connect(obd, mds->mds_md_name);
if (rc) {
- OBD_FREE(mds->mds_lmv_name, lcfg->lcfg_inllen5);
+ OBD_FREE(mds->mds_md_name, lcfg->lcfg_inllen5);
GOTO(err_ops, rc);
}
}
class_uuid_t uuid;
generate_random_uuid(uuid);
- class_uuid_unparse(uuid, &mds->mds_lov_uuid);
+ class_uuid_unparse(uuid, &mds->mds_dt_uuid);
OBD_ALLOC(mds->mds_profile, lcfg->lcfg_inllen3);
if (mds->mds_profile == NULL)
* setup root dir and files ID dir if lmv already connected, or there is
* not lmv at all.
*/
- if (mds->mds_lmv_exp || (lcfg->lcfg_inllen3 > 0 && lcfg->lcfg_inlbuf3 &&
- strncmp(lcfg->lcfg_inlbuf3, "dumb", lcfg->lcfg_inllen3)))
+ if (mds->mds_md_exp || (lcfg->lcfg_inllen3 > 0 && lcfg->lcfg_inlbuf3 &&
+ strncmp(lcfg->lcfg_inlbuf3, "dumb", lcfg->lcfg_inllen3)))
{
rc = mds_fs_setup_rootid(obd);
if (rc)
struct config_llog_instance cfg;
cfg.cfg_instance = NULL;
- cfg.cfg_uuid = mds->mds_lov_uuid;
+ cfg.cfg_uuid = mds->mds_dt_uuid;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
lgctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
CERROR("No profile found: %s\n", mds->mds_profile);
GOTO(err_cleanup, rc = -ENOENT);
}
- rc = mds_lov_connect(obd, lprof->lp_lov);
+ rc = mds_dt_connect(obd, lprof->lp_lov);
if (rc)
GOTO(err_cleanup, rc);
- rc = mds_lmv_postsetup(obd);
+ rc = mds_md_postsetup(obd);
if (rc)
GOTO(err_cleanup, rc);
}
RETURN(rc);
err_cleanup:
- mds_lov_clean(obd);
+ mds_dt_clean(obd);
err_llog:
obd_llog_cleanup(llog_get_context(&obd->obd_llogs,
LLOG_CONFIG_ORIG_CTXT));
LASSERT(ctxt != NULL);
/* set nextid first, so we are sure it happens */
- rc = mds_lov_set_nextid(obd);
+ rc = mds_dt_set_nextid(obd);
if (rc) {
- CERROR("%s: mds_lov_set_nextid failed\n", obd->obd_name);
+ CERROR("%s: mds_dt_set_nextid() failed\n", obd->obd_name);
GOTO(out, rc);
}
group = FILTER_GROUP_FIRST_MDS + mds->mds_num;
valsize = sizeof(group);
- rc = obd_set_info(mds->mds_lov_exp, strlen("mds_conn"), "mds_conn",
+ rc = obd_set_info(mds->mds_dt_exp, strlen("mds_conn"), "mds_conn",
valsize, &group);
if (rc)
GOTO(out, rc);
- rc = llog_connect(ctxt, obd->u.mds.mds_lov_desc.ld_tgt_count,
+ rc = llog_connect(ctxt, obd->u.mds.mds_dt_desc.ld_tgt_count,
NULL, NULL, NULL);
if (rc) {
CERROR("%s: failed at llog_origin_connect: %d\n",
}
/* remove the orphaned precreated objects */
- rc = mds_lov_clearorphans(mds, NULL /* all OSTs */);
+ rc = mds_dt_clearorphans(mds, NULL /* all OSTs */);
if (rc)
GOTO(err_llog, rc);
err_llog:
/* cleanup all llogging subsystems */
rc = obd_llog_finish(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count);
+ mds->mds_dt_desc.ld_tgt_count);
if (rc)
CERROR("%s: failed to cleanup llogging subsystems\n",
obd->obd_name);
goto out;
}
-int mds_lov_clean(struct obd_device *obd)
+int mds_dt_clean(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
ENTRY;
sprintf(cln_prof, "%s-clean", mds->mds_profile);
cfg.cfg_instance = NULL;
- cfg.cfg_uuid = mds->mds_lov_uuid;
+ cfg.cfg_uuid = mds->mds_dt_uuid;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
llctx = llog_get_context(&obd->obd_llogs,
RETURN(0);
}
-int mds_lmv_clean(struct obd_device *obd)
+int mds_md_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_name = NULL;
+ if (mds->mds_md_name) {
+ OBD_FREE(mds->mds_md_name, strlen(mds->mds_md_name) + 1);
+ mds->mds_md_name = NULL;
}
RETURN(0);
}
int rc = 0;
ENTRY;
- mds_lmv_clean(obd);
- mds_lov_disconnect(obd, flags);
- mds_lov_clean(obd);
+ mds_md_clean(obd);
+ mds_dt_disconnect(obd, flags);
+ mds_dt_clean(obd);
obd_llog_cleanup(llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT));
RETURN(rc);
}
mds_update_server_data(obd, 1);
mds_update_last_fid(obd, NULL, 1);
- if (mds->mds_lov_objids != NULL) {
- int size = mds->mds_lov_desc.ld_tgt_count *
+ if (mds->mds_dt_objids != NULL) {
+ int size = mds->mds_dt_desc.ld_tgt_count *
sizeof(obd_id);
- OBD_FREE(mds->mds_lov_objids, size);
+ OBD_FREE(mds->mds_dt_objids, size);
}
mds_fs_cleanup(obd, flags);
struct obd_device *obd = data;
ENTRY;
- RETURN(mds_lov_update_config(obd, 0));
+ RETURN(mds_dt_update_config(obd, 0));
}
static int lprocfs_rd_last_fid(char *page, char **start, off_t off,
CERROR("cannot open/create %s file: rc = %d\n", LOV_OBJID, rc);
GOTO(err_last_fid, rc = PTR_ERR(file));
}
- mds->mds_lov_objid_filp = file;
+ mds->mds_dt_objid_filp = file;
if (!S_ISREG(file->f_dentry->d_inode->i_mode)) {
CERROR("%s is not a regular file!: mode = %o\n", LOV_OBJID,
file->f_dentry->d_inode->i_mode);
return rc;
err_lov_objid:
- if (mds->mds_lov_objid_filp && filp_close(mds->mds_lov_objid_filp, 0))
+ if (mds->mds_dt_objid_filp && filp_close(mds->mds_dt_objid_filp, 0))
CERROR("can't close %s after error\n", LOV_OBJID);
err_virtid_fid:
if (mds->mds_virtid_filp && filp_close(mds->mds_virtid_filp, 0))
if (rc)
CERROR("%s file won't close, rc = %d\n", LAST_RCVD, rc);
}
- if (mds->mds_lov_objid_filp) {
- rc = filp_close(mds->mds_lov_objid_filp, 0);
- mds->mds_lov_objid_filp = NULL;
+ if (mds->mds_dt_objid_filp) {
+ rc = filp_close(mds->mds_dt_objid_filp, 0);
+ mds->mds_dt_objid_filp = NULL;
if (rc)
CERROR("%s file won't close, rc=%d\n", LOV_OBJID, rc);
}
int mds_llog_finish(struct obd_device *obd, struct obd_llogs *, int count);
/* mds/mds_lov.c */
-int mds_lov_connect(struct obd_device *obd, char * lov_name);
-int mds_lov_disconnect(struct obd_device *obd, int flags);
-int mds_lov_set_info(struct obd_export *exp, obd_count keylen,
+int mds_dt_connect(struct obd_device *obd, char * lov_name);
+int mds_dt_disconnect(struct obd_device *obd, int flags);
+int mds_dt_set_info(struct obd_export *exp, obd_count keylen,
void *key, obd_count vallen, void *val);
int mds_get_lovtgts(struct obd_device *, int tgt_count, struct obd_uuid *);
-int mds_lov_write_objids(struct obd_device *obd);
-void mds_lov_update_objids(struct obd_device *obd, obd_id *ids);
-int mds_lov_set_growth(struct mds_obd *mds, int count);
-int mds_lov_set_nextid(struct obd_device *obd);
-int mds_lov_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
+int mds_dt_write_objids(struct obd_device *obd);
+void mds_dt_update_objids(struct obd_device *obd, obd_id *ids);
+int mds_dt_set_growth(struct mds_obd *mds, int count);
+int mds_dt_set_nextid(struct obd_device *obd);
+int mds_dt_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
int mds_post_mds_lovconf(struct obd_device *obd);
int mds_notify(struct obd_device *obd, struct obd_device *watched,
int active, void *data);
-int mds_lov_update_config(struct obd_device *obd, int transno);
+int mds_dt_update_config(struct obd_device *obd, int transno);
int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
struct lov_mds_md *lmm, int lmm_size);
int mds_revalidate_lov_ea(struct obd_device *obd, struct inode *inode,
ptl_nid_t *peernid);
int mds_handle(struct ptlrpc_request *req);
extern struct lvfs_callback_ops mds_lvfs_ops;
-int mds_lov_clean(struct obd_device *obd);
+int mds_dt_clean(struct obd_device *obd);
int mds_postrecov(struct obd_device *obd);
extern struct lvfs_callback_ops mds_lvfs_ops;
#endif
/* mds/mds_lmv.c */
-int mds_lmv_postsetup(struct obd_device *obd);
-int mds_lmv_connect(struct obd_device *obd, char * lov_name);
-int mds_lmv_disconnect(struct obd_device *obd, int flags);
+int mds_md_postsetup(struct obd_device *obd);
+int mds_md_connect(struct obd_device *obd, char * lov_name);
+int mds_md_disconnect(struct obd_device *obd, int flags);
int mds_try_to_split_dir(struct obd_device *, struct dentry *, struct mea **,
int, int);
-int mds_get_lmv_attr(struct obd_device *, struct inode *, struct mea **, int *);
+int mds_md_get_attr(struct obd_device *, struct inode *, struct mea **, int *);
int mds_choose_mdsnum(struct obd_device *, const char *, int, int);
-int mds_lmv_postsetup(struct obd_device *);
+int mds_md_postsetup(struct obd_device *);
int mds_splitting_expected(struct obd_device *, struct dentry *);
int mds_lock_slave_objs(struct obd_device *, struct dentry *,
struct lustre_handle **);
b->valid |= OBD_MD_FLID | OBD_MD_FLGENER |
OBD_MD_MDS;
- if (read_fid)
- b->valid |= OBD_MD_FID;
-
mds_pack_dentry2id(obd, &b->id1, dentry,
read_fid);
}
} else {
b->nlink = inode->i_nlink;
}
- if (read_fid)
- b->valid |= OBD_MD_FID;
mds_pack_inode2id(obd, &b->id1, inode, read_fid);
}
* TODO:
* - magic in mea struct
*/
-int mds_lmv_connect(struct obd_device *obd, char *lmv_name)
+int mds_md_connect(struct obd_device *obd, char *md_name)
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0};
int rc, valsize, value;
ENTRY;
- if (IS_ERR(mds->mds_lmv_obd))
- RETURN(PTR_ERR(mds->mds_lmv_obd));
+ if (IS_ERR(mds->mds_md_obd))
+ RETURN(PTR_ERR(mds->mds_md_obd));
- if (mds->mds_lmv_connected)
+ if (mds->mds_md_connected)
RETURN(0);
- down(&mds->mds_lmv_sem);
- if (mds->mds_lmv_connected) {
- up(&mds->mds_lmv_sem);
+ down(&mds->mds_md_sem);
+ if (mds->mds_md_connected) {
+ up(&mds->mds_md_sem);
RETURN(0);
}
- mds->mds_lmv_obd = class_name2obd(lmv_name);
- if (!mds->mds_lmv_obd) {
- CERROR("MDS cannot locate LMV %s\n",
- lmv_name);
- mds->mds_lmv_obd = ERR_PTR(-ENOTCONN);
+ mds->mds_md_obd = class_name2obd(md_name);
+ if (!mds->mds_md_obd) {
+ CERROR("MDS cannot locate MD(LMV) %s\n",
+ md_name);
+ mds->mds_md_obd = ERR_PTR(-ENOTCONN);
GOTO(err_last, rc = -ENOTCONN);
}
- rc = obd_connect(&conn, mds->mds_lmv_obd,
+ rc = obd_connect(&conn, mds->mds_md_obd,
&obd->obd_uuid, OBD_OPT_MDS_CONNECTION);
if (rc) {
- CERROR("MDS cannot connect to LMV %s (%d)\n",
- lmv_name, rc);
- mds->mds_lmv_obd = ERR_PTR(rc);
+ CERROR("MDS cannot connect to MD(LMV) %s (%d)\n",
+ md_name, rc);
+ mds->mds_md_obd = ERR_PTR(rc);
GOTO(err_last, rc);
}
- mds->mds_lmv_exp = class_conn2export(&conn);
- if (mds->mds_lmv_exp == NULL)
+ mds->mds_md_exp = class_conn2export(&conn);
+ if (mds->mds_md_exp == NULL)
CERROR("can't get export!\n");
- rc = obd_register_observer(mds->mds_lmv_obd, obd);
+ rc = obd_register_observer(mds->mds_md_obd, obd);
if (rc) {
- CERROR("MDS cannot register as observer of LMV %s, "
- "rc = %d\n", lmv_name, rc);
+ CERROR("MDS cannot register as observer of MD(LMV) %s, "
+ "rc = %d\n", md_name, rc);
GOTO(err_discon, rc);
}
/* retrieve size of EA */
- rc = obd_get_info(mds->mds_lmv_exp, strlen("mdsize"),
+ rc = obd_get_info(mds->mds_md_exp, strlen("mdsize"),
"mdsize", &valsize, &value);
if (rc)
GOTO(err_reg, rc);
mds->mds_max_mdsize = value;
/* find our number in LMV cluster */
- rc = obd_get_info(mds->mds_lmv_exp, strlen("mdsnum"),
+ rc = obd_get_info(mds->mds_md_exp, strlen("mdsnum"),
"mdsnum", &valsize, &value);
if (rc)
GOTO(err_reg, rc);
mds->mds_num = value;
- rc = obd_set_info(mds->mds_lmv_exp, strlen("inter_mds"),
+ rc = obd_set_info(mds->mds_md_exp, strlen("inter_mds"),
"inter_mds", 0, NULL);
if (rc)
GOTO(err_reg, rc);
- mds->mds_lmv_connected = 1;
- up(&mds->mds_lmv_sem);
+ mds->mds_md_connected = 1;
+ up(&mds->mds_md_sem);
RETURN(0);
err_reg:
- obd_register_observer(mds->mds_lmv_obd, NULL);
+ obd_register_observer(mds->mds_md_obd, NULL);
err_discon:
- obd_disconnect(mds->mds_lmv_exp, 0);
- mds->mds_lmv_exp = NULL;
- mds->mds_lmv_obd = ERR_PTR(rc);
+ obd_disconnect(mds->mds_md_exp, 0);
+ mds->mds_md_exp = NULL;
+ mds->mds_md_obd = ERR_PTR(rc);
err_last:
- up(&mds->mds_lmv_sem);
+ up(&mds->mds_md_sem);
return rc;
}
-int mds_lmv_postsetup(struct obd_device *obd)
+int mds_md_postsetup(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
int rc = 0;
ENTRY;
- if (mds->mds_lmv_exp) {
- rc = obd_init_ea_size(mds->mds_lmv_exp,
+ if (mds->mds_md_exp) {
+ rc = obd_init_ea_size(mds->mds_md_exp,
mds->mds_max_mdsize,
mds->mds_max_cookiesize);
}
RETURN(rc);
}
-int mds_lmv_disconnect(struct obd_device *obd, int flags)
+int mds_md_disconnect(struct obd_device *obd, int flags)
{
struct mds_obd *mds = &obd->u.mds;
int rc = 0;
ENTRY;
- if (!mds->mds_lmv_connected)
+ if (!mds->mds_md_connected)
RETURN(0);
- down(&mds->mds_lmv_sem);
- if (!IS_ERR(mds->mds_lmv_obd) && mds->mds_lmv_exp != NULL) {
- LASSERT(mds->mds_lmv_connected);
+ down(&mds->mds_md_sem);
+ if (!IS_ERR(mds->mds_md_obd) && mds->mds_md_exp != NULL) {
+ LASSERT(mds->mds_md_connected);
- obd_register_observer(mds->mds_lmv_obd, NULL);
+ obd_register_observer(mds->mds_md_obd, NULL);
if (flags & OBD_OPT_FORCE) {
struct obd_device *lmv_obd;
struct obd_ioctl_data ioc_data = { 0 };
- lmv_obd = class_exp2obd(mds->mds_lmv_exp);
+ lmv_obd = class_exp2obd(mds->mds_md_exp);
if (lmv_obd == NULL)
GOTO(out, rc = 0);
* it here. --umka.
*/
lmv_obd->obd_no_recov = 1;
- obd_iocontrol(IOC_OSC_SET_ACTIVE, mds->mds_lmv_exp,
+ obd_iocontrol(IOC_OSC_SET_ACTIVE, mds->mds_md_exp,
sizeof(ioc_data), &ioc_data, NULL);
}
* disconnected by class_disconnect_exports()) then we just need
* to drop our ref.
*/
- mds->mds_lmv_connected = 0;
- rc = obd_disconnect(mds->mds_lmv_exp, flags);
+ mds->mds_md_connected = 0;
+ rc = obd_disconnect(mds->mds_md_exp, flags);
if (rc)
- class_export_put(mds->mds_lmv_exp);
+ class_export_put(mds->mds_md_exp);
out:
- mds->mds_lmv_exp = NULL;
- mds->mds_lmv_obd = NULL;
+ mds->mds_md_exp = NULL;
+ mds->mds_md_obd = NULL;
}
- up(&mds->mds_lmv_sem);
+ up(&mds->mds_md_sem);
RETURN(rc);
}
-int mds_get_lmv_attr(struct obd_device *obd, struct inode *inode,
- struct mea **mea, int *mea_size)
+int mds_md_get_attr(struct obd_device *obd, struct inode *inode,
+ struct mea **mea, int *mea_size)
{
struct mds_obd *mds = &obd->u.mds;
int rc;
ENTRY;
- if (!mds->mds_lmv_obd)
+ if (!mds->mds_md_obd)
RETURN(0);
if (!S_ISDIR(inode->i_mode))
RETURN(0);
/* first calculate mea size */
- *mea_size = obd_alloc_diskmd(mds->mds_lmv_exp,
+ *mea_size = obd_alloc_diskmd(mds->mds_md_exp,
(struct lov_mds_md **)mea);
if (*mea_size < 0 || *mea == NULL)
return *mea_size < 0 ? *mea_size : -EINVAL;
ca->brwc.count = PAGE_SIZE;
ca->brwc.flag = 0;
ca->oa.o_mds = mdsnum;
- rc = obd_brw(OBD_BRW_WRITE, mds->mds_lmv_exp, &ca->oa,
+ rc = obd_brw(OBD_BRW_WRITE, mds->mds_md_exp, &ca->oa,
(struct lov_stripe_md *) dc->mea,
1, &ca->brwc, NULL);
if (rc)
int rc, size;
/* clustered MD ? */
- if (!mds->mds_lmv_obd)
+ if (!mds->mds_md_obd)
return MDS_NO_SPLITTABLE;
/* inode exist? */
if (dentry->d_inode->i_size < MAX_DIR_SIZE)
return MDS_NO_SPLIT_EXPECTED;
- mds_get_lmv_attr(obd, dentry->d_inode, &mea, &size);
+ mds_md_get_attr(obd, dentry->d_inode, &mea, &size);
if (mea) {
/* already splitted or slave object: shouldn't be splitted */
rc = MDS_NO_SPLITTABLE;
if (mea == NULL)
mea = &tmea;
- mea_size = obd_size_diskmd(mds->mds_lmv_exp, NULL);
+ mea_size = obd_size_diskmd(mds->mds_md_exp, NULL);
/* FIXME: Actually we may only want to allocate enough space for
* necessary amount of stripes, but on the other hand with this
* approach of allocating maximal possible amount of MDS slots,
* it would be easier to split the dir over more MDSes */
- rc = obd_alloc_diskmd(mds->mds_lmv_exp, (void *)mea);
+ rc = obd_alloc_diskmd(mds->mds_md_exp, (void *)mea);
if (rc < 0) {
CERROR("obd_alloc_diskmd() failed, error %d.\n", rc);
RETURN(rc);
CDEBUG(D_OTHER, "%s: create subdirs with mode %o, uid %u, gid %u\n",
obd->obd_name, dir->i_mode, dir->i_uid, dir->i_gid);
- rc = obd_create(mds->mds_lmv_exp, oa,
+ rc = obd_create(mds->mds_md_exp, oa,
(struct lov_stripe_md **)mea, NULL);
if (rc) {
CERROR("Can't create remote inode, rc = %d\n", rc);
/* 3) read through the dir and distribute it over objects */
rc = scan_and_distribute(obd, dentry, *mea);
if (mea == &tmea)
- obd_free_diskmd(mds->mds_lmv_exp, (struct lov_mds_md **)mea);
+ obd_free_diskmd(mds->mds_md_exp, (struct lov_mds_md **)mea);
if (rc) {
CERROR("scan_and_distribute() failed, error %d.\n", rc);
RETURN(rc);
if (flags & REC_REINT_CREATE) {
i = mds->mds_num;
- } else if (mds->mds_lmv_exp) {
- lmv = &mds->mds_lmv_exp->exp_obd->u.lmv;
+ } else if (mds->mds_md_exp) {
+ lmv = &mds->mds_md_exp->exp_obd->u.lmv;
i = raw_name2idx(MEA_MAGIC_LAST_CHAR, lmv->desc.ld_tgt_count, name, len);
}
RETURN(i);
LASSERT(dentry->d_inode != NULL);
/* clustered MD ? */
- if (!mds->mds_lmv_obd)
+ if (!mds->mds_md_obd)
RETURN(0);
/* a dir can be splitted only */
if (!S_ISDIR(dentry->d_inode->i_mode))
RETURN(0);
- rc = mds_get_lmv_attr(obd, dentry->d_inode,
- &mea, &mea_size);
+ rc = mds_md_get_attr(obd, dentry->d_inode,
+ &mea, &mea_size);
if (rc)
RETURN(rc);
op_data->mea1 = mea;
it.it_op = IT_UNLINK;
- rc = md_enqueue(mds->mds_lmv_exp, LDLM_IBITS, &it, LCK_EX,
+ rc = md_enqueue(mds->mds_md_exp, LDLM_IBITS, &it, LCK_EX,
op_data, *rlockh, NULL, 0, ldlm_completion_ast,
mds_blocking_ast, NULL);
OBD_FREE(op_data, sizeof(*op_data));
return;
}
- LASSERT(mds->mds_lmv_obd != NULL);
+ LASSERT(mds->mds_md_obd != NULL);
LASSERT(S_ISDIR(dentry->d_inode->i_mode));
- rc = mds_get_lmv_attr(obd, dentry->d_inode, &mea, &mea_size);
+ rc = mds_md_get_attr(obd, dentry->d_inode, &mea, &mea_size);
if (rc) {
CERROR("locks are leaked\n");
EXIT;
ENTRY;
/* clustered MD ? */
- if (!mds->mds_lmv_obd)
+ if (!mds->mds_md_obd)
RETURN(0);
/* a dir can be splitted only */
if (!S_ISDIR(dentry->d_inode->i_mode))
RETURN(0);
- rc = mds_get_lmv_attr(obd, dentry->d_inode, &mea, &mea_size);
+ rc = mds_md_get_attr(obd, dentry->d_inode, &mea, &mea_size);
if (rc)
RETURN(rc);
memset(op_data, 0, sizeof(*op_data));
op_data->mea1 = mea;
- rc = md_unlink(mds->mds_lmv_exp, op_data, &req);
+ rc = md_unlink(mds->mds_md_exp, op_data, &req);
OBD_FREE(op_data, sizeof(*op_data));
LASSERT(req == NULL);
EXIT;
struct rw_semaphore **lock, int *lock_count)
{
struct obd_device *obd = ctxt->loc_obd;
- struct obd_device *lov_obd = obd->u.mds.mds_lov_obd;
+ struct obd_device *lov_obd = obd->u.mds.mds_dt_obd;
struct llog_ctxt *lctxt;
int rc;
ENTRY;
struct llog_gen *gen, struct obd_uuid *uuid)
{
struct obd_device *obd = ctxt->loc_obd;
- struct obd_device *lov_obd = obd->u.mds.mds_lov_obd;
+ struct obd_device *lov_obd = obd->u.mds.mds_dt_obd;
struct llog_ctxt *lctxt;
int rc;
ENTRY;
void *data)
{
struct obd_device *obd = ctxt->loc_obd;
- struct obd_device *lov_obd = obd->u.mds.mds_lov_obd;
+ struct obd_device *lov_obd = obd->u.mds.mds_dt_obd;
struct llog_ctxt *lctxt;
int rc;
ENTRY;
int lock_count = 0;
ENTRY;
- if (IS_ERR(mds->mds_lov_obd))
- RETURN(PTR_ERR(mds->mds_lov_obd));
+ if (IS_ERR(mds->mds_dt_obd))
+ RETURN(PTR_ERR(mds->mds_dt_obd));
RETURN(0);
- rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size);
+ rc = obd_unpackmd(mds->mds_dt_exp, &lsm, lmm, lmm_size);
if (rc < 0)
RETURN(rc);
cookies_size / sizeof(struct llog_cookie), NULL,
res ? &lcl->lcl_locks[0] : NULL, &lock_count);
- obd_free_memmd(mds->mds_lov_exp, &lsm);
+ obd_free_memmd(mds->mds_dt_exp, &lsm);
if (res && (rc <= 0 || lock_count == 0)) {
OBD_FREE(lcl, size);
int mds_llog_init(struct obd_device *obd, struct obd_llogs *llogs,
struct obd_device *tgt, int count, struct llog_catid *logid)
{
- struct obd_device *lov_obd = obd->u.mds.mds_lov_obd;
+ struct obd_device *lov_obd = obd->u.mds.mds_dt_obd;
int rc;
ENTRY;
int mds_llog_finish(struct obd_device *obd, struct obd_llogs *llogs, int count)
{
- struct obd_device *lov_obd = obd->u.mds.mds_lov_obd;
+ struct obd_device *lov_obd = obd->u.mds.mds_dt_obd;
int rc;
ENTRY;
ld->ld_pattern = cpu_to_le32 (ld->ld_pattern);
}
-void mds_lov_update_objids(struct obd_device *obd, obd_id *ids)
+void mds_dt_update_objids(struct obd_device *obd, obd_id *ids)
{
struct mds_obd *mds = &obd->u.mds;
int i;
ENTRY;
- spin_lock(&mds->mds_lov_lock);
- for (i = 0; i < mds->mds_lov_desc.ld_tgt_count; i++)
- if (ids[i] > (mds->mds_lov_objids)[i])
- (mds->mds_lov_objids)[i] = ids[i];
- spin_unlock(&mds->mds_lov_lock);
+ spin_lock(&mds->mds_dt_lock);
+ for (i = 0; i < mds->mds_dt_desc.ld_tgt_count; i++)
+ if (ids[i] > (mds->mds_dt_objids)[i])
+ (mds->mds_dt_objids)[i] = ids[i];
+ spin_unlock(&mds->mds_dt_lock);
EXIT;
}
-static int mds_lov_read_objids(struct obd_device *obd)
+static int mds_dt_read_objids(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
obd_id *ids;
loff_t off = 0;
- int i, rc, size = mds->mds_lov_desc.ld_tgt_count * sizeof(*ids);
+ int i, rc, size = mds->mds_dt_desc.ld_tgt_count * sizeof(*ids);
ENTRY;
- if (mds->mds_lov_objids != NULL)
+ if (mds->mds_dt_objids != NULL)
RETURN(0);
OBD_ALLOC(ids, size);
if (ids == NULL)
RETURN(-ENOMEM);
- mds->mds_lov_objids = ids;
+ mds->mds_dt_objids = ids;
- if (mds->mds_lov_objid_filp->f_dentry->d_inode->i_size == 0)
+ if (mds->mds_dt_objid_filp->f_dentry->d_inode->i_size == 0)
RETURN(0);
- rc = fsfilt_read_record(obd, mds->mds_lov_objid_filp, ids, size, &off);
+ rc = fsfilt_read_record(obd, mds->mds_dt_objid_filp, ids, size, &off);
if (rc < 0) {
CERROR("Error reading objids %d\n", rc);
} else {
- mds->mds_lov_objids_valid = 1;
+ mds->mds_dt_objids_valid = 1;
rc = 0;
}
- for (i = 0; i < mds->mds_lov_desc.ld_tgt_count; i++)
+ for (i = 0; i < mds->mds_dt_desc.ld_tgt_count; i++)
CDEBUG(D_INFO, "read last object "LPU64" for idx %d\n",
- mds->mds_lov_objids[i], i);
+ mds->mds_dt_objids[i], i);
RETURN(rc);
}
-int mds_lov_write_objids(struct obd_device *obd)
+int mds_dt_write_objids(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
loff_t off = 0;
- int i, rc, size = mds->mds_lov_desc.ld_tgt_count * sizeof(obd_id);
+ int i, rc, size = mds->mds_dt_desc.ld_tgt_count * sizeof(obd_id);
ENTRY;
- for (i = 0; i < mds->mds_lov_desc.ld_tgt_count; i++)
+ for (i = 0; i < mds->mds_dt_desc.ld_tgt_count; i++)
CDEBUG(D_INFO, "writing last object "LPU64" for idx %d\n",
- mds->mds_lov_objids[i], i);
+ mds->mds_dt_objids[i], i);
- rc = fsfilt_write_record(obd, mds->mds_lov_objid_filp,
- mds->mds_lov_objids, size, &off, 0);
+ rc = fsfilt_write_record(obd, mds->mds_dt_objid_filp,
+ mds->mds_dt_objids, size, &off, 0);
RETURN(rc);
}
-int mds_lov_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid)
+int mds_dt_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid)
{
int rc;
struct obdo *oa = NULL;
struct lov_stripe_md *empty_ea = NULL;
ENTRY;
- LASSERT(mds->mds_lov_objids != NULL);
+ LASSERT(mds->mds_dt_objids != NULL);
/*
* this create will in fact either create or destroy: If the OST is
memcpy(&oa->o_inline, ost_uuid, sizeof(*ost_uuid));
oa->o_valid |= OBD_MD_FLINLINE;
}
- rc = obd_create(mds->mds_lov_exp, oa, &empty_ea, &oti);
+ rc = obd_create(mds->mds_dt_exp, oa, &empty_ea, &oti);
obdo_free(oa);
RETURN(rc);
}
/* update the LOV-OSC knowledge of the last used object id's */
-int mds_lov_set_nextid(struct obd_device *obd)
+int mds_dt_set_nextid(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
int rc;
LASSERT(!obd->obd_recovering);
- LASSERT(mds->mds_lov_objids != NULL);
+ LASSERT(mds->mds_dt_objids != NULL);
- rc = obd_set_info(mds->mds_lov_exp, strlen("next_id"), "next_id",
- mds->mds_lov_desc.ld_tgt_count, mds->mds_lov_objids);
+ rc = obd_set_info(mds->mds_dt_exp, strlen("next_id"), "next_id",
+ mds->mds_dt_desc.ld_tgt_count, mds->mds_dt_objids);
RETURN(rc);
}
/* tell the LOV-OSC by how much to pre-create */
-int mds_lov_set_growth(struct mds_obd *mds, int count)
+int mds_dt_set_growth(struct mds_obd *mds, int count)
{
int rc;
ENTRY;
- rc = obd_set_info(mds->mds_lov_exp, strlen("growth_count"),
+ rc = obd_set_info(mds->mds_dt_exp, strlen("growth_count"),
"growth_count", sizeof(count), &count);
RETURN(rc);
}
-static int mds_lov_update_desc(struct obd_device *obd, struct obd_export *lov)
+static int mds_dt_update_desc(struct obd_device *obd, struct obd_export *lov)
{
struct mds_obd *mds = &obd->u.mds;
- int valsize = sizeof(mds->mds_lov_desc), rc, i;
- int old_count = mds->mds_lov_desc.ld_tgt_count;
+ int valsize = sizeof(mds->mds_dt_desc), rc, i;
+ int old_count = mds->mds_dt_desc.ld_tgt_count;
ENTRY;
rc = obd_get_info(lov, strlen("lovdesc") + 1, "lovdesc", &valsize,
- &mds->mds_lov_desc);
+ &mds->mds_dt_desc);
if (rc)
RETURN(rc);
/* The size of the LOV target table may have increased. */
- if (old_count >= mds->mds_lov_desc.ld_tgt_count) {
+ if (old_count >= mds->mds_dt_desc.ld_tgt_count) {
obd_id *ids;
int size;
- size = mds->mds_lov_desc.ld_tgt_count * sizeof(*ids);
+ size = mds->mds_dt_desc.ld_tgt_count * sizeof(*ids);
OBD_ALLOC(ids, size);
if (ids == NULL)
RETURN(-ENOMEM);
memset(ids, 0, size);
- if (mds->mds_lov_objids != NULL) {
+ if (mds->mds_dt_objids != NULL) {
int oldsize = old_count * sizeof(*ids);
- memcpy(ids, mds->mds_lov_objids, oldsize);
- OBD_FREE(mds->mds_lov_objids, oldsize);
+ memcpy(ids, mds->mds_dt_objids, oldsize);
+ OBD_FREE(mds->mds_dt_objids, oldsize);
}
- mds->mds_lov_objids = ids;
+ mds->mds_dt_objids = ids;
}
- i = lov_mds_md_size(mds->mds_lov_desc.ld_tgt_count);
+ i = lov_mds_md_size(mds->mds_dt_desc.ld_tgt_count);
if (i > mds->mds_max_mdsize)
mds->mds_max_mdsize = i;
- mds->mds_max_cookiesize = mds->mds_lov_desc.ld_tgt_count *
+ mds->mds_max_cookiesize = mds->mds_dt_desc.ld_tgt_count *
sizeof(struct llog_cookie);
- mds->mds_has_lov_desc = 1;
+ mds->mds_has_dt_desc = 1;
RETURN(0);
}
-int mds_lov_connect(struct obd_device *obd, char * lov_name)
+int mds_dt_connect(struct obd_device *obd, char * lov_name)
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0,};
int rc, i;
ENTRY;
- if (IS_ERR(mds->mds_lov_obd))
- RETURN(PTR_ERR(mds->mds_lov_obd));
+ if (IS_ERR(mds->mds_dt_obd))
+ RETURN(PTR_ERR(mds->mds_dt_obd));
- if (mds->mds_lov_obd)
+ if (mds->mds_dt_obd)
RETURN(0);
- spin_lock_init(&mds->mds_lov_lock);
- mds->mds_lov_obd = class_name2obd(lov_name);
- if (!mds->mds_lov_obd) {
+ spin_lock_init(&mds->mds_dt_lock);
+ mds->mds_dt_obd = class_name2obd(lov_name);
+ if (!mds->mds_dt_obd) {
CERROR("MDS cannot locate LOV %s\n", lov_name);
- mds->mds_lov_obd = ERR_PTR(-ENOTCONN);
+ mds->mds_dt_obd = ERR_PTR(-ENOTCONN);
RETURN(-ENOTCONN);
}
CDEBUG(D_HA, "obd: %s osc: %s lov_name: %s\n",
- obd->obd_name, mds->mds_lov_obd->obd_name, lov_name);
+ obd->obd_name, mds->mds_dt_obd->obd_name, lov_name);
- rc = obd_connect(&conn, mds->mds_lov_obd, &obd->obd_uuid,
+ rc = obd_connect(&conn, mds->mds_dt_obd, &obd->obd_uuid,
mds->mds_num + FILTER_GROUP_FIRST_MDS);
if (rc) {
CERROR("MDS cannot connect to LOV %s (%d)\n", lov_name, rc);
- mds->mds_lov_obd = ERR_PTR(rc);
+ mds->mds_dt_obd = ERR_PTR(rc);
RETURN(rc);
}
- mds->mds_lov_exp = class_conn2export(&conn);
+ mds->mds_dt_exp = class_conn2export(&conn);
- rc = obd_register_observer(mds->mds_lov_obd, obd);
+ rc = obd_register_observer(mds->mds_dt_obd, obd);
if (rc) {
CERROR("MDS cannot register as observer of LOV %s (%d)\n",
lov_name, rc);
GOTO(err_discon, rc);
}
- rc = mds_lov_update_desc(obd, mds->mds_lov_exp);
+ rc = mds_dt_update_desc(obd, mds->mds_dt_exp);
if (rc)
GOTO(err_reg, rc);
- rc = mds_lov_read_objids(obd);
+ rc = mds_dt_read_objids(obd);
if (rc) {
CERROR("cannot read %s: rc = %d\n", "lov_objids", rc);
GOTO(err_reg, rc);
}
rc = obd_llog_cat_initialize(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count, CATLIST);
+ mds->mds_dt_desc.ld_tgt_count, CATLIST);
if (rc) {
CERROR("failed to initialize catalog %d\n", rc);
GOTO(err_reg, rc);
/* If we're mounting this code for the first time on an existing FS,
* we need to populate the objids array from the real OST values */
- if (!mds->mds_lov_objids_valid) {
- int size = sizeof(obd_id) * mds->mds_lov_desc.ld_tgt_count;
- rc = obd_get_info(mds->mds_lov_exp, strlen("last_id"),
- "last_id", &size, mds->mds_lov_objids);
+ if (!mds->mds_dt_objids_valid) {
+ int size = sizeof(obd_id) * mds->mds_dt_desc.ld_tgt_count;
+ rc = obd_get_info(mds->mds_dt_exp, strlen("last_id"),
+ "last_id", &size, mds->mds_dt_objids);
if (!rc) {
- for (i = 0; i < mds->mds_lov_desc.ld_tgt_count; i++)
+ for (i = 0; i < mds->mds_dt_desc.ld_tgt_count; i++)
CWARN("got last object "LPU64" from OST %d\n",
- mds->mds_lov_objids[i], i);
- mds->mds_lov_objids_valid = 1;
- rc = mds_lov_write_objids(obd);
+ mds->mds_dt_objids[i], i);
+ mds->mds_dt_objids_valid = 1;
+ rc = mds_dt_write_objids(obd);
if (rc)
CERROR("got last objids from OSTs, but error "
"writing objids file: %d\n", rc);
RETURN(rc);
err_reg:
- obd_register_observer(mds->mds_lov_obd, NULL);
+ obd_register_observer(mds->mds_dt_obd, NULL);
err_discon:
- obd_disconnect(mds->mds_lov_exp, 0);
- mds->mds_lov_exp = NULL;
- mds->mds_lov_obd = ERR_PTR(rc);
+ obd_disconnect(mds->mds_dt_exp, 0);
+ mds->mds_dt_exp = NULL;
+ mds->mds_dt_obd = ERR_PTR(rc);
return rc;
}
-int mds_lov_disconnect(struct obd_device *obd, int flags)
+int mds_dt_disconnect(struct obd_device *obd, int flags)
{
struct mds_obd *mds = &obd->u.mds;
int rc = 0;
ENTRY;
- if (!IS_ERR(mds->mds_lov_obd) && mds->mds_lov_exp != NULL) {
+ if (!IS_ERR(mds->mds_dt_obd) && mds->mds_dt_exp != NULL) {
/* cleanup all llogging subsystems */
rc = obd_llog_finish(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count);
+ mds->mds_dt_desc.ld_tgt_count);
if (rc)
CERROR("failed to cleanup llogging subsystems\n");
- obd_register_observer(mds->mds_lov_obd, NULL);
+ obd_register_observer(mds->mds_dt_obd, NULL);
- rc = obd_disconnect(mds->mds_lov_exp, flags);
+ rc = obd_disconnect(mds->mds_dt_exp, flags);
/* if obd_disconnect fails (probably because the
* export was disconnected by class_disconnect_exports)
* then we just need to drop our ref. */
if (rc != 0)
- class_export_put(mds->mds_lov_exp);
- mds->mds_lov_exp = NULL;
- mds->mds_lov_obd = NULL;
+ class_export_put(mds->mds_dt_exp);
+ mds->mds_dt_exp = NULL;
+ mds->mds_dt_obd = NULL;
}
RETURN(rc);
}
case OBD_IOC_CATLOGLIST: {
- int count = mds->mds_lov_desc.ld_tgt_count;
+ int count = mds->mds_dt_desc.ld_tgt_count;
rc = llog_catalog_list(obd, count, data);
RETURN(rc);
__u32 group;
obd_llog_finish(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count);
+ mds->mds_dt_desc.ld_tgt_count);
push_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
rc = llog_ioctl(ctxt, cmd, data);
pop_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
obd_llog_cat_initialize(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count,
+ mds->mds_dt_desc.ld_tgt_count,
CATLIST);
group = FILTER_GROUP_FIRST_MDS + mds->mds_num;
valsize = sizeof(group);
- rc2 = obd_set_info(mds->mds_lov_exp, strlen("mds_conn"),
+ rc2 = obd_set_info(mds->mds_dt_exp, strlen("mds_conn"),
"mds_conn", valsize, &group);
if (!rc)
rc = rc2;
}
-struct mds_lov_sync_info {
+struct mds_dt_sync_info {
struct obd_device *mlsi_obd; /* the mds to sync */
struct obd_device *mlsi_watched; /* new lov target */
- int mlsi_index; /* index into mds_lov_objids */
+ int mlsi_index; /* index into mds_dt_objids */
};
-int mds_lov_synchronize(void *data)
+int mds_dt_synchronize(void *data)
{
- struct mds_lov_sync_info *mlsi = data;
+ struct mds_dt_sync_info *mlsi = data;
struct llog_ctxt *ctxt;
struct obd_device *obd;
struct obd_device *watched;
if (rc)
RETURN(rc);
- old_count = mds->mds_lov_desc.ld_tgt_count;
+ old_count = mds->mds_dt_desc.ld_tgt_count;
- rc = mds_lov_update_desc(obd, mds->mds_lov_exp);
+ rc = mds_dt_update_desc(obd, mds->mds_dt_exp);
if (rc)
RETURN(rc);
- count = mds->mds_lov_desc.ld_tgt_count;
+ count = mds->mds_dt_desc.ld_tgt_count;
LASSERT(count >= old_count);
vallen = sizeof(vals[1]);
RETURN(rc);
vals[0] = index;
- rc = mds_lov_set_info(obd->obd_self_export, strlen("next_id"),
- "next_id", 2, vals);
+ rc = mds_dt_set_info(obd->obd_self_export, strlen("next_id"),
+ "next_id", 2, vals);
if (rc)
RETURN(rc);
CWARN("MDS %s: %s now active, resetting orphans\n",
obd->obd_name, uuid->uuid);
- rc = mds_lov_clearorphans(&obd->u.mds, uuid);
+ rc = mds_dt_clearorphans(&obd->u.mds, uuid);
if (rc != 0) {
- CERROR("%s: failed at mds_lov_clearorphans: %d\n",
+ CERROR("%s: failed at mds_dt_clearorphans(): %d\n",
obd->obd_name, rc);
RETURN(rc);
}
RETURN(0);
}
-int mds_lov_start_synchronize(struct obd_device *obd,
- struct obd_device *watched, void *data)
+int mds_dt_start_synchronize(struct obd_device *obd,
+ struct obd_device *watched,
+ void *data)
{
- struct mds_lov_sync_info *mlsi;
+ struct mds_dt_sync_info *mlsi;
int rc;
ENTRY;
mlsi->mlsi_watched = watched;
mlsi->mlsi_index = (int)data;
- rc = kernel_thread(mds_lov_synchronize, mlsi, CLONE_VM | CLONE_FILES);
+ rc = kernel_thread(mds_dt_synchronize, mlsi, CLONE_VM | CLONE_FILES);
if (rc < 0)
- CERROR("%s: error starting mds_lov_synchronize: %d\n",
+ CERROR("%s: error starting mds_dt_synchronize(): %d\n",
obd->obd_name, rc);
else {
- CDEBUG(D_HA, "%s: mds_lov_synchronize thread: %d\n",
+ CDEBUG(D_HA, "%s: mds_dt_synchronize() thread: %d\n",
obd->obd_name, rc);
rc = 0;
}
CWARN("MDS %s: in recovery, not resetting orphans on %s\n",
obd->obd_name, uuid->uuid);
} else {
- rc = mds_lov_start_synchronize(obd, watched, data);
+ rc = mds_dt_start_synchronize(obd, watched, data);
}
RETURN(rc);
}
-int mds_lov_set_info(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val)
+int mds_dt_set_info(struct obd_export *exp, obd_count keylen,
+ void *key, obd_count vallen, void *val)
{
struct obd_device *obd = class_exp2obd(exp);
struct mds_obd *mds = &obd->u.mds;
RETURN(-EINVAL);
idx = *id;
- if ((idx != *id) || (idx >= mds->mds_lov_desc.ld_tgt_count))
+ if ((idx != *id) || (idx >= mds->mds_dt_desc.ld_tgt_count))
RETURN(-EINVAL);
CDEBUG(D_CONFIG, "idx: %d id: %llu\n", idx, *(id + 1));
- mds->mds_lov_objids[idx] = *++id;
+ mds->mds_dt_objids[idx] = *++id;
CDEBUG(D_CONFIG, "objid: %d: %lld\n", idx, *id);
/* XXX - should we be writing this out here ? */
- RETURN(mds_lov_write_objids(obd));
+ RETURN(mds_dt_write_objids(obd));
}
RETURN(-EINVAL);
}
-int mds_lov_update_config(struct obd_device *obd, int clean)
+int mds_dt_update_config(struct obd_device *obd, int clean)
{
struct mds_obd *mds = &obd->u.mds;
struct lvfs_run_ctxt saved;
RETURN(0);
cfg.cfg_instance = NULL;
- cfg.cfg_uuid = mds->mds_lov_uuid;
+ cfg.cfg_uuid = mds->mds_dt_uuid;
namelen = strlen(profile) + 20; /* -clean-######### */
OBD_ALLOC(name, namelen);
CDEBUG(D_INODE, "converting LOV EA on %lu/%u from V0 to V1\n",
inode->i_ino, inode->i_generation);
- rc = obd_unpackmd(obd->u.mds.mds_lov_exp, &lsm, lmm, lmm_size);
+ rc = obd_unpackmd(obd->u.mds.mds_dt_exp, &lsm, lmm, lmm_size);
if (rc < 0)
GOTO(conv_end, rc);
- rc = obd_packmd(obd->u.mds.mds_lov_exp, &lmm, lsm);
+ rc = obd_packmd(obd->u.mds.mds_dt_exp, &lmm, lsm);
if (rc < 0)
GOTO(conv_free, rc);
lmm_size = rc;
rc = err ? err : lmm_size;
GOTO(conv_free, rc);
conv_free:
- obd_free_memmd(obd->u.mds.mds_lov_exp, &lsm);
+ obd_free_memmd(obd->u.mds.mds_dt_exp, &lsm);
conv_end:
return rc;
}
struct lustre_msg *msg, int offset)
{
struct mds_obd *mds = &obd->u.mds;
- struct obd_export *lov_exp = mds->mds_lov_exp;
+ struct obd_export *dt_exp = mds->mds_dt_exp;
struct lov_mds_md *lmm= NULL;
struct lov_stripe_md *lsm = NULL;
struct obdo *oa = NULL;
}
lmm_size = msg->buflens[offset];
- rc = obd_unpackmd(lov_exp, &lsm, lmm, lmm_size);
+ rc = obd_unpackmd(dt_exp, &lsm, lmm, lmm_size);
if (rc < 0)
RETURN(0);
OBD_MD_FLCTIME;
obdo_from_inode(oa, inode, valid);
- rc = obd_revalidate_md(lov_exp, oa, lsm, &oti);
+ rc = obd_revalidate_md(dt_exp, oa, lsm, &oti);
if (rc == 0)
GOTO(out_oa, rc);
if (rc < 0) {
GOTO(out_oa, rc);
}
- rc = obd_packmd(lov_exp, &lmm, lsm);
+ rc = obd_packmd(dt_exp, &lmm, lsm);
if (rc < 0)
GOTO(out_oa, rc);
lmm_size = rc;
out_oa:
obdo_free(oa);
out_lsm:
- obd_free_memmd(lov_exp, &lsm);
+ obd_free_memmd(dt_exp, &lsm);
return rc;
}
if (body->valid & OBD_MD_FLEASIZE)
RETURN(0);
- OBD_ALLOC(*ids, mds->mds_lov_desc.ld_tgt_count * sizeof(**ids));
+ OBD_ALLOC(*ids, mds->mds_dt_desc.ld_tgt_count * sizeof(**ids));
if (*ids == NULL)
RETURN(-ENOMEM);
oti.oti_objid = *ids;
GOTO(out_oa, rc);
}
- mds_objids_from_lmm(*ids, lmm, &mds->mds_lov_desc);
+ mds_objids_from_lmm(*ids, lmm, &mds->mds_dt_desc);
lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, 0);
lmm_bufsize = req->rq_repmsg->buflens[offset];
/* check if things like lfs setstripe are sending us the ea */
if (rec->ur_flags & MDS_OPEN_HAS_EA) {
rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
- mds->mds_lov_exp,
+ mds->mds_dt_exp,
0, &lsm, rec->ur_eadata);
if (rc)
GOTO(out_oa, rc);
* striping for CMD. -p */
}
LASSERT(oa->o_gr >= FILTER_GROUP_FIRST_MDS);
- rc = obd_create(mds->mds_lov_exp, oa, &lsm, &oti);
+ rc = obd_create(mds->mds_dt_exp, oa, &lsm, &oti);
if (rc) {
int level = D_ERROR;
if (rc == -ENOSPC)
GOTO(out_oa, rc);
}
} else {
- rc = obd_iocontrol(OBD_IOC_LOV_SETEA, mds->mds_lov_exp,
+ rc = obd_iocontrol(OBD_IOC_LOV_SETEA, mds->mds_dt_exp,
0, &lsm, rec->ur_eadata);
if (rc) {
GOTO(out_oa, rc);
oa->o_size = inode->i_size;
obdo_from_inode(oa, inode, OBD_MD_FLTYPE|OBD_MD_FLATIME|
OBD_MD_FLMTIME| OBD_MD_FLCTIME| OBD_MD_FLSIZE);
- rc = obd_setattr(mds->mds_lov_exp, oa, lsm, &oti);
+ rc = obd_setattr(mds->mds_dt_exp, oa, lsm, &oti);
if (rc) {
CERROR("error setting attrs for inode %lu: rc %d\n",
inode->i_ino, rc);
LASSERT(lsm && lsm->lsm_object_id);
lmm = NULL;
- rc = obd_packmd(mds->mds_lov_exp, &lmm, lsm);
+ rc = obd_packmd(mds->mds_dt_exp, &lmm, lsm);
if (!id_ino(rec->ur_id2))
- obd_free_memmd(mds->mds_lov_exp, &lsm);
+ obd_free_memmd(mds->mds_dt_exp, &lsm);
LASSERT(rc >= 0);
lmm_size = rc;
body->eadatasize = rc;
LASSERT(lmm_bufsize >= lmm_size);
memcpy(lmm_buf, lmm, lmm_size);
- obd_free_diskmd(mds->mds_lov_exp, &lmm);
+ obd_free_diskmd(mds->mds_dt_exp, &lmm);
out_oa:
oti_free_cookies(&oti);
obdo_free(oa);
out_ids:
if (rc) {
- OBD_FREE(*ids, mds->mds_lov_desc.ld_tgt_count * sizeof(**ids));
+ OBD_FREE(*ids, mds->mds_dt_desc.ld_tgt_count * sizeof(**ids));
*ids = NULL;
}
RETURN(rc);
CDEBUG(D_INODE, "mfd %p, cookie "LPX64"\n", mfd,
mfd->mfd_handle.h_cookie);
if (ids != NULL) {
- mds_lov_update_objids(obd, ids);
- OBD_FREE(ids, sizeof(*ids) * mds->mds_lov_desc.ld_tgt_count);
+ mds_dt_update_objids(obd, ids);
+ OBD_FREE(ids, sizeof(*ids) * mds->mds_dt_desc.ld_tgt_count);
}
//if (rc)
// mds_mfd_destroy(mfd);
cleanup_phase = 1; /* parent dentry and lock */
/* try to retrieve MEA data for this dir */
- rc = mds_get_lmv_attr(obd, dparent->d_inode, &mea, &mea_size);
+ rc = mds_md_get_attr(obd, dparent->d_inode, &mea, &mea_size);
if (rc)
GOTO(cleanup, rc);
* we do not read fid from EA here, because it is already
* updated and thus we avoid not needed IO, locking, etc.
*/
- body->valid |= OBD_MD_FID;
mds_pack_inode2body(obd, body, dchild->d_inode, 0);
} else {
mds_pack_inode2body(obd, body, dchild->d_inode, 1);
CDEBUG(D_HA, "cancelling %d cookies\n",
(int)(mlcd->mlcd_cookielen / sizeof(*mlcd->mlcd_cookies)));
- rc = obd_unpackmd(obd->u.mds.mds_lov_exp, &lsm, mlcd->mlcd_lmm,
+ rc = obd_unpackmd(obd->u.mds.mds_dt_exp, &lsm, mlcd->mlcd_lmm,
mlcd->mlcd_eadatalen);
if (rc < 0) {
CERROR("bad LSM cancelling %d log cookies: rc %d\n",
rc = err;
}
- err = mds_lov_write_objids(obd);
+ err = mds_dt_write_objids(obd);
if (err) {
log_pri = D_ERROR;
if (rc == 0)
if (rc < 0)
GOTO(cleanup, rc);
- rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, mds->mds_lov_exp,
+ rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, mds->mds_dt_exp,
0, &lsm, rec->ur_eadata);
if (rc)
GOTO(cleanup, rc);
- obd_free_memmd(mds->mds_lov_exp, &lsm);
+ obd_free_memmd(mds->mds_dt_exp, &lsm);
rc = fsfilt_set_md(obd, inode, handle, rec->ur_eadata,
rec->ur_eadatalen);
if (rec->ur_iattr.ia_valid & (ATTR_ATIME | ATTR_ATIME_SET))
body->valid |= OBD_MD_FLATIME;
- if (rc == 0 && rec->ur_cookielen && !IS_ERR(mds->mds_lov_obd)) {
+ if (rc == 0 && rec->ur_cookielen && !IS_ERR(mds->mds_dt_obd)) {
OBD_ALLOC(mlcd, sizeof(*mlcd) + rec->ur_cookielen +
rec->ur_eadatalen);
if (mlcd) {
ldlm_lock_dump_handle(D_OTHER, lockh);
/* try to retrieve MEA data for this dir */
- rc = mds_get_lmv_attr(obd, dparent->d_inode, &mea, &mea_size);
+ rc = mds_md_get_attr(obd, dparent->d_inode, &mea, &mea_size);
if (rc)
GOTO(cleanup, rc);
* before obd_create() is called, o_fid is not known if
* this is not recovery of cause.
*/
- rc = obd_create(mds->mds_lmv_exp, oa, NULL, NULL);
+ rc = obd_create(mds->mds_md_exp, oa, NULL, NULL);
if (rc) {
CERROR("can't create remote inode: %d\n", rc);
DEBUG_REQ(D_ERROR, req, "parent "LPU64"/%u name %s mode %o",
/* fill reply */
body = lustre_msg_buf(req->rq_repmsg,
0, sizeof(*body));
- body->valid |= OBD_MD_FLID | OBD_MD_MDS |
- OBD_MD_FID;
+ body->valid |= OBD_MD_FLID | OBD_MD_MDS;
obdo2id(&body->id1, oa);
obdo_free(oa);
if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
op_data->create_mode |= MDS_MODE_REPLAY;
- rc = md_unlink(mds->mds_lmv_exp, op_data, &request);
+ rc = md_unlink(mds->mds_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
cleanup_phase = 2;
rc = mds_finish_transno(mds, dparent ? dparent->d_inode : NULL,
handle, req, rc, 0);
if (!rc)
- (void)obd_set_info(mds->mds_lov_exp, strlen("unlinked"),
+ (void)obd_set_info(mds->mds_dt_exp, strlen("unlinked"),
"unlinked", 0, NULL);
switch(cleanup_phase) {
case 5: /* pending_dir semaphore */
op_data->id1 = *(rec->ur_id1);
op_data->namelen = 0;
op_data->name = NULL;
- rc = md_link(mds->mds_lmv_exp, op_data, &request);
+ rc = md_link(mds->mds_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc)
GOTO(cleanup, rc);
mds_pack_dentry2id(obd, &op_data->id1, dentry, 1);
it.it_op = IT_UNLINK;
- rc = md_enqueue(mds->mds_lmv_exp, LDLM_IBITS, &it, LCK_EX,
+ rc = md_enqueue(mds->mds_md_exp, LDLM_IBITS, &it, LCK_EX,
op_data, rlockh, NULL, 0, ldlm_completion_ast,
mds_blocking_ast, NULL);
OBD_FREE(op_data, sizeof(*op_data));
}
op_data->id2 = *rec->ur_id2;
- rc = md_rename(mds->mds_lmv_exp, op_data, NULL, 0,
+ rc = md_rename(mds->mds_md_exp, op_data, NULL, 0,
rec->ur_tgt, rec->ur_tgtlen - 1, &req2);
OBD_FREE(op_data, sizeof(*op_data));
if (lmm_size == 0)
RETURN(0);
- rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size);
+ rc = obd_unpackmd(mds->mds_dt_exp, &lsm, lmm, lmm_size);
if (rc < 0) {
CERROR("Error unpack md %p\n", lmm);
RETURN(rc);
oti.oti_logcookies = logcookies;
}
- rc = obd_destroy(mds->mds_lov_exp, oa, lsm, &oti);
+ rc = obd_destroy(mds->mds_dt_exp, oa, lsm, &oti);
obdo_free(oa);
if (rc)
CDEBUG(D_INODE, "destroy orphan objid 0x"LPX64" on ost error "
"%d\n", lsm->lsm_object_id, rc);
out_free_memmd:
- obd_free_memmd(mds->mds_lov_exp, &lsm);
+ obd_free_memmd(mds->mds_dt_exp, &lsm);
RETURN(rc);
}
int rc, err;
ENTRY;
- LASSERT(mds->mds_lov_obd != NULL);
+ LASSERT(mds->mds_dt_obd != NULL);
OBD_ALLOC(lmm, mds->mds_max_mdsize);
if (lmm == NULL)
if (ctxt == NULL || mds == NULL)
RETURN(-EOPNOTSUPP);
- count = mds->mds_lov_desc.ld_tgt_count;
+ count = mds->mds_dt_desc.ld_tgt_count;
size = sizeof(*idarray) * count;
OBD_ALLOC(idarray, size);
MDS=`find /proc/fs/lustre/mds/* -type d | head -n1 | sed 's/.*\///'`
[ -z "$MDS" ] && echo "no MDS available, skipping llog test" && exit 0
-insmod ../obdclass/llog_test.o || exit 1
+test "x$(uname -r | grep -o "2.6")" = "x2.6" && MODEXT=ko || MODEXT=o
+
+insmod ../obdclass/llog_test.$MODEXT || exit 1
lctl modules > $TMP/ogdb-`hostname`
# take care of UML developers