From: Lionel Sambuc Date: Thu, 18 Apr 2013 12:42:15 +0000 (+0200) Subject: 32 to 64 bits fsblkcnt_t and fsfilcnt_t. X-Git-Tag: v3.3.0~633 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/static/host.html?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F925%2F2;p=minix.git 32 to 64 bits fsblkcnt_t and fsfilcnt_t. Change-Id: I432229143c85cd178262b802a76ac606801ac59a --- diff --git a/commands/df/df.c b/commands/df/df.c index be07620b8..f01377216 100644 --- a/commands/df/df.c +++ b/commands/df/df.c @@ -171,7 +171,8 @@ struct mtab *searchtab(char *name) int df(const struct mtab *mt) { - long totblocks, busyblocks, totinodes, busyinodes; + fsblkcnt_t totblocks, busyblocks; + fsfilcnt_t totinodes, busyinodes; struct statvfs sv; int n; diff --git a/include/minix/libminixfs.h b/include/minix/libminixfs.h index cece2c2f3..6ad6299d9 100644 --- a/include/minix/libminixfs.h +++ b/include/minix/libminixfs.h @@ -31,8 +31,6 @@ struct buf { int fs_lookup_credentials(vfs_ucred_t *credentials, uid_t *caller_uid, gid_t *caller_gid, cp_grant_id_t grant2, size_t cred_size); -u32_t fs_bufs_heuristic(int minbufs, u32_t btotal, u32_t bfree, - int blocksize, dev_t majordev); void lmfs_markdirty(struct buf *bp); void lmfs_markclean(struct buf *bp); @@ -60,7 +58,7 @@ void lmfs_cache_reevaluate(dev_t dev); void lmfs_blockschange(dev_t dev, int delta); /* calls that libminixfs does into fs */ -void fs_blockstats(u32_t *blocks, u32_t *free, u32_t *used); +void fs_blockstats(u64_t *blocks, u64_t *free, u64_t *used); int fs_sync(void); /* get_block arguments */ diff --git a/lib/libminixfs/cache.c b/lib/libminixfs/cache.c index 50ec33837..0f2f78ed6 100644 --- a/lib/libminixfs/cache.c +++ b/lib/libminixfs/cache.c @@ -47,13 +47,14 @@ static int quiet = 0; void lmfs_setquiet(int q) { quiet = q; } -u32_t fs_bufs_heuristic(int minbufs, u32_t btotal, u32_t bfree, +static u32_t fs_bufs_heuristic(int minbufs, u32_t btotal, u64_t bfree, int blocksize, dev_t majordev) { struct vm_stats_info vsi; int bufs; u32_t kbytes_used_fs, kbytes_total_fs, kbcache, kb_fsmax; - u32_t kbytes_remain_mem, bused; + u32_t kbytes_remain_mem; + u64_t bused; bused = btotal-bfree; @@ -805,7 +806,7 @@ static void cache_resize(unsigned int blocksize, unsigned int bufs) static void cache_heuristic_check(int major) { int bufs, d; - u32_t btotal, bfree, bused; + u64_t btotal, bfree, bused; fs_blockstats(&btotal, &bfree, &bused); diff --git a/servers/ext2/stadir.c b/servers/ext2/stadir.c index a19f8a04a..f9bff7d90 100644 --- a/servers/ext2/stadir.c +++ b/servers/ext2/stadir.c @@ -132,7 +132,7 @@ int fs_statvfs() /*===========================================================================* * blockstats * *===========================================================================*/ -void fs_blockstats(u32_t *blocks, u32_t *free, u32_t *used) +void fs_blockstats(u64_t *blocks, u64_t *free, u64_t *used) { struct super_block *sp = get_super(fs_dev); diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index 9e41e3659..bde482f8b 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -142,7 +142,7 @@ int fs_statvfs() /*===========================================================================* * blockstats * *===========================================================================*/ -void fs_blockstats(u32_t *blocks, u32_t *free, u32_t *used) +void fs_blockstats(u64_t *blocks, u64_t *free, u64_t *used) { *used = *blocks = v_pri.volume_space_size_l; *free = 0; diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index e721a73ae..9678bf60a 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -116,13 +116,13 @@ int fs_statvfs() struct statvfs st; struct super_block *sp; int r, scale; - u32_t used; + uint64_t used; sp = get_super(fs_dev); scale = sp->s_log_zone_size; - fs_blockstats((u32_t *) &st.f_blocks, (u32_t *) &st.f_bfree, &used); + fs_blockstats(&st.f_blocks, &st.f_bfree, &used); st.f_bavail = st.f_bfree; st.f_bsize = sp->s_block_size << scale; diff --git a/servers/mfs/stats.c b/servers/mfs/stats.c index 871576359..7cf9fb83f 100644 --- a/servers/mfs/stats.c +++ b/servers/mfs/stats.c @@ -92,7 +92,7 @@ int map; /* IMAP (inode map) or ZMAP (zone map) */ /*===========================================================================* * blockstats * *===========================================================================*/ -void fs_blockstats(u32_t *blocks, u32_t *free, u32_t *used) +void fs_blockstats(u64_t *blocks, u64_t *free, u64_t *used) { struct super_block *sp; diff --git a/sys/sys/ansi.h b/sys/sys/ansi.h index ae26ef404..d480cfb60 100644 --- a/sys/sys/ansi.h +++ b/sys/sys/ansi.h @@ -42,10 +42,10 @@ typedef __uint32_t __mode_t; /* file permissions */ typedef __int64_t __off_t; /* file offset */ typedef __int32_t __pid_t; /* process id */ typedef __uint8_t __sa_family_t; /* socket address family */ -typedef __uint32_t __socklen_t; /* socket-related datum length */ +typedef unsigned int __socklen_t; /* socket-related datum length */ typedef __uint32_t __uid_t; /* user id */ -typedef __uint32_t __fsblkcnt_t; /* fs block count (statvfs) */ -typedef __uint32_t __fsfilcnt_t; /* fs file count */ +typedef __uint64_t __fsblkcnt_t; /* fs block count (statvfs) */ +typedef __uint64_t __fsfilcnt_t; /* fs file count */ struct __tag_wctrans_t; typedef struct __tag_wctrans_t *__wctrans_t; diff --git a/test/test72.c b/test/test72.c index c87037332..9c6ff3f90 100644 --- a/test/test72.c +++ b/test/test72.c @@ -95,7 +95,7 @@ fs_sync(void) } void -fs_blockstats(u32_t *total, u32_t *free, u32_t *used) +fs_blockstats(u64_t *total, u64_t *free, u64_t *used) { *total = *free = *used = 0; }