Whamcloud - gitweb
LU-7991 quota: project quota against ZFS backend
[fs/lustre-release.git] / lustre / osd-zfs / osd_handler.c
index 974a0a2..5adcd1a 100644 (file)
@@ -166,8 +166,6 @@ static void osd_trans_commit_cb(void *cb_data, int error)
 
        lu_device_put(lud);
        th->th_dev = NULL;
-       lu_context_exit(&th->th_ctx);
-       lu_context_fini(&th->th_ctx);
        OBD_FREE_PTR(oh);
 
        EXIT;
@@ -225,8 +223,6 @@ static int osd_trans_start(const struct lu_env *env, struct dt_device *d,
                /* add commit callback */
                dmu_tx_callback_register(oh->ot_tx, osd_trans_commit_cb, oh);
                oh->ot_assigned = 1;
-               lu_context_init(&th->th_ctx, th->th_tags);
-               lu_context_enter(&th->th_ctx);
                lu_device_get(&d->dd_lu_dev);
        }
 
@@ -360,7 +356,6 @@ static struct thandle *osd_trans_create(const struct lu_env *env,
        th = &oh->ot_super;
        th->th_dev = dt;
        th->th_result = 0;
-       th->th_tags = LCT_TX_HANDLE;
        RETURN(th);
 }
 
@@ -1083,6 +1078,15 @@ static int osd_mount(const struct lu_env *env,
        if (rc)
                GOTO(err, rc);
 
+#ifdef ZFS_PROJINHERIT
+       if (dmu_objset_projectquota_enabled(o->od_os)) {
+               rc = __osd_obj2dnode(o->od_os, DMU_PROJECTUSED_OBJECT,
+                                    &o->od_projectused_dn);
+               if (rc && rc != -ENOENT)
+                       GOTO(err, rc);
+       }
+#endif
+
        /* 1. initialize oi before any file create or file open */
        rc = osd_oi_init(env, o);
        if (rc)
@@ -1163,6 +1167,13 @@ static void osd_umount(const struct lu_env *env, struct osd_device *o)
                o->od_groupused_dn = NULL;
        }
 
+#ifdef ZFS_PROJINHERIT
+       if (o->od_projectused_dn) {
+               osd_dnode_rele(o->od_projectused_dn);
+               o->od_projectused_dn = NULL;
+       }
+#endif
+
        if (o->od_os != NULL) {
                if (!o->od_dt_dev.dd_rdonly)
                        /* force a txg sync to get all commit callbacks */