lu_device_get(&d->dd_lu_dev);
oh->ot_dev_link = lu_ref_add(&d->dd_lu_dev.ld_reference,
"osd-tx", th);
-
- /*
- * XXX: current rule is that we first start tx,
- * then lock object(s), but we can't use
- * this rule for data (due to locking specifics
- * in ldiskfs). also in long-term we'd like to
- * use usually-used (locks;tx) ordering. so,
- * UGLY thing is that we'll use one ordering for
- * data (ofd) and reverse ordering for metadata
- * (mdd). then at some point we'll fix the latter
- */
- if (dev->od_is_md) {
- LASSERT(oti->oti_r_locks == 0);
- LASSERT(oti->oti_w_locks == 0);
- }
-
oti->oti_txns++;
rc = 0;
} else {
LASSERT(oti->oti_txns == 1);
oti->oti_txns--;
- /*
- * XXX: current rule is that we first start tx,
- * then lock object(s), but we can't use
- * this rule for data (due to locking specifics
- * in ldiskfs). also in long-term we'd like to
- * use usually-used (locks;tx) ordering. so,
- * UGLY thing is that we'll use one ordering for
- * data (ofd) and reverse ordering for metadata
- * (mdd). then at some point we'll fix the latter
- */
- if (osd_dt_dev(th->th_dev)->od_is_md) {
- LASSERT(oti->oti_r_locks == 0);
- LASSERT(oti->oti_w_locks == 0);
- }
rc = dt_txn_hook_stop(env, th);
if (rc != 0)
CERROR("Failure in transaction hook: %d\n", rc);
param->ddp_max_name_len = LDISKFS_NAME_LEN;
param->ddp_max_nlink = LDISKFS_LINK_MAX;
param->ddp_block_shift = sb->s_blocksize_bits;
+ param->ddp_mount_type = LDD_MT_LDISKFS;
param->ddp_mntopts = 0;
if (test_opt(sb, XATTR_USER))
param->ddp_mntopts |= MNTOPT_USERXATTR;
LASSERT(dt_object_exists(dt));
LASSERT(inode->i_op != NULL && inode->i_op->getxattr != NULL);
- LASSERT(osd_read_locked(env, obj) || osd_write_locked(env, obj));
if (osd_object_auth(env, dt, capa, CAPA_OPC_META_READ))
return -EACCES;
}
LINVRNT(osd_invariant(obj));
+ if (is_quota_glb_feat(feat))
+ result = osd_quota_migration(env, dt, feat);
+
return result;
}
OBD_PAGE_ALLOC(__page, CFS_ALLOC_STD);
if (__page == NULL)
- RETURN(-ENOMEM);
+ GOTO(out, rc = -ENOMEM);
str = lustre_cfg_string(cfg, 2);
s_flags = simple_strtoul(str, NULL, 0);
out:
if (__page)
OBD_PAGE_FREE(__page);
+ if (rc)
+ fsfilt_put_ops(o->od_fsops);
RETURN(rc);
}
break;
case LCFG_CLEANUP:
lu_dev_del_linkage(d->ld_site, d);
- err = 0;
- break;
+ err = osd_shutdown(env, o);
+ break;
default:
err = -ENOSYS;
}
struct lu_device *dev)
{
struct osd_device *osd = osd_dev(dev);
- int result;
+ int result = 0;
ENTRY;
- /* 2. setup quota slave instance */
- osd->od_quota_slave = qsd_init(env, osd->od_svname, &osd->od_dt_dev,
- osd->od_proc_entry);
- if (IS_ERR(osd->od_quota_slave)) {
- result = PTR_ERR(osd->od_quota_slave);
- osd->od_quota_slave = NULL;
- RETURN(result);
- }
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 55, 0)
/* Unfortunately, the current MDD implementation relies on some specific
* code to be executed in the OSD layer. Since OFD now also uses the OSD
#warning "all is_md checks must be removed from osd-ldiskfs"
#endif
- if (!osd->od_is_md)
- RETURN(0);
+ if (osd->od_is_md) {
+ /* 1. setup local objects */
+ result = llo_local_objects_setup(env, lu2md_dev(pdev),
+ lu2dt_dev(dev));
+ if (result)
+ RETURN(result);
+ }
- /* 3. setup local objects */
- result = llo_local_objects_setup(env, lu2md_dev(pdev), lu2dt_dev(dev));
- RETURN(result);
+ /* 2. setup quota slave instance */
+ osd->od_quota_slave = qsd_init(env, osd->od_svname, &osd->od_dt_dev,
+ osd->od_proc_entry);
+ if (IS_ERR(osd->od_quota_slave)) {
+ result = PTR_ERR(osd->od_quota_slave);
+ osd->od_quota_slave = NULL;
+ }
+
+ RETURN(result);
}
static const struct lu_object_operations osd_lu_obj_ops = {