[...] > There is a way to do this kind of object to name > mapping, though there's no documented public > interface for it. See zfs_obj_to_path() function and > ZFS_IOC_OBJ_TO_PATH ioctl. > > I think it should also be possible to extend it to > handle multiple names (in case of multiple hardlinks) > in some way, as id of parent directory is recorded at > the time of link creation in zone attributes
To add a bit: these sorts of things are _not_ required by any existing standard, and may be limited to use by root (since they bypass directory permissions). So they're typically private, undocumented, and subject to change without notice. Some other examples: UFS _FIOIO ioctl: obtain a read-only file descriptor given an existing file descriptor on the file system (to make the ioctl on) and the inode number and generation number (keeps inode numbers from being reused too quickly, mostly to make NFS happy I think) in an argument to the ioctl. Mac OS X /.vol directory: allows pre-OS X style access by volume-ID/folder-ID/name triplet Those are all hidden behind a particular library or application that is the only supported way of using them. It is perhaps unfortunate that there is no generic root-only way to look up fsid/inode (problematic though due to hard links) or fsid/dir_inode/name (could fail if name has been moved to another directory on the same filesystem) but implementing a generic solution would likely be a lot of work (requiring support from every filesystem, most of which were _not_ designed to do a reverse lookup, i.e. from inode back to name), and the use cases seem to be very few indeed. (As an example of that, /.vol on a Mac is said to only work for HFS or HFS+ volumes, not old UFS volumes (Macs used to support their own flavor of UFS, apparently; no doubt one considerably different from on Solaris, so don't go there) In fact, I'm not sure that /.vol works at all on the latest Mac OS X.) -- This message posted from opensolaris.org _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss