diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4fs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index 06536baf625..80b3b90907d 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -40,6 +40,7 @@ #include <linux/stat.h> #include <linux/time.h> #include <asm/byteorder.h> +#include <div64.h> #include "ext4_common.h" int ext4fs_symlinknest; @@ -1051,8 +1052,8 @@ int ext4fs_write(const char *fname, unsigned char *buffer, } /* calucalate how many blocks required */ bytes_reqd_for_file = sizebytes; - blks_reqd_for_file = bytes_reqd_for_file / fs->blksz; - if (bytes_reqd_for_file % fs->blksz != 0) { + blks_reqd_for_file = lldiv(bytes_reqd_for_file, fs->blksz); + if (do_div(bytes_reqd_for_file, fs->blksz) != 0) { blks_reqd_for_file++; debug("total bytes for a file %u\n", blks_reqd_for_file); } |