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

WIP: Zvol trim #16

Closed
wants to merge 93 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
3bbfff6
Windows: bring in SPL sourcefiles
lundman Jul 31, 2020
5bea50d
Windows: ZFS source file place holders
lundman Jul 31, 2020
33f79d9
Windows: Add source files and CMake
lundman Oct 30, 2020
abd9f7e
Upstream: Add Windows support to OpenZFS
lundman Oct 30, 2020
caab128
Windows: Compile kernel driver, and load
lundman Nov 22, 2020
342fb4a
Windows: bring in userland
lundman Nov 24, 2020
fe67d68
Windows: port userland, and cmd/zpool
lundman Dec 15, 2020
fcaaf5a
Upstream: add termios.h
lundman Dec 15, 2020
a9f0e3e
Upstream: highbits64 already defined.
lundman Dec 15, 2020
9dab053
Upstream: Pass zfs_handle_t to unmount
lundman Dec 15, 2020
29411a4
Upstream: this probably isn't the header for NORETURN
lundman Dec 15, 2020
1725010
Upstream: Add MSVC to comiler directives
lundman Dec 15, 2020
92c09d7
Upstream: No OS xdr header
lundman Dec 15, 2020
4b08049
Upstream: dance around constructor
lundman Dec 15, 2020
2204109
Upstream: Additional header
lundman Dec 15, 2020
c531c7a
Upstream: Add Windows VENDOR
lundman Dec 15, 2020
f6b05d4
Upstrema: Add Windows mount options
lundman Dec 15, 2020
97f38b0
Upstream: Windows will do own run_process
lundman Dec 15, 2020
fa5631c
Upstream: Use usleep
lundman Dec 15, 2020
37d3002
Upstream: Add TASKQ_EMPTY
lundman Dec 15, 2020
53b80e0
Upstream: Remove dlopen and global var for now
lundman Dec 15, 2020
cb9c129
Windows: squash
lundman Dec 15, 2020
00cb9c5
Upstream: Add Windows properties
lundman Dec 15, 2020
2319fa2
Upstream: No OS libgen.h
lundman Dec 15, 2020
26e25ef
Upstream: No OS uio.h
lundman Dec 15, 2020
05eacb8
Windows: port cmd/zfs
lundman Dec 17, 2020
6d1d6d7
Upstream: OS defines highbit64
lundman Dec 17, 2020
ae586f3
Windows: bring in cmd/zdb cmd/zstream cmd/kstat
lundman Dec 17, 2020
fc24af1
Windows: cmake files
lundman Dec 17, 2020
6662d15
Windows: source files are not optional
lundman Dec 17, 2020
b58761b
Windows: Include all sources files
lundman Dec 20, 2020
3ede4f4
Windows: get closer to ioctls working from userland
lundman Dec 21, 2020
bb1b3bc
Windows: Fix ioctl from userland, basic port works
lundman Dec 22, 2020
fef1f2f
Upstream: Add zfs_resolve_shortname_os()
lundman Dec 23, 2020
81a6037
Windows: Add import scan code
lundman Dec 23, 2020
3f5ebac
Upstream: Different random on Windows
lundman Dec 23, 2020
74c1e92
Upstream: Add slash to DEV path to avoid backslashes
lundman Dec 23, 2020
248b2bd
Windows: Porting work
lundman Dec 23, 2020
37f6ab5
Upstream: Use of posix_memalign need special free
lundman Dec 28, 2020
b7a06bc
Windows: Allow all policy calls
lundman Dec 28, 2020
abc365e
Windows: Attempt to handle vdev_path and vdev_physpath
lundman Dec 28, 2020
30a52e7
Windows: expand paths to #size#offset#/path
lundman Dec 28, 2020
7ebdc62
Windows: milestone, create pool
lundman Jan 4, 2021
3970868
Upstream: Add mimic property
lundman Jan 4, 2021
8c4225c
Upstream: remove assert
lundman Jan 5, 2021
51eb10f
Windows: additional work
lundman Jan 5, 2021
12188ab
Upstream: libzfs_unmount fix [squash]
lundman Jan 6, 2021
e238b83
Windows: work on unmount/export
lundman Jan 6, 2021
32120f2
Windows: Fix zfs_save_arguments/basename for zpool/zfs
lundman Jan 22, 2021
f78b2f8
Windows: Fix import scan and vdev_file reading
lundman Jan 25, 2021
3dcab38
Windows: Lets not delete pool files and Write shouldnt call read.
lundman Jan 25, 2021
e7d7857
Windows: Latest import code.
lundman Jan 25, 2021
d34ce7c
Windows: change to use cert sha1 and temporarily include gitrev
lundman Jan 26, 2021
1517831
Windows: Add devstudio individual components list
lundman Jan 26, 2021
fdd161e
Windows: Warnings - low hanging fruit
lundman Jan 26, 2021
a5f19ae
Windows: further warnings reduction
lundman Jan 26, 2021
2a8e3bd
Windows: Auto generate zfs_gitrev.h
lundman Jan 27, 2021
b0f9dcd
Windows: minor header fix
lundman Jan 28, 2021
8bc9376
Windows: Attempt to implement taskq_dispatch_delay()
lundman Jan 28, 2021
ed8bb7a
Windows: taskq must clear delay
lundman Jan 29, 2021
7b4ccb2
Windows: Bring in zfsinstaller.exe
lundman Jan 29, 2021
4539a66
Windows: Redo vdev_disk.c IO to avoid allocations
lundman Jan 30, 2021
689dbcf
Windows: zfsinstaller used old ZFSin names
lundman Feb 3, 2021
ff5e232
Windows: Cleanup CMake work, to build sys
lundman Feb 5, 2021
a4792cf
Windows: uninstall was sending wrong ioctl
lundman Feb 8, 2021
9a2bde9
Windows: zvol_fini uses system_taskq, fix unload order
lundman Feb 9, 2021
788bc3d
Windows: Add Inno Setup (debug)
lundman Feb 9, 2021
d1c023c
Windows: can we keep offset+length separate?
lundman Feb 12, 2021
ad02dbb
Revert "Windows: can we keep offset+length separate?"
lundman Feb 12, 2021
c4fe66f
Windows: Correct zpool import for disks
lundman Feb 12, 2021
a96cc4a
Windows: hack in export\umount
lundman Feb 12, 2021
0bfe2d9
Windows: vcruntime.dll dependency removal
lundman Feb 12, 2021
640e79b
Windows: zpool create fixes
lundman Feb 15, 2021
6667821
Upstream: Add partition after zpool_label_disk
lundman Feb 15, 2021
e69b44a
Windows: Can not rely on Windows stat.h
lundman Feb 15, 2021
8b56924
Upstream: shorthand path never calls stat()
lundman Feb 15, 2021
110c6d9
Windows: Allow harddiskXPartitionY shortname
lundman Feb 15, 2021
18d25a5
Windows: Handle partitions only Offline wholedisk
lundman Feb 16, 2021
8eccd0b
Upstream: update_vdev_config_dev_strs() can change path
lundman Feb 16, 2021
dcdf629
Windows: Handle partition zpool import
lundman Feb 16, 2021
1fdda70
Windows: Fight CMake and OpenSSL
lundman Feb 17, 2021
2f7bbd3
Windows: Check for error code when calling zfs_dirlook()
lundman Feb 18, 2021
944f0c7
Windows: re-arrange the release of stream dvp
lundman Feb 22, 2021
a00d883
Upstream: allow Windows zvols to have 1 longhold
lundman Mar 4, 2021
35a9024
Windows: fix zvol export/destroy
lundman Mar 4, 2021
bd8d764
Upstream: strftime differences cause abort()
lundman Mar 15, 2021
86dd83c
fix for cstyle. (#13)
lundman Apr 6, 2021
ef8bfe7
vnode_put(NULL) and missing mutex
lundman Apr 6, 2021
9b8e054
Upstream: Avoid ASSERTs in zdb
lundman Apr 6, 2021
a41e650
Upstream: ddi_stroul would not return end ptr
lundman Apr 6, 2021
43ce553
Windows: userland vdev_file needs to handle partition hack
lundman Apr 6, 2021
7d7aab6
Upstream: aligned_malloc must call aligned_free
lundman Apr 6, 2021
e04f197
WIP: Handle scsi unmap/discard requests to zvol_unmap
lundman Apr 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
91 changes: 91 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.13)
project(OpenZFS)

include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/contrib/windows/cmake")
find_package(WDK REQUIRED)

option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)

set(OPENSSL_USE_STATIC_LIBS TRUE)
set(OPENSSL_MSVC_STATIC_RT TRUE)
find_package(OpenSSL REQUIRED)
# message(STATUS "OpenSSL libs: " ${OPENSSL_LIBRARIES})
# Seriously, why does it pick MD versions and not MT like requested?
# string(REGEX REPLACE "64MD" "64MT" INTERNAL_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES})
#message(STATUS "OpenSSL libs: " ${OPENSSL_CRYPTO_LIBRARY})
#cmake_path(GET ${OPENSSL_LIBRARIES} ROOT_PATH rootPath)
#get_filename_component(rootPath "${OPENSSL_CRYPTO_LIBRARY}" DIRECTORY)
#message(STATUS "OpenSSL root: " ${rootPath})


# Attempt to simulate scripts/make-gitrev.h and zfs_gitrev.h
include(GetGitRevisionDescription)
git_describe_working_tree(GIT_GITREV)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/zfs_gitrev.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/include/zfs_gitrev.h" @ONLY)
#

function(use_clang)
# It seems "-include file" is "/FI file" on Windows
add_definitions("/FI ${CMAKE_SOURCE_DIR}/include/os/windows/zfs/zfs_config.h")
set(CMAKE_C_COMPILER clang-cl.exe PARENT_SCOPE)
set(CMAKE_CXX_COMPILER clang-cl.exe PARENT_SCOPE)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_compile_options(-m32)
else()
add_compile_options(-m64)
endif()

add_compile_options(
# These are all MS headers
-Wno-nonportable-include-path
-Wno-unknown-pragmas
-Wno-ignored-pragma-intrinsic
-Wno-pragma-pack
-Wno-microsoft-enum-forward-reference
-Wno-visibility
-Wno-microsoft-anon-tag
-Wno-ignored-attributes
-Wno-unused-command-line-argument
-Wno-unused-local-typedef
-Wno-int-to-void-pointer-cast
# ZFS related
-Wno-misleading-indentation
-Wno-dangling-else
-Wno-missing-field-initializers
#-fms-extensions
-Wno-unused-function
)
endfunction()

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_definitions(-D__x86_32__ -D__i386 -D__i386__ -D_LP32 -DWIN32)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D__x86_64__ -D_LP64 -D__x86_64 -D_AMD64_ -D_WIN64 -DAMD64 -DWIN64)
else()
message(FATAL_ERROR "Unsupported architecture")
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDBG -DZFS_DEBUG)
endif()

# Avoid dependency add_compile_definitions vcruntime140.dll
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")

# Let's try to emulate gitrev
#find_path(BASH_DIR NAMES bash.exe git-bash.exe PATHS "/c/Program Files (x86)/Git/")
#execute_process(COMMAND $BASH_DIR -c "scripts/make_gitrev.h include/zfs_gitrev.h" )


add_subdirectory(module)
#add_subdirectory(module/zfs)
#add_subdirectory(zfsinstaller)

add_subdirectory(lib)
add_subdirectory(cmd)

16 changes: 16 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"variables": []
}
]
}
12 changes: 12 additions & 0 deletions cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

include_directories(PRIVATE "${CMAKE_SOURCE_DIR}/lib/libspl/include/os/windows/" "${CMAKE_SOURCE_DIR}/lib/libspl/include" "${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/lib/os/windows/libpthread" "${OPENSSL_INCLUDE_DIR}")

add_definitions(-D_CRT_SECURE_NO_WARNINGS)

add_subdirectory(zpool)
add_subdirectory(zfs)
add_subdirectory(zdb)
add_subdirectory(zstream)
add_subdirectory(os/windows/kstat)
add_subdirectory(os/windows/zfsinstaller)
13 changes: 13 additions & 0 deletions cmd/os/windows/kstat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

use_clang()

um_add_executable(kstat kstat.c)

include_directories(PRIVATE "${CMAKE_SOURCE_DIR}/lib/os/windows")

target_link_libraries(kstat PRIVATE libkstat)
install(TARGETS kstat RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES $<TARGET_PDB_FILE:kstat>
DESTINATION "${CMAKE_INSTALL_BINDIR}"
OPTIONAL
)
Loading