> From the man page for stat(), I would expect to get
> the same values from stat()calls for the st_dev and
> st_ino fields regardless of which host runs a program
> containing a stat() call provided, of course, that
> the path argument refers to the same physical file.
> For example, my home directory points to the same
> physical drive from several hosts. In this case, the
> path name to a given text file is the same
> everywhere. When I run the attached program on 3
> different hosts, I get the same st_ino values but 3
> different st_dev values. In one case, the file is ufs
> mounted since that host is actually connected to the
> hard drive. In the other two, the file is nfs
> mounted.
> 
> We are trying to catalog files of interest to a
> customer across a distributed Solaris system. We need
> to be able to uniquely identify a file regardless of
> its mount point. Is there a system call that can
> provide this information since stat() does not do
> what we want?

thats indeed odd and not supposed to happen, UFS assignes the inodes dev to the
vattr structure it returns back on VOP_GETATTR() requests in ufs_getattr():

 vap->va_fsid = ip->i_dev; 

the stat(2) systemcall just translates this to st_dev in cstat():

sb.st_dev = vattr.va_fsid; 

now our NFS server on request just issues a VOP_GETATTR() into the underlaying 
file system
(eg. UFS) and delivers back to the client what it got from there.

so all 3 of your calls are supposed to deliver the same st_ino & st_dev on UFS
unless I've been missing some subtle quirks in the NFS client side.

can you tell us more about the config, eg. solaris versions of all involved, 
nfs version
used, example output ?

thanks
frankB
--
This message posted from opensolaris.org

Reply via email to