Skip to content

Instantly share code, notes, and snippets.

View lundman's full-sized avatar

Jorgen Lundman lundman

View GitHub Profile
@lundman
lundman / gist:8128184
Created December 26, 2013 00:14
ARC dynamic resize
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index a26c98d..6ab61c4 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -2487,6 +2487,32 @@ arc_reclaim_thread(void *dummy __unused)
mutex_enter(&arc_reclaim_thr_lock);
while (arc_thread_exit == 0) {
+#ifdef __APPLE__
+#ifdef _KERNEL
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
index c8065a7..412ad2e 100644
--- a/module/zfs/zfs_znode.c
+++ b/module/zfs/zfs_znode.c
@@ -1329,6 +1329,11 @@ again:
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
getnewvnode_drop_reserve();
+ printf("Waiting on zp %p to die!\n", zp);
+ delay(hz>>1);
diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c
index e504aef..3eae791 100644
--- a/cmd/zed/zed_event.c
+++ b/cmd/zed/zed_event.c
@@ -36,6 +36,7 @@
#include <sys/zfs_ioctl.h>
#include <time.h>
#include <unistd.h>
+#include <signal.h>
#include "zed.h"
diff --git a/module/zfs/zfs_vnops_osx.c b/module/zfs/zfs_vnops_osx.c
index 03d2fda..3f913ab 100644
--- a/module/zfs/zfs_vnops_osx.c
+++ b/module/zfs/zfs_vnops_osx.c
@@ -1427,6 +1427,10 @@ void vnop_reclaim_thread(void *arg)
count = 0;
#endif
+
+ /* If ZIL is closed (suspend_fs), we nede to */
@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:
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 / 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/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 / hardlink corrective
Last active February 14, 2018 08:58
hardlink corrective
@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);
}
+
+