summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/jffs2_1pass.c4
-rw-r--r--fs/yaffs2/yaffs_uboot_glue.c3
-rw-r--r--fs/yaffs2/yaffsfs.c5
3 files changed, 8 insertions, 4 deletions
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index c856983..3fb5db3 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -114,6 +114,7 @@
#include <common.h>
#include <config.h>
#include <malloc.h>
+#include <div64.h>
#include <linux/stat.h>
#include <linux/time.h>
#include <watchdog.h>
@@ -1438,7 +1439,7 @@ jffs2_1pass_build_lists(struct part_info * part)
{
struct b_lists *pL;
struct jffs2_unknown_node *node;
- u32 nr_sectors = part->size/part->sector_size;
+ u32 nr_sectors;
u32 i;
u32 counter4 = 0;
u32 counterF = 0;
@@ -1447,6 +1448,7 @@ jffs2_1pass_build_lists(struct part_info * part)
u32 buf_size = DEFAULT_EMPTY_SCAN_SIZE;
char *buf;
+ nr_sectors = lldiv(part->size, part->sector_size);
/* turn off the lcd. Refreshing the lcd adds 50% overhead to the */
/* jffs2 list building enterprise nope. in newer versions the overhead is */
/* only about 5 %. not enough to inconvenience people for. */
diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c
index e113e40..50000a1 100644
--- a/fs/yaffs2/yaffs_uboot_glue.c
+++ b/fs/yaffs2/yaffs_uboot_glue.c
@@ -20,6 +20,7 @@
*/
#include <common.h>
+#include <div64.h>
#include <config.h>
#include "nand.h"
@@ -184,7 +185,7 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev,
}
if (end_block == 0)
- end_block = mtd->size / mtd->erasesize - 1;
+ end_block = lldiv(mtd->size, mtd->erasesize - 1);
if (end_block < start_block) {
printf("Bad start/end\n");
diff --git a/fs/yaffs2/yaffsfs.c b/fs/yaffs2/yaffsfs.c
index ac4a010..334598e 100644
--- a/fs/yaffs2/yaffsfs.c
+++ b/fs/yaffs2/yaffsfs.c
@@ -11,6 +11,7 @@
* published by the Free Software Foundation.
*/
+#include <div64.h>
#include "yaffsfs.h"
#include "yaffs_guts.h"
#include "yaffscfg.h"
@@ -1603,8 +1604,8 @@ static int yaffsfs_DoStat(struct yaffs_obj *obj, struct yaffs_stat *buf)
buf->st_rdev = obj->yst_rdev;
buf->st_size = yaffs_get_obj_length(obj);
buf->st_blksize = obj->my_dev->data_bytes_per_chunk;
- buf->st_blocks = (buf->st_size + buf->st_blksize - 1) /
- buf->st_blksize;
+ buf->st_blocks = lldiv(buf->st_size + buf->st_blksize - 1,
+ buf->st_blksize);
#if CONFIG_YAFFS_WINCE
buf->yst_wince_atime[0] = obj->win_atime[0];
buf->yst_wince_atime[1] = obj->win_atime[1];