Thank you! Here is my understanding, leave it here as reference for others. If it's not correct, please point it out.
ZFS estimates the size of block only when the file only has single block and it is extended. This is because dmu_object_set_blocksize() only set the block size when the object contains a single block. Once the file is beyond single block, the block size is fixed and never be shrinked. ZFS always sets the block size as the power 2 ceil of file size. The largest block size is specified by the file system property. One special case is if the current file block size is not power 2, it's new block size can be greater than the file system recordsize property. Does anybody know why there is such a short circuit? best regards, hanzhu On Thu, Sep 2, 2010 at 6:30 PM, Darren J Moffat <darr...@opensolaris.org>wrote: > On 02/09/2010 11:18, Zhu Han wrote: > >> Can anybody help me give the link on the code snippet of block size >> estimation? >> > > See the zfs_write() function. > > -- > Darren J Moffat >
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss