Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Don't use #pragma...



details:   https://anonhg.NetBSD.org/src/rev/02aacc7cd7f6
branches:  trunk
changeset: 813803:02aacc7cd7f6
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Feb 19 19:25:59 2016 +0000

description:
Don't use #pragma weak to implicitly change argument types.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c |  40 ++++++++++++++++++++--
 1 files changed, 35 insertions(+), 5 deletions(-)

diffs (78 lines):

diff -r 2c3fc61f2eb7 -r 02aacc7cd7f6 external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c Fri Feb 19 19:25:22 2016 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c Fri Feb 19 19:25:59 2016 +0000
@@ -1267,7 +1267,13 @@
        return (0);
 }
 
-#pragma weak dmu_buf_will_dirty = dbuf_will_dirty
+__attribute__((__weak__)) void
+dmu_buf_will_dirty(dmu_buf_t *db_fake, dmu_tx_t *tx)
+{
+       dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
+       dbuf_will_dirty(db, tx);
+}
+
 void
 dbuf_will_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
 {
@@ -1309,7 +1315,13 @@
        (void) dbuf_dirty(db, tx);
 }
 
-#pragma weak dmu_buf_fill_done = dbuf_fill_done
+__attribute__((__weak__)) void
+dmu_buf_fill_done(dmu_buf_t *db_fake, dmu_tx_t *tx)
+{
+       dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
+       dbuf_fill_done(db, tx);
+}
+
 /* ARGSUSED */
 void
 dbuf_fill_done(dmu_buf_impl_t *db, dmu_tx_t *tx)
@@ -1815,7 +1827,13 @@
        dn->dn_bonus = dbuf_create(dn, 0, DB_BONUS_BLKID, dn->dn_dbuf, NULL);
 }
 
-#pragma weak dmu_buf_add_ref = dbuf_add_ref
+__attribute__((__weak__)) void
+dmu_buf_add_ref(dmu_buf_t *db_fake, void *tag)
+{
+       dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
+       dbuf_add_ref(db, tag);
+}
+
 void
 dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
 {
@@ -1823,7 +1841,13 @@
        ASSERT(holds > 1);
 }
 
-#pragma weak dmu_buf_rele = dbuf_rele
+__attribute__((__weak__)) void
+dmu_buf_rele(dmu_buf_t *db_fake, void *tag)
+{
+       dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
+       dbuf_rele(db, tag);
+}
+
 void
 dbuf_rele(dmu_buf_impl_t *db, void *tag)
 {
@@ -1889,7 +1913,13 @@
        }
 }
 
-#pragma weak dmu_buf_refcount = dbuf_refcount
+__attribute__((__weak__)) uint64_t
+dmu_buf_refcount(dmu_buf_t *db_fake)
+{
+       dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake;
+       return dbuf_refcount(db);
+}
+
 uint64_t
 dbuf_refcount(dmu_buf_impl_t *db)
 {



Home | Main Index | Thread Index | Old Index