-
Notifications
You must be signed in to change notification settings - Fork 1
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
Zfs 196 #13
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can generic CreateFile()
be used here instead?
); | ||
if (hFile == INVALID_HANDLE_VALUE) | ||
{ | ||
return E_FAIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -1,7 +1,7 @@ | |||
| |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio 15 | |||
VisualStudioVersion = 15.0.27004.2005 | |||
# Visual Studio Version 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required
@@ -95,7 +95,6 @@ Global | |||
{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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not req
@@ -2463,7 +2463,7 @@ static void | |||
dump_cachefile(const char *cachefile) | |||
{ | |||
int fd; | |||
struct stat statbuf; | |||
struct _stat64 statbuf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May not be required
@@ -805,7 +805,7 @@ typedef struct zpool_load_policy { | |||
* The location of the pool configuration repository, shared between kernel and | |||
* userland. | |||
*/ | |||
#define ZPOOL_CACHE "/etc/zfs/zpool.cache" | |||
#define ZPOOL_CACHE "\\SystemRoot\\System32\\drivers\\zpool.cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert it for now
//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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for commented sections.
@@ -771,7 +773,7 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) | |||
if (fd == -1) | |||
return (errno); | |||
|
|||
if (fstat_blk(fd, &st) == -1) { | |||
if (fstat(fd, &st) == -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this change
@@ -797,7 +998,7 @@ vn_openat(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, | |||
int ret; | |||
|
|||
ASSERT(startvp == rootdir); | |||
(void) sprintf(realpath, "/%s", path); | |||
(void) sprintf(realpath, "%s", path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required here
ZFSin/zfs/module/zfs/spa_config.c
Outdated
@@ -100,7 +101,7 @@ spa_config_load(void) | |||
(void) snprintf(pathname, MAXPATHLEN, "%s%s", | |||
"", spa_config_path); | |||
|
|||
file = kobj_open_file(pathname); | |||
file = kobj_open_file("C:\\WINDOWS\\System32\\drivers\\zpool.cache"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required
return -1; | ||
|
||
ntstatus = ZwCreateFile(&handle, | ||
GENERIC_WRITE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle flags
and mode
properly
No description provided.