Shriram Agarwal
2008-Jun-18 04:04 UTC
[zfs-discuss] getting inodeno for zfs from vnode in vfs kernel layer
i need to get inodeno on ZFS and i am not able to find how to find it in kernel at vfs layer. i have vnode pointer and i am doing VTOZ to get znode but printing z_id from znode pointer gives me deadbeef(unitialized) , can somebody point me how to get that? i looked at zfs_getattr code and it does similar thing which i am doing but its able to get me inode no in getattribute structure(node id), that makes me thinking there is something more happening when i call vop_getattr on zfs rather than just calling zfs_getattr. ******************Legal Disclaimer*************************** "This communication may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you." **************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20080618/08347fb1/attachment.html>
Mark Shellenbaum
2008-Jun-18 14:16 UTC
[zfs-discuss] getting inodeno for zfs from vnode in vfs kernel layer
Shriram Agarwal wrote:> i need to get inodeno on ZFS and i am not able to find how to find it in > kernel at vfs layer. > > i have vnode pointer and i am doing VTOZ to get znode but printing z_id > from znode pointer > > gives me deadbeef(unitialized) , can somebody point me how to get that? > > i looked at zfs_getattr code and it does similar thing which i am doing > but its able to get me > > inode no in getattribute structure(node id), that makes me thinking > there is something more happening when i > > call vop_getattr on zfs rather than just calling zfs_getattr. >Are you sure you have a valid vnode? How did you find the vnode? What do you need the inode number for? -Mark
shri
2008-Jun-19 16:44 UTC
[zfs-discuss] getting inodeno for zfs from vnode in vfs kernel layer
i have valid vnode , got after create and it has valid fields such as type,zfsvfsp etc. and i do get znode pointer by doing VTOZ. i need inode for my application . This message posted from opensolaris.org
Darren J Moffat
2008-Jun-20 09:39 UTC
[zfs-discuss] getting inodeno for zfs from vnode in vfs kernel layer
shri wrote:> i have valid vnode , got after create and it has valid fields such as type,zfsvfsp etc. and i do get znode pointer by doing VTOZ. > i need inode for my application .Why does your application need an inode ? What it it doing with it ? What are you trying to do in your application ? I''m usually very suspicious of things other than the filesystem itself believing it needs the filesystems inode. The reason I have this suspicion is because of my familiarity with the cachefs code which does this and as a result is very broken. -- Darren J Moffat
Anton B. Rang
2008-Jun-22 17:53 UTC
[zfs-discuss] getting inodeno for zfs from vnode in vfs kernel
If you really need the inode number, you should use the semi-public interface to retrieve it and call VOP_GETATTR. This is what the rest of the kernel does when it needs attributes of a vnode. See for example http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/syscall/stat.c This message posted from opensolaris.org