if (ls) {
lu_site_fini(ls);
OBD_FREE_PTR(ls);
+ d->ld_site = NULL;
}
LASSERT(atomic_read(&d->ld_ref) == 0);
md_device_fini(&m->mdt_md_dev);
LASSERT(obd);
spin_lock_init(&m->mdt_transno_lock);
-#if 0
- /* FIXME: We need to load them from disk. But now fake it */
- m->mdt_last_transno = 1;
- m->mdt_last_committed = 1;
-#endif
+
m->mdt_max_mdsize = MAX_MD_SIZE;
m->mdt_max_cookiesize = sizeof(struct llog_cookie);
EXIT;
}
-static void osd_ro(const struct lu_context *ctx,
- struct dt_device *d, int sync)
+enum {
+ SYNC_DEVICE_CREDITS = 3
+};
+
+static void osd_ro(const struct lu_context *ctx, struct dt_device *d, int sync)
{
- struct thandle *th;
- struct txn_param param = {
- .tp_credits = 3
- };
+ struct thandle *th;
+ struct osd_thread_info *oti = lu_context_key_get(ctx, &osd_key);
+ struct txn_param *param = &oti->oti_txn;
ENTRY;
CERROR("*** setting device %s read-only ***\n", LUSTRE_OSD0_NAME);
- th = osd_trans_start(ctx, d, ¶m);
+ param->tp_credits = SYNC_DEVICE_CREDITS;
+
+ th = osd_trans_start(ctx, d, param);
if (!IS_ERR(th))
osd_trans_stop(ctx, th);
LASSERT(obj->oo_owner != ctx);
down_write(&obj->oo_sem);
LASSERT(obj->oo_owner == NULL);
- /*
- * Write lock assumes transaction.
- */
- /* open need it without transaction
- * LASSERT(oti->oti_txns > 0);
- */
obj->oo_owner = ctx;
oti->oti_w_locks++;
}
inode->i_blksize = attr->la_blksize;
if (bits & LA_FLAGS) {
- /*
- * Horrible ext3 legacy. Flags are better to be handled in
- * mdd.
- */
struct ldiskfs_inode_info *li = LDISKFS_I(inode);
li->i_flags = (li->i_flags & ~LDISKFS_FL_USER_MODIFIABLE) |