Skip to content

Commit 90fedbc

Browse files
committed
Implement FileIdAllExtdBothDirectoryInformation
Not sure anything will call it, but since we implemented it, we might as well keep it. Signed-off-by: Jorgen Lundman <lundman@lundman.net>
1 parent accda73 commit 90fedbc

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

module/os/windows/zfs/zfs_vnops_os.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,7 @@ zfs_readdir(vnode_t *vp, emitdir_ptr_t *ctx, cred_t *cr, zfs_ccb_t *zccb,
13741374
case FileObjectIdInformation:
13751375
case FileIdExtdDirectoryInformation:
13761376
case FileIdExtdBothDirectoryInformation:
1377+
case FileIdAllExtdBothDirectoryInformation:
13771378
break;
13781379
default:
13791380
dprintf("%s: ** Directory type %d not handled!\n",

module/os/windows/zfs/zfs_vnops_windows_lib.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,48 @@ zfs_readdir_emitdir(zfsvfs_t *zfsvfs, const char *name, emitdir_ptr_t *ctx,
12551255
fiebdi->FileNameLength = namelenholder;
12561256
break;
12571257

1258+
case FileIdAllExtdBothDirectoryInformation:
1259+
structsize = FIELD_OFFSET(
1260+
FILE_ID_ALL_EXTD_BOTH_DIR_INFORMATION,
1261+
FileName[0]);
1262+
if (ctx->outcount + structsize +
1263+
namelenholder > ctx->bufsize)
1264+
break;
1265+
FILE_ID_ALL_EXTD_BOTH_DIR_INFORMATION *fiaebdi =
1266+
(FILE_ID_ALL_EXTD_BOTH_DIR_INFORMATION *)
1267+
ctx->bufptr;
1268+
next_offset = &fiebdi->NextEntryOffset;
1269+
1270+
fiaebdi->FileIndex = ctx->offset;
1271+
fiaebdi->AllocationSize.QuadPart =
1272+
AllocationSize;
1273+
fiaebdi->EndOfFile.QuadPart =
1274+
S_ISDIR(tzp->z_mode) ? 0 :
1275+
tzp->z_size;
1276+
TIME_UNIX_TO_WINDOWS(mtime,
1277+
fiaebdi->LastWriteTime.QuadPart);
1278+
TIME_UNIX_TO_WINDOWS(ctime,
1279+
fiaebdi->ChangeTime.QuadPart);
1280+
TIME_UNIX_TO_WINDOWS(crtime,
1281+
fiaebdi->CreationTime.QuadPart);
1282+
TIME_UNIX_TO_WINDOWS(tzp->z_atime,
1283+
fiaebdi->LastAccessTime.QuadPart);
1284+
fiaebdi->EaSize = ea_size;
1285+
fiaebdi->ReparsePointTag = reparse_tag;
1286+
fiaebdi->FileAttributes =
1287+
zfs_getwinflags(tzp->z_pflags, S_ISDIR(tzp->z_mode));
1288+
fiaebdi->ShortNameLength = 0;
1289+
fiaebdi->FileId.QuadPart = tzp->z_id;
1290+
1291+
RtlCopyMemory(&fiaebdi->FileId128.Identifier[0], &tzp->z_id,
1292+
sizeof (UINT64));
1293+
guid = dmu_objset_fsid_guid(zfsvfs->z_os);
1294+
RtlCopyMemory(&fiaebdi->FileId128.Identifier[sizeof (UINT64)],
1295+
&guid, sizeof (UINT64));
1296+
nameptr = fiaebdi->FileName;
1297+
fiaebdi->FileNameLength = namelenholder;
1298+
break;
1299+
12581300
default:
12591301
panic("%s unknown listing type %d\n",
12601302
__func__, ctx->dirlisttype);

0 commit comments

Comments
 (0)