On Thu, Feb 22, 2007 at 08:42:35PM +0100, Pawel Jakub Dawidek
wrote:> Hi.
>
> The zfs_path_to_zhandle() function was recently added to libzfs and
I''m
> trying to figure out how it works by reading the code.
>
> /*
> * Given a name, determine whether or not it''s a valid path
> * (starts with ''/'' or "./"). If so, walk the
mnttab trying
> * to match the device number. If not, treat the path as an
> * fs/vol/snap name.
> */
> [...]
> while ((ret = getextmntent(hdl->libzfs_mnttab, &entry, 0)) == 0) {
> if (makedevice(entry.mnt_major, entry.mnt_minor) =>
statbuf.st_dev) {
>
> What device are we looking here for? ZFS file systems are not based on
> raw device, right? What does mnt_major and mnt_minor here mean exactly?
> I thought that those are numbers of device from which file system is
> mounted.
>
> Can someone give me an example of how this code path is used?
>
> zfs list /<what?>
Ok, its simply an object in a file system. What zfs_path_to_zhandle()
implements is bascially implemented in FreeBSD as statfs(2) syscall.
I''m sorry for the noice.
--
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/20070222/17400209/attachment.bin>