]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/zfs_vnops.c
Restructure zfs_readdir() to fix regressions
authorRichard Yao <ryao@gentoo.org>
Wed, 2 Oct 2013 15:22:53 +0000 (11:22 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 29 Oct 2013 16:51:59 +0000 (09:51 -0700)
commitc12e3a594a49ed10b7870d950c1f336f78f136cb
treef44342977c62b07bffa357b53a2afb804fd91ffc
parentd65e73810938e5619b72591d3438063b00949e77
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.

2. 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.

3. 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
module/zfs/zfs_vnops.c