Skip to content

Instantly share code, notes, and snippets.

View lundman's full-sized avatar

Jorgen Lundman lundman

View GitHub Profile
@lundman
lundman / shmget_osm.c
Created December 3, 2020 06:19
Run oracbledb client libraries on illumos/OmniOS
/*
* Solaris defines
* int shmget_osm(key_t key, size_t size, int shmflg,
* size_t granule_size);
*
* Which takes one additional argument "granule_size" to regular
* int shmget(key_t key, size_t size, int shmflg);
*
* This is a wrapper library to attempt to support it enough for
* Oracle DB client library to work.
diff --git a/module/zfs/dsl_deadlist.c b/module/zfs/dsl_deadlist.c
index a2e2a1f..9a82a18 100644
--- a/module/zfs/dsl_deadlist.c
+++ b/module/zfs/dsl_deadlist.c
@@ -105,6 +105,11 @@ dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object)
mutex_init(&dl->dl_lock, NULL, MUTEX_DEFAULT, NULL);
dl->dl_os = os;
dl->dl_object = object;
+ dl->dl_dbuf = NULL;
+ dl->dl_oldfmt = B_TRUE;
@lundman
lundman / arc.c.patch
Created July 13, 2018 03:29
Temporary kmem_cache_alloc work around
diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c
index b2cc3bd..d714f60 100644
--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -3713,6 +3713,13 @@ arc_hdr_realloc_crypt(arc_buf_hdr_t *hdr, boolean_t need_crypt)
} else {
arc_hdr_clear_flags(nhdr, ARC_FLAG_PROTECTED);
}
+
+ // Due to lazy cons/dest in kmem_cache - clear it
@lundman
lundman / 10.10patch
Last active April 11, 2018 08:08
10.10 build fix
diff --git a/include/sys/ZFSDataset.h b/include/sys/ZFSDataset.h
index 7ca3c25..c45c2e3 100644
--- a/include/sys/ZFSDataset.h
+++ b/include/sys/ZFSDataset.h
@@ -28,6 +28,7 @@
#ifdef __cplusplus
#include <IOKit/storage/IOMedia.h>
+#include <AvailabilityMacros.h>
@lundman
lundman / write_test.c
Created March 27, 2018 08:54
kernel write
diff --git a/module/zfs/zfs_vnops_osx.c b/module/zfs/zfs_vnops_osx.c
index be23696..410ed8d 100644
--- a/module/zfs/zfs_vnops_osx.c
+++ b/module/zfs/zfs_vnops_osx.c
@@ -193,6 +193,48 @@ dprintf("%s ENOTSUP\n", __func__);
return (ENOTSUP);
}
+
+
@lundman
lundman / hardlink corrective
Last active February 14, 2018 08:58
hardlink corrective
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 1996fd1632c..e50147a98da 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3776,9 +3776,11 @@ zdb_embedded_block(char *thing)
{
blkptr_t bp = { { { { 0 } } } };
unsigned long long *words = (void *)&bp;
- char buf[SPA_MAXBLOCKSIZE];
+ char *buf;
@lundman
lundman / illumos-crypto.c
Created August 23, 2016 08:00
cipher tests
unsigned char statickey[32] = {
0x5c, 0x95, 0x64, 0x42, 0x00, 0x82, 0x1c, 0x9e,
0xd4, 0xac, 0x01, 0x83, 0xc4, 0x9c, 0x14, 0x97,
0x1c, 0x93, 0x04, 0xe2, 0x90, 0x99, 0x40, 0xfe,
0x54, 0xec, 0xf1, 0x8a, 0x54, 0x22, 0x11, 0xff
};
#include <sys/zio_crypt.h>
int cipher_test2(int verbose)
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index 5143fb5..5703a37 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -296,6 +296,15 @@ out:
return (error);
}
+static void vdev_disk_close_thread(void *arg)
+{
@lundman
lundman / fslogger.c
Created October 28, 2015 06:41
fslogger.c - compile fixes for packed arrays.
/*
* fslogger.c
*
* A patched version of Amit Singh's fslogger utility, which logs file system
* events in OS X.
*
* This version fixes a small bug where four characters were missing from
* the beginning of each file path. It also eliminates a compiler warning.
*
* To compile: