Whamcloud - gitweb
LU-18947 osd-zfs: rename TXG_* to DMU_TX_* 39/58939/6
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 24 Apr 2025 08:22:03 +0000 (15:22 +0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 14 May 2025 03:57:03 +0000 (03:57 +0000)
zfs-2.3.99-237-gf69631992
  dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_*

Rename TXG_* to DMU_TX_* and provide replacements for older
releases of zfs.

HPE-bug-id: LUS-12840
Test-Parameters: trivial
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I34c72b9ed6c284cdd67bffea7eeac09e2c9f358f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58939
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Akash B <akash-b@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_oi.c
lustre/osd-zfs/osd_scrub.c

index af860af..50849e8 100644 (file)
@@ -199,7 +199,7 @@ static int osd_trans_start(const struct lu_env *env, struct dt_device *d,
                 */
                RETURN(-EIO);
 
-       rc = -dmu_tx_assign(oh->ot_tx, TXG_WAIT);
+       rc = -dmu_tx_assign(oh->ot_tx, DMU_TX_WAIT);
        if (unlikely(rc != 0)) {
                /* dmu will call commit callback with error code during abort */
                if (!lu_device_is_md(&d->dd_lu_dev) && rc == -ENOSPC)
@@ -1018,7 +1018,7 @@ int osd_unlinked_object_free(const struct lu_env *env, struct osd_device *osd,
        dmu_tx_hold_free(tx, oid, 0, DMU_OBJECT_END);
        osd_tx_hold_zap(tx, osd->od_unlinked->dn_object, osd->od_unlinked,
                        FALSE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc != 0) {
                CWARN("%s: Cannot assign tx for %llu: rc = %d\n",
                      osd->od_svname, oid, rc);
index 53ee420..16096ce 100644 (file)
@@ -1417,7 +1417,7 @@ osd_dirent_update(const struct lu_env *env, struct osd_device *dev,
                RETURN(-ENOMEM);
 
        dmu_tx_hold_zap(tx, zap, TRUE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (!rc)
                rc = -zap_update(dev->od_os, zap, key, 8, sizeof(*zde) / 8,
                                 (const void *)zde, tx);
@@ -1447,7 +1447,7 @@ static int osd_update_entry_for_agent(const struct lu_env *env,
 
        dmu_tx_hold_sa_create(tx, osd_find_dnsize(osd, OSD_BASE_EA_IN_BONUS));
        dmu_tx_hold_zap(tx, zap, FALSE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc) {
                dmu_tx_abort(tx);
                GOTO(out, rc);
index a98bd7c..8fd2b89 100644 (file)
 #undef kmem_cache_free
 #endif
 
+/*
+ * zfs-2.3.99-237-gf69631992
+ * dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_*
+ */
+#ifndef DMU_TX_WAIT
+#define DMU_TX_WAIT            TXG_WAIT
+#endif
+
 #define ZFS_VERSION_CODE       \
        OBD_OCD_VERSION(ZFS_MAJOR, ZFS_MINOR, ZFS_PATCH, ZFS_FIX)
 
index 6709cae..39702a7 100644 (file)
@@ -346,7 +346,7 @@ static void osd_obj_set_blksize(const struct lu_env *env,
        }
 
        dmu_tx_hold_bonus(tx, dn->dn_object);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc) {
                dmu_tx_abort(tx);
                CERROR("%s: fail to assign tx to set blksize for "DFID": rc = %d\n",
index bfd8e3d..390669f 100644 (file)
@@ -167,7 +167,7 @@ static int osd_obj_create(const struct lu_env *env, struct osd_device *o,
        dmu_tx_hold_bonus(tx, parent);
        dmu_tx_hold_zap(tx, parent, TRUE, name);
        dmu_tx_hold_sa_create(tx, ZFS_SA_BASE_ATTR_SIZE);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc) {
                dmu_tx_abort(tx);
                GOTO(out, rc);
@@ -237,7 +237,7 @@ static int osd_oi_destroy(const struct lu_env *env, struct osd_device *o,
        dmu_tx_mark_netfree(tx);
        dmu_tx_hold_free(tx, oid, 0, DMU_OBJECT_END);
        osd_tx_hold_zap(tx, oid, rootdn, FALSE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc) {
                dmu_tx_abort(tx);
                GOTO(out, rc);
index 4c7bb09..0380b22 100644 (file)
@@ -75,7 +75,7 @@ int osd_scrub_refresh_mapping(const struct lu_env *env,
                                   sizeof(info->oti_str), &dn);
        osd_tx_hold_zap(tx, zapid, dn,
                        ops == DTO_INDEX_INSERT ? TRUE : FALSE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc) {
                dmu_tx_abort(tx);
                GOTO(log, rc);
@@ -1963,7 +1963,7 @@ static int osd_remove_ml_file(const struct lu_env *env, struct osd_device *dev,
        }
 
        dmu_tx_hold_zap(tx, dir, FALSE, NULL);
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc)
                GOTO(abort, rc);
 
@@ -2098,7 +2098,7 @@ static int osd_create_lastid(const struct lu_env *env, struct osd_device *dev,
        dmu_tx_hold_sa_create(tx, osd_find_dnsize(dev, OSD_BASE_EA_IN_BONUS));
        dmu_tx_hold_zap(tx, dir, FALSE, NULL);
 
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc)
                GOTO(abort, rc);
 
@@ -2325,7 +2325,7 @@ static int osd_scan_lastid_seq(const struct lu_env *env,
        if (lastid < lastid_known)
                dmu_tx_hold_write_by_dnode(tx, dn, 0, sizeof(lastid));
 
-       rc = -dmu_tx_assign(tx, TXG_WAIT);
+       rc = -dmu_tx_assign(tx, DMU_TX_WAIT);
        if (rc)
                GOTO(abort, rc);