freebsd-dev/module
Andreas Dilger baab063016 zpl: Fix "df -i" to have better free inodes value
Due to the confusion in Linux statfs between f_frsize and f_bsize
the blocks counts were changed to be in units of z_max_blksize
instead of SPA_MINBLOCKSIZE as it is on other platforms.

However, the free files calculation in zfs_statvfs() is limited by
the free blocks count, since each dnode consumes one block/sector.
This provided a reasonable estimate of free inodes, but on Linux
this meant that the free inodes count was underestimated by a large
amount, since 256 512-byte dnodes can fit into a 128kB block, and
more if the max blocksize is increased to 1MB or larger.

Also, the use of SPA_MINBLOCKSIZE is semantically incorrect since
DNODE_SIZE may change to a value other than SPA_MINBLOCKSIZE and
may even change per dataset, and devices with large sectors setting
ashift will also use a larger blocksize.

Correct the f_ffree calculation to use (availbytes >> DNODE_SHIFT)
to more accurately compute the maximum number of dnodes that can
be created.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #413
Closes #400
2011-09-28 11:27:10 -07:00
..
avl Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
nvpair Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
unicode Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zcommon Illumos #278: get rid zfs of python and pyzfs dependencies 2011-08-01 12:09:36 -07:00
zfs zpl: Fix "df -i" to have better free inodes value 2011-09-28 11:27:10 -07:00
zpios Linux 2.6.36 compat, use fops->unlocked_ioctl() 2010-11-10 17:01:08 -08:00
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.in Fix 'make install' overly broad 'rm' 2011-07-20 09:38:51 -07:00