Conversation
… read,stateless write in user space
implementation of more zfs_file interfaces in user mode seek,flush,getattr and changes in pread,pwrite
ZFSin/zfs/lib/libzpool/kernel.c
Outdated
| mbstowcs(buf, path, sizeof(buf)); | ||
| HANDLE hFile = CreateFileW( | ||
| buf, | ||
| GENERIC_READ | GENERIC_WRITE, |
There was a problem hiding this comment.
You need to set this according to flags and mode params
| wchar_t buf[PATH_MAX]; | ||
| UNICODE_STRING uniName; | ||
| mbstowcs(buf, path, sizeof(buf)); | ||
| HANDLE hFile = CreateFileW( |
There was a problem hiding this comment.
Can generic CreateFile() be used here instead?
| ); | ||
| if (hFile == INVALID_HANDLE_VALUE) | ||
| { | ||
| return E_FAIL; |
There was a problem hiding this comment.
How is E_FAIL defined? Can this be replaced with EIO? Idem for all such uses.
ZFSin/zfs/lib/libzpool/kernel.c
Outdated
| NULL | ||
| ); | ||
| if (hFile == INVALID_HANDLE_VALUE) | ||
| { |
There was a problem hiding this comment.
Follow coding guidelines.
"The opening brace ( { ) should be on the same line as the structure tag, and the
closing brace should be alone on a line in column 1."
Example:
if (condition) {
statements;
} else {
statements;
}
| } | ||
| /*ARGSUSED*/ | ||
|
|
||
| DWORD zfs_file_off(zfs_file_t* hFile) // 1 |
There was a problem hiding this comment.
Would be good to document what the interface does, like in ZoL:
/*
* Request current file pointer offset
*
* fp - pointer to file
*
* Returns current file offset.
*/
Idem for all other interfaces.
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.27004.2005 | ||
| # Visual Studio Version 16 |
| {9AFC9A86-1D07-49E1-9296-F7A3979B751D}.Debug|ARM64.Deploy.0 = Debug|ARM64 | ||
| {9AFC9A86-1D07-49E1-9296-F7A3979B751D}.Debug|x64.ActiveCfg = Debug|x64 | ||
| {9AFC9A86-1D07-49E1-9296-F7A3979B751D}.Debug|x64.Build.0 = Debug|x64 | ||
| {9AFC9A86-1D07-49E1-9296-F7A3979B751D}.Debug|x64.Deploy.0 = Debug|x64 |
| { | ||
| int fd; | ||
| struct stat statbuf; | ||
| struct _stat64 statbuf; |
| * userland. | ||
| */ | ||
| #define ZPOOL_CACHE "/etc/zfs/zpool.cache" | ||
| #define ZPOOL_CACHE "\\SystemRoot\\System32\\drivers\\zpool.cache" |
| //int zfs_file_pread(zfs_file_t *fp, void *buf, size_t len, loff_t off, | ||
| // ssize_t *resid); | ||
|
|
||
| /* |
There was a problem hiding this comment.
Check for commented sections.
| return (errno); | ||
|
|
||
| if (fstat_blk(fd, &st) == -1) { | ||
| if (fstat(fd, &st) == -1) { |
|
|
||
| ASSERT(startvp == rootdir); | ||
| (void) sprintf(realpath, "/%s", path); | ||
| (void) sprintf(realpath, "%s", path); |
ZFSin/zfs/module/zfs/spa_config.c
Outdated
| "", spa_config_path); | ||
|
|
||
| file = kobj_open_file(pathname); | ||
| file = kobj_open_file("C:\\WINDOWS\\System32\\drivers\\zpool.cache"); |
| return -1; | ||
|
|
||
| ntstatus = ZwCreateFile(&handle, | ||
| GENERIC_WRITE, |
There was a problem hiding this comment.
handle flags and mode properly
No description provided.