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

Reimplement REPARSE POINTS #161

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ZFSin/ZFSin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<RootNamespace>ZFSin</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down
9 changes: 9 additions & 0 deletions ZFSin/spl/include/sys/sysmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ extern uint32_t zone_get_hostid(void *zone);
extern void spl_setup(void);
extern void spl_cleanup(void);

#define major(x) \
((unsigned)((((x) >> 31 >> 1) & 0xfffff000) | \
(((x) >> 8) & 0x00000fff)))
#define minor(x) ((unsigned)((((x) >> 12) & 0xffffff00) | ((x)&0x000000ff)))

#define makedev(x, y) \
((((x)&0xfffff000ULL) << 32) | (((x)&0x00000fffULL) << 8) | \
(((y)&0xffffff00ULL) << 12) | (((y)&0x000000ffULL)))

#define makedevice(maj,min) makedev(maj,min)

/* common macros */
Expand Down
1 change: 0 additions & 1 deletion ZFSin/spl/include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ typedef struct {
unsigned char g_guid[KAUTH_GUID_SIZE];
} guid_t;

#define minor(x) (x)
#pragma warning( disable: 4296 ) // expression is always true
#pragma error( disable: 4296 ) // expression is always true
#pragma warning( disable: 4703 ) // potentially uninitialized local pointer variable
Expand Down
2 changes: 1 addition & 1 deletion ZFSin/spl/module/spl/spl-vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ int vnode_isswap(vnode_t *vp)

int vnode_isfifo(vnode_t *vp)
{
return 0;
return vp->v_type == VFIFO;
}

int vnode_islnk(vnode_t *vp)
Expand Down
27 changes: 25 additions & 2 deletions ZFSin/zfs/module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, zfs_dirlist_t *zccb, int flags,
switch (dirlisttype) {
case FileFullDirectoryInformation:
case FileIdBothDirectoryInformation:
case FileIdFullDirectoryInformation:
case FileBothDirectoryInformation:
case FileDirectoryInformation:
case FileNamesInformation:
Expand Down Expand Up @@ -2946,6 +2947,28 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, zfs_dirlist_t *zccb, int flags,

break;

case FileIdFullDirectoryInformation:
// Full is the same as Both, but no Shortname
structsize = FIELD_OFFSET(FILE_ID_FULL_DIR_INFORMATION, FileName[0]);
if (outcount + structsize + namelenholder > bufsize) break;

eodp = (FILE_FULL_DIR_INFORMATION *)bufptr;
FILE_ID_FULL_DIR_INFORMATION *fifdi = (FILE_ID_FULL_DIR_INFORMATION *)bufptr;
fifdi->AllocationSize.QuadPart = S_ISDIR(tzp->z_mode) ? 0 : P2ROUNDUP(tzp->z_size, zfs_blksz(tzp));
fifdi->EndOfFile.QuadPart = S_ISDIR(tzp->z_mode) ? 0 : tzp->z_size;
TIME_UNIX_TO_WINDOWS(mtime, fifdi->LastWriteTime.QuadPart);
TIME_UNIX_TO_WINDOWS(ctime, fifdi->ChangeTime.QuadPart);
TIME_UNIX_TO_WINDOWS(crtime, fifdi->CreationTime.QuadPart);
TIME_UNIX_TO_WINDOWS(tzp->z_atime, fifdi->LastAccessTime.QuadPart);
fifdi->EaSize = tzp->z_pflags & ZFS_REPARSEPOINT ? 0xa0000003 : xattr_getsize(ZTOV(tzp));
fifdi->FileAttributes = zfs_getwinflags(tzp);
fifdi->FileId.QuadPart = objnum;
fifdi->FileIndex = offset;
nameptr = fifdi->FileName;
fifdi->FileNameLength = namelenholder;

break;

case FileBothDirectoryInformation:
structsize = FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[0]);
if (outcount + structsize + namelenholder > bufsize) break;
Expand Down Expand Up @@ -3239,8 +3262,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
#ifdef sun
vap->va_rdev = vp->v_rdev;
#else
// if (vnode_isblk(vp) || vnode_ischr(vp))
// vap->va_rdev = zfs_cmpldev(rdev);
if (vnode_isblk(vp) || vnode_ischr(vp))
vap->va_rdev = zfs_cmpldev(rdev);
#endif
//vap->va_seq = zp->z_seq;
vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */
Expand Down
Loading