|
@@ -325,7 +325,7 @@ xfs_iomap_eof_want_preallocate(
|
|
|
* rather than falling short due to things like stripe unit/width alignment of
|
|
|
* real extents.
|
|
|
*/
|
|
|
-STATIC int
|
|
|
+STATIC xfs_fsblock_t
|
|
|
xfs_iomap_eof_prealloc_initial_size(
|
|
|
struct xfs_mount *mp,
|
|
|
struct xfs_inode *ip,
|
|
@@ -413,7 +413,7 @@ xfs_iomap_prealloc_size(
|
|
|
* have a large file on a small filesystem and the above
|
|
|
* lowspace thresholds are smaller than MAXEXTLEN.
|
|
|
*/
|
|
|
- while (alloc_blocks >= freesp)
|
|
|
+ while (alloc_blocks && alloc_blocks >= freesp)
|
|
|
alloc_blocks >>= 4;
|
|
|
}
|
|
|
|