summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-04-29 23:28:07 +0000
committerpjd <pjd@FreeBSD.org>2007-04-29 23:28:07 +0000
commit142746f314eb83d957199603e2b6b281b0985625 (patch)
treec923bdef91cdbc1203ba6aef04b6665624c02764 /sys
parent066350de07e059423a802b4b95de681f9954297f (diff)
downloadFreeBSD-src-142746f314eb83d957199603e2b6b281b0985625.zip
FreeBSD-src-142746f314eb83d957199603e2b6b281b0985625.tar.gz
- Define d_type for ".", ".." and ".zfs" directories.
- Add a TODO comment where d_type is still noe defined.
Diffstat (limited to 'sys')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c3
-rw-r--r--sys/contrib/opensolaris/uts/common/fs/gfs.c2
-rw-r--r--sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c3
4 files changed, 10 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c b/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
index 7e6d689..51158c6 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
@@ -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
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index e8e43c4..5888e06 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -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.
diff --git a/sys/contrib/opensolaris/uts/common/fs/gfs.c b/sys/contrib/opensolaris/uts/common/fs/gfs.c
index 7e6d689..51158c6 100644
--- a/sys/contrib/opensolaris/uts/common/fs/gfs.c
+++ b/sys/contrib/opensolaris/uts/common/fs/gfs.c
@@ -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
diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index e8e43c4..5888e06 100644
--- a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -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.
OpenPOWER on IntegriCloud