32 to 64 bits fsblkcnt_t and fsfilcnt_t.

Change-Id: I432229143c85cd178262b802a76ac606801ac59a
This commit is contained in:
Lionel Sambuc 2013-04-18 14:42:15 +02:00
parent 58f5d8dd5e
commit 65333e5108
9 changed files with 16 additions and 16 deletions

View file

@ -171,7 +171,8 @@ struct mtab *searchtab(char *name)
int df(const struct mtab *mt) int df(const struct mtab *mt)
{ {
long totblocks, busyblocks, totinodes, busyinodes; fsblkcnt_t totblocks, busyblocks;
fsfilcnt_t totinodes, busyinodes;
struct statvfs sv; struct statvfs sv;
int n; int n;

View file

@ -31,8 +31,6 @@ struct buf {
int fs_lookup_credentials(vfs_ucred_t *credentials, 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); 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_markdirty(struct buf *bp);
void lmfs_markclean(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); void lmfs_blockschange(dev_t dev, int delta);
/* calls that libminixfs does into fs */ /* 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); int fs_sync(void);
/* get_block arguments */ /* get_block arguments */

View file

@ -47,13 +47,14 @@ static int quiet = 0;
void void
lmfs_setquiet(int q) { quiet = q; } 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) int blocksize, dev_t majordev)
{ {
struct vm_stats_info vsi; struct vm_stats_info vsi;
int bufs; int bufs;
u32_t kbytes_used_fs, kbytes_total_fs, kbcache, kb_fsmax; 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; bused = btotal-bfree;
@ -805,7 +806,7 @@ static void cache_resize(unsigned int blocksize, unsigned int bufs)
static void cache_heuristic_check(int major) static void cache_heuristic_check(int major)
{ {
int bufs, d; int bufs, d;
u32_t btotal, bfree, bused; u64_t btotal, bfree, bused;
fs_blockstats(&btotal, &bfree, &bused); fs_blockstats(&btotal, &bfree, &bused);

View file

@ -132,7 +132,7 @@ int fs_statvfs()
/*===========================================================================* /*===========================================================================*
* blockstats * * 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); struct super_block *sp = get_super(fs_dev);

View file

@ -142,7 +142,7 @@ int fs_statvfs()
/*===========================================================================* /*===========================================================================*
* blockstats * * 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; *used = *blocks = v_pri.volume_space_size_l;
*free = 0; *free = 0;

View file

@ -116,13 +116,13 @@ int fs_statvfs()
struct statvfs st; struct statvfs st;
struct super_block *sp; struct super_block *sp;
int r, scale; int r, scale;
u32_t used; uint64_t used;
sp = get_super(fs_dev); sp = get_super(fs_dev);
scale = sp->s_log_zone_size; 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_bavail = st.f_bfree;
st.f_bsize = sp->s_block_size << scale; st.f_bsize = sp->s_block_size << scale;

View file

@ -92,7 +92,7 @@ int map; /* IMAP (inode map) or ZMAP (zone map) */
/*===========================================================================* /*===========================================================================*
* blockstats * * 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; struct super_block *sp;

View file

@ -42,10 +42,10 @@ typedef __uint32_t __mode_t; /* file permissions */
typedef __int64_t __off_t; /* file offset */ typedef __int64_t __off_t; /* file offset */
typedef __int32_t __pid_t; /* process id */ typedef __int32_t __pid_t; /* process id */
typedef __uint8_t __sa_family_t; /* socket address family */ 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 __uid_t; /* user id */
typedef __uint32_t __fsblkcnt_t; /* fs block count (statvfs) */ typedef __uint64_t __fsblkcnt_t; /* fs block count (statvfs) */
typedef __uint32_t __fsfilcnt_t; /* fs file count */ typedef __uint64_t __fsfilcnt_t; /* fs file count */
struct __tag_wctrans_t; struct __tag_wctrans_t;
typedef struct __tag_wctrans_t *__wctrans_t; typedef struct __tag_wctrans_t *__wctrans_t;

View file

@ -95,7 +95,7 @@ fs_sync(void)
} }
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; *total = *free = *used = 0;
} }