Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up source to get Linux builds working #119

Merged
merged 15 commits into from
Aug 17, 2022
Merged
58 changes: 58 additions & 0 deletions .github/workflows/build_for_wsl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: build_for_wsl.yaml

on:
push:
pull_request:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Reclaim disk space
run: |
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
- name: Install dependencies
run: |
sudo apt-get update
xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt sudo apt-get install -qq
sudo apt-get clean
- name: Autogen.sh
run: |
./autogen.sh
- name: Configure
run: |
./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
- name: Make
run: |
make -j16 --no-print-directory --silent pkg-utils pkg-kmod
#make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod
- name: get files
run: ls -Rla
- name: Prepare artifacts
if: failure()
run: |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
sudo dmesg > $RESULTS_PATH/dmesg
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
sudo chmod +r $RESULTS_PATH/*
# Replace ':' in dir names, actions/upload-artifact doesn't support it
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- uses: actions/upload-artifact@v2
if: failure()
with:
name: Test logs Ubuntu-${{ matrix.os }}
path: |
/var/tmp/test_results/*
!/var/tmp/test_results/current
if-no-files-found: ignore

- uses: actions/upload-artifact@v2
with:
name: build result
path: |
*.deb
*.rpm
6 changes: 0 additions & 6 deletions cmd/zpool/os/linux/zpool_vdev_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,3 @@ check_file(const char *file, boolean_t force, boolean_t isspare)
{
return (check_file_generic(file, force, isspare));
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were two? hah neat

int
check_file(const char *file, boolean_t force, boolean_t isspare)
{
return (check_file_generic(file, force, isspare));
}
4 changes: 2 additions & 2 deletions include/sys/dsl_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ struct dsl_scan;
struct dsl_crypto_params;
struct dsl_deadlist;

extern uint64_t zfs_dirty_data_max;
extern uint64_t zfs_dirty_data_max_max;
extern ZFS_MODULE_ULONG zfs_dirty_data_max;
extern ZFS_MODULE_ULONG zfs_dirty_data_max_max;
extern ZFS_MODULE_ULONG zfs_wrlog_data_max;
extern int zfs_dirty_data_sync_percent;
extern int zfs_dirty_data_max_percent;
Expand Down
5 changes: 5 additions & 0 deletions include/sys/vdev_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ typedef struct vdev_file {
uint64_t vdev_win_offset; /* soft partition start */
uint64_t vdev_win_length; /* soft partition length */
} vdev_file_t;
#else
/* Grabbed from https://github.com/openzfs/zfs/blob/1d3ba0bf01020f5459b1c28db3979129088924c0/include/sys/vdev_file.h#L36 */
typedef struct vdev_file {
zfs_file_t* vf_file;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "*vf_file;"

} vdev_file_t;
#endif

extern void vdev_file_init(void);
Expand Down
49 changes: 0 additions & 49 deletions include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,42 +530,6 @@ typedef struct
uint64_t count;
}stat_pair;

typedef struct {
unsigned __int64 read_iops;
unsigned __int64 write_iops;
unsigned __int64 total_iops;
unsigned __int64 read_bytes;
unsigned __int64 write_bytes;
unsigned __int64 total_bytes;
unsigned __int64 ddt_entry_count; // number of elments in ddt ,zpool only
unsigned __int64 ddt_dspace; // size of ddt on disk ,zpool only
unsigned __int64 ddt_mspace; // size of ddt in-core ,zpool only
unsigned __int64 vsx_active_queue_sync_read;
unsigned __int64 vsx_active_queue_sync_write;
unsigned __int64 vsx_active_queue_async_read;
unsigned __int64 vsx_active_queue_async_write;
unsigned __int64 vsx_pend_queue_sync_read;
unsigned __int64 vsx_pend_queue_sync_write;
unsigned __int64 vsx_pend_queue_async_read;
unsigned __int64 vsx_pend_queue_async_write;
unsigned __int64 vsx_queue_histo_sync_read_time;
unsigned __int64 vsx_queue_histo_sync_read_count;
unsigned __int64 vsx_queue_histo_async_read_time;
unsigned __int64 vsx_queue_histo_async_read_count;
unsigned __int64 vsx_queue_histo_sync_write_time;
unsigned __int64 vsx_queue_histo_sync_write_count;
unsigned __int64 vsx_queue_histo_async_write_time;
unsigned __int64 vsx_queue_histo_async_write_count;
unsigned __int64 vsx_total_histo_read_time;
unsigned __int64 vsx_total_histo_read_count;
unsigned __int64 vsx_total_histo_write_time;
unsigned __int64 vsx_total_histo_write_count;
unsigned __int64 vsx_disk_histo_read_time;
unsigned __int64 vsx_disk_histo_read_count;
unsigned __int64 vsx_disk_histo_write_time;
unsigned __int64 vsx_disk_histo_write_count;
unsigned __int64 dp_dirty_total_io; // zpool only
} zpool_perf_counters;

typedef struct {
uint64_t arcstat_hits;
Expand Down Expand Up @@ -665,19 +629,6 @@ extern int zfsdev_getminor(zfs_file_t *fp, minor_t *minorp);
extern uint_t zfs_fsyncer_key;
extern uint_t zfs_allow_log_key;

NTSTATUS NTAPI
ZFSinPerfCallBack(PCW_CALLBACK_TYPE Type, PPCW_CALLBACK_INFORMATION Info,
PVOID Context);

void ZFSinPerfCollect(PCW_MASK_INFORMATION CollectData);
void ZFSinPerfVdevCollect(PCW_MASK_INFORMATION CollectData);
void ZFSinCachePerfCollect(PCW_MASK_INFORMATION CollectData);

PUNICODE_STRING MapInvalidChars(PUNICODE_STRING InstanceName);

void ZFSinPerfEnumerate(PCW_MASK_INFORMATION EnumerateInstances);
void ZFSinPerfVdevEnumerate(PCW_MASK_INFORMATION EnumerateInstances);
void ZFSinCachePerfEnumerate(PCW_MASK_INFORMATION EnumerateInstances);


#endif /* _KERNEL */
Expand Down
5 changes: 5 additions & 0 deletions lib/libspl/include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,9 @@ typedef union {

#include <sys/param.h> /* for NBBY */

#ifndef _WIN32
#define posix_memalign_free free
#define NTSTATUS int32_t
#endif

#endif
54 changes: 54 additions & 0 deletions module/os/windows/zfs/zfs_ioctl_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,60 @@
#include <zfs_gitrev.h>

#include <Wdmsec.h>



typedef struct {
unsigned __int64 read_iops;
unsigned __int64 write_iops;
unsigned __int64 total_iops;
unsigned __int64 read_bytes;
unsigned __int64 write_bytes;
unsigned __int64 total_bytes;
unsigned __int64 ddt_entry_count; // number of elments in ddt ,zpool only
unsigned __int64 ddt_dspace; // size of ddt on disk ,zpool only
unsigned __int64 ddt_mspace; // size of ddt in-core ,zpool only
unsigned __int64 vsx_active_queue_sync_read;
unsigned __int64 vsx_active_queue_sync_write;
unsigned __int64 vsx_active_queue_async_read;
unsigned __int64 vsx_active_queue_async_write;
unsigned __int64 vsx_pend_queue_sync_read;
unsigned __int64 vsx_pend_queue_sync_write;
unsigned __int64 vsx_pend_queue_async_read;
unsigned __int64 vsx_pend_queue_async_write;
unsigned __int64 vsx_queue_histo_sync_read_time;
unsigned __int64 vsx_queue_histo_sync_read_count;
unsigned __int64 vsx_queue_histo_async_read_time;
unsigned __int64 vsx_queue_histo_async_read_count;
unsigned __int64 vsx_queue_histo_sync_write_time;
unsigned __int64 vsx_queue_histo_sync_write_count;
unsigned __int64 vsx_queue_histo_async_write_time;
unsigned __int64 vsx_queue_histo_async_write_count;
unsigned __int64 vsx_total_histo_read_time;
unsigned __int64 vsx_total_histo_read_count;
unsigned __int64 vsx_total_histo_write_time;
unsigned __int64 vsx_total_histo_write_count;
unsigned __int64 vsx_disk_histo_read_time;
unsigned __int64 vsx_disk_histo_read_count;
unsigned __int64 vsx_disk_histo_write_time;
unsigned __int64 vsx_disk_histo_write_count;
unsigned __int64 dp_dirty_total_io; // zpool only
} zpool_perf_counters;

NTSTATUS NTAPI
ZFSinPerfCallBack(PCW_CALLBACK_TYPE Type, PPCW_CALLBACK_INFORMATION Info,
PVOID Context);

void ZFSinPerfCollect(PCW_MASK_INFORMATION CollectData);
void ZFSinPerfVdevCollect(PCW_MASK_INFORMATION CollectData);
void ZFSinCachePerfCollect(PCW_MASK_INFORMATION CollectData);

PUNICODE_STRING MapInvalidChars(PUNICODE_STRING InstanceName);

void ZFSinPerfEnumerate(PCW_MASK_INFORMATION EnumerateInstances);
void ZFSinPerfVdevEnumerate(PCW_MASK_INFORMATION EnumerateInstances);
void ZFSinCachePerfEnumerate(PCW_MASK_INFORMATION EnumerateInstances);

#include <sys/spa_impl.h>
#include <sys/zfs_ioctl.h>
#include "../OpenZFS_perf.h"
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/dsl_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
* capped at zfs_dirty_data_max_max. It can also be overridden with a module
* parameter.
*/
uint64_t zfs_dirty_data_max = 0;
uint64_t zfs_dirty_data_max_max = 0;
ZFS_MODULE_ULONG zfs_dirty_data_max = 0;
ZFS_MODULE_ULONG zfs_dirty_data_max_max = 0;
int zfs_dirty_data_max_percent = 10;
int zfs_dirty_data_max_max_percent = 25;

Expand All @@ -117,7 +117,7 @@ ZFS_MODULE_ULONG zfs_wrlog_data_max = 0;
* zfs_dirty_data_max), push out a txg. This should be less than
* zfs_vdev_async_write_active_min_dirty_percent.
*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are removing static?

static int zfs_dirty_data_sync_percent = 20;
int zfs_dirty_data_sync_percent = 20;

/*
* Once there is this amount of dirty data, the dmu_tx_delay() will kick in
Expand Down
4 changes: 4 additions & 0 deletions module/zfs/zvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,9 @@ zvol_fini_impl(void)
}

/* ZFS ZVOLDI */
// HACK FIXME
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these be in zvol_os.c ?

#ifdef _WIN32

_Function_class_(PINTERFACE_REFERENCE)
void
IncZvolRef(PVOID Context)
Expand Down Expand Up @@ -1771,3 +1774,4 @@ zvol_name2zvolState(const char *name, uint32_t *openCount)
mutex_exit(&zv->zv_state_lock);
return (zv);
}
#endif