From: nikita Date: Tue, 5 Sep 2006 15:59:46 +0000 (+0000) Subject: small cleanups X-Git-Tag: v1_8_0_110~486^2~1011 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=885f15fbbc988ba6d79fdaeca7c585b5d44e437a;p=fs%2Flustre-release.git small cleanups --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 4ce4203..18094b4 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2422,6 +2422,7 @@ static void mdt_fini(const struct lu_context *ctx, struct mdt_device *m) 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); @@ -2447,11 +2448,7 @@ static int mdt_init0(const struct lu_context *ctx, struct mdt_device *m, 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); diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 238596a..74f1d2c 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -577,18 +577,22 @@ static void osd_sync(const struct lu_context *ctx, 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); @@ -635,12 +639,6 @@ static void osd_object_write_lock(const struct lu_context *ctx, 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++; } @@ -742,10 +740,6 @@ static int osd_inode_setattr(const struct lu_context *ctx, 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) |