Displaying 2 results from an estimated 2 matches for "rescale_frsize".
2007 Aug 30
0
[ufs-discuss] statvfs change
...above
>UFS bugfixes have been about.
>
>I agree with Don that we can''t lie about having free space if we don''t.
>I also agree that statvfs() and statvfs64() shouldn''t return different
>values.
I''m not sure I even require this much. As long as rescale_frsize()
doesn''t drop non-zero bits in the values it shifts to the right, I
think I''m OK with statvfs() and statvfs64() returning different values
for f_frsize, f_blocks, f_bfree, and f_bavail as long as the values
f_frsize*f_blocks, f_frsize*f_bfree, and f_frsize*f_bavail are the same
(...
2007 Aug 27
17
statvfs change
...rlying VFS_STATVFS routines can''t tell if they are going to cause
+ * EOVERFLOW with f_frsize, because all they see is a struct statvfs64.
+ * If EOVERFLOW was about to occur, try to adjust f_frsize upward so that
+ * we return valid (but less precise) block information.
+ */
+static void
+rescale_frsize(struct statvfs64 *sbp)
+{
+ /*
+ * We''re limited to 32 bits for the number of frsize blocks.
+ * Find the smallest power of 2 that won''t cause EOVERFLOW.
+ */
+ while (sbp->f_blocks > UINT32_MAX && sbp->f_frsize < (1U << 31)) {
+ sbp->f_frsize <...