HomeFreeBSD

Restructure zfs_readdir() to fix regressions

Description

Restructure zfs_readdir() to fix regressions

This does the following:

  1. It creates a uint8_t type value, which is initialized to DT_DIR on

dot directories and ZFS_DIRENT_TYPE(zap.za_first_integer) otherwise.
This resolves a regression where we return unintialized values as the
directory entry type on dot directories. This was accidentally
introduced by commit 8170d281263e52ff33d7fba93ab625196844df36.

  1. It restructures zfs_readdir() code to use uint64_t offset like

Illumos instead of loff_t *pos. This resolves a regression where
negative ZAP cursors were treated as if they were dot directories.

  1. It restructures the function to more closely match the structure of

zfs_readdir() on Illumos and removes the unused variable outcount, which
was only used on Illumos.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1750

Details

Provenance
Richard Yao <ryao@gentoo.org>Authored on Oct 2 2013, 3:22 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 29 2013, 4:51 PM
Parents
rGd65e73810938: Add -p switch to "zpool get"
Branches
Unknown
Tags
Unknown