Hi.
Some time ago I found:
/*
* MacOS X will fill in the 4-bit object type here.
*/
value = ZFS_DIRENT_MAKE(0, zp->z_id);
and:
objnum = ZFS_DIRENT_OBJ(zap.za_first_integer);
/*
* MacOS X can extract the object type here such as:
* uint8_t type = ZFS_DIRENT_TYPE(zap.za_first_integer);
*/
so I started to use it. The thing is that it broke some functionality.
For example 'zpool status -v' doesn't show file names anymore.
I tracked it down to the zap_value_search() function and changing:
if (za->za_first_integer == value) {
into:
if (ZFS_DIRENT_OBJ(za->za_first_integer) == value) {
seems to fix it. Is this change ok or did I missue 'type' part of
za_first_integer field?
What I did was bascially:
/*
* MacOS X will fill in the 4-bit object type here.
*/
value = ZFS_DIRENT_MAKE(IFTODT(zp->z_phys->zp_mode), zp->z_id);
and:
objnum = ZFS_DIRENT_OBJ(zap.za_first_integer);
/*
* MacOS X can extract the object type here such as:
* uint8_t type = ZFS_DIRENT_TYPE(zap.za_first_integer);
*/
type = ZFS_DIRENT_TYPE(zap.za_first_integer);
Should I clear 'type' somewhere maybe or is my change to
zap_value_search() correct? If the latter, can someone verify other uses
of za_first_integer?
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL:
<http://mail.opensolaris.org/pipermail/zfs-code/attachments/20070422/0f1ccb9e/attachment.bin>