diff options
author | Brian Behlendorf <[email protected]> | 2011-03-07 16:06:22 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-03-07 16:06:22 -0800 |
commit | 53cf50e0816a89749b3ea4d51d5d9c9605bcc3e8 (patch) | |
tree | 279c7840c095f1bbfdb92609882187ff86510459 /module/zfs/zpl_inode.c | |
parent | a60b1c0a8e7e760088c51717614205bd5e43f560 (diff) |
Set stat->st_dev and statfs->f_fsid
Filesystems like ZFS must use what the kernel calls an anonymous super
block. Basically, this is just a filesystem which is not backed by a
single block device. Normally this block device's dev_t is stored in
the super block. For anonymous super blocks a unique reserved dev_t
is assigned as part of get_sb().
This sb->s_dev must then be set in the returned stat structures as
stat->st_dev. This allows userspace utilities to easily detect the
boundries of a specific filesystem. Tools such as 'du' depend on this
for proper accounting.
Additionally, under OpenSolaris the statfs->f_fsid is set to the device
id. To preserve consistency with OpenSolaris we also set the fsid to
the device id. Other Linux filesystem (ext) set the fsid to a unique
value determined by the filesystems uuid. This value is unique but
maintains no relationship to the device id. This may be desirable
when exporting NFS filesystem because it minimizes to chance of a
client observing the same fsid from two different servers.
Closes #140
Diffstat (limited to 'module/zfs/zpl_inode.c')
-rw-r--r-- | module/zfs/zpl_inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c index b7227675b..c4ff14fbb 100644 --- a/module/zfs/zpl_inode.c +++ b/module/zfs/zpl_inode.c @@ -184,7 +184,7 @@ zpl_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) goto out; stat->ino = ip->i_ino; - stat->dev = 0; + stat->dev = ip->i_sb->s_dev; stat->mode = vap->va_mode; stat->nlink = vap->va_nlink; stat->uid = vap->va_uid; |