- Define d_type for ".", ".." and ".zfs" directories.
- Add a TODO comment where d_type is still noe defined.
This commit is contained in:
parent
b9f28e4a35
commit
2f51d93626
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169108
@ -197,6 +197,7 @@ gfs_readdir_emit_int(gfs_readdir_state_t *st, uio_t *uiop, offset_t next,
|
||||
|
||||
st->grd_dirent->d_reclen = (ushort_t)reclen;
|
||||
st->grd_dirent->d_namlen = namlen;
|
||||
/* TODO: d_type */
|
||||
|
||||
if (uiomove((caddr_t)st->grd_dirent, reclen, UIO_READ, uiop))
|
||||
return (EFAULT);
|
||||
@ -231,6 +232,7 @@ gfs_readdir_emit(gfs_readdir_state_t *st, uio_t *uiop, offset_t voff,
|
||||
|
||||
st->grd_dirent->d_ino = ino;
|
||||
(void) strncpy(st->grd_dirent->d_name, name, st->grd_namlen);
|
||||
/* TODO: d_type */
|
||||
|
||||
/*
|
||||
* Inter-entry offsets are invalid, so we assume a record size of
|
||||
|
@ -1818,12 +1818,15 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int *eofp, int *ncookies, u_lon
|
||||
if (offset == 0) {
|
||||
(void) strcpy(zap.za_name, ".");
|
||||
objnum = zp->z_id;
|
||||
type = DT_DIR;
|
||||
} else if (offset == 1) {
|
||||
(void) strcpy(zap.za_name, "..");
|
||||
objnum = zp->z_phys->zp_parent;
|
||||
type = DT_DIR;
|
||||
} else if (offset == 2 && zfs_show_ctldir(zp)) {
|
||||
(void) strcpy(zap.za_name, ZFS_CTLDIR_NAME);
|
||||
objnum = ZFSCTL_INO_ROOT;
|
||||
type = DT_DIR;
|
||||
} else {
|
||||
/*
|
||||
* Grab next entry.
|
||||
|
@ -197,6 +197,7 @@ gfs_readdir_emit_int(gfs_readdir_state_t *st, uio_t *uiop, offset_t next,
|
||||
|
||||
st->grd_dirent->d_reclen = (ushort_t)reclen;
|
||||
st->grd_dirent->d_namlen = namlen;
|
||||
/* TODO: d_type */
|
||||
|
||||
if (uiomove((caddr_t)st->grd_dirent, reclen, UIO_READ, uiop))
|
||||
return (EFAULT);
|
||||
@ -231,6 +232,7 @@ gfs_readdir_emit(gfs_readdir_state_t *st, uio_t *uiop, offset_t voff,
|
||||
|
||||
st->grd_dirent->d_ino = ino;
|
||||
(void) strncpy(st->grd_dirent->d_name, name, st->grd_namlen);
|
||||
/* TODO: d_type */
|
||||
|
||||
/*
|
||||
* Inter-entry offsets are invalid, so we assume a record size of
|
||||
|
@ -1818,12 +1818,15 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int *eofp, int *ncookies, u_lon
|
||||
if (offset == 0) {
|
||||
(void) strcpy(zap.za_name, ".");
|
||||
objnum = zp->z_id;
|
||||
type = DT_DIR;
|
||||
} else if (offset == 1) {
|
||||
(void) strcpy(zap.za_name, "..");
|
||||
objnum = zp->z_phys->zp_parent;
|
||||
type = DT_DIR;
|
||||
} else if (offset == 2 && zfs_show_ctldir(zp)) {
|
||||
(void) strcpy(zap.za_name, ZFS_CTLDIR_NAME);
|
||||
objnum = ZFSCTL_INO_ROOT;
|
||||
type = DT_DIR;
|
||||
} else {
|
||||
/*
|
||||
* Grab next entry.
|
||||
|
Loading…
Reference in New Issue
Block a user