add prototypes for static functions. make ffs_oldfscompat static.
fix some arguments and structure members, in recognition of the fact that (u_int == u_long == size_t) is not true on all systems.
This commit is contained in:
parent
d71e8d0d69
commit
e7290be2cd
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ufs.c,v 1.12 1995/09/17 00:49:48 pk Exp $ */
|
||||
/* $NetBSD: ufs.c,v 1.13 1995/10/20 00:42:21 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@ -88,16 +88,20 @@ struct file {
|
||||
indirect block at level i */
|
||||
char *f_blk[NIADDR]; /* buffer for indirect block at
|
||||
level i */
|
||||
u_long f_blksize[NIADDR];
|
||||
size_t f_blksize[NIADDR];
|
||||
/* size of buffer */
|
||||
daddr_t f_blkno[NIADDR];/* disk address of block in buffer */
|
||||
char *f_buf; /* buffer for data block */
|
||||
u_int f_buf_size; /* size of data block */
|
||||
size_t f_buf_size; /* size of data block */
|
||||
daddr_t f_buf_blkno; /* block number of data block */
|
||||
};
|
||||
|
||||
static int read_inode __P((ino_t, struct open_file *));
|
||||
static int block_map __P((struct open_file *, daddr_t, daddr_t *));
|
||||
static int buf_read_file __P((struct open_file *, char **, size_t *));
|
||||
static int search_directory __P((char *, struct open_file *, ino_t *));
|
||||
#ifdef COMPAT_UFS
|
||||
void ffs_oldfscompat __P((struct fs *));
|
||||
static void ffs_oldfscompat __P((struct fs *));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -111,7 +115,7 @@ read_inode(inumber, f)
|
||||
register struct file *fp = (struct file *)f->f_fsdata;
|
||||
register struct fs *fs = fp->f_fs;
|
||||
char *buf;
|
||||
u_int rsize;
|
||||
size_t rsize;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
@ -120,7 +124,8 @@ read_inode(inumber, f)
|
||||
buf = alloc(fs->fs_bsize);
|
||||
twiddle();
|
||||
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
|
||||
fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, buf, &rsize);
|
||||
fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize,
|
||||
buf, &rsize);
|
||||
if (rc)
|
||||
goto out;
|
||||
if (rsize != fs->fs_bsize) {
|
||||
@ -232,7 +237,7 @@ block_map(f, file_block, disk_block_p)
|
||||
fsbtodb(fp->f_fs, ind_block_num),
|
||||
fs->fs_bsize,
|
||||
fp->f_blk[level],
|
||||
(u_int *)&fp->f_blksize[level]);
|
||||
&fp->f_blksize[level]);
|
||||
if (rc)
|
||||
return (rc);
|
||||
if (fp->f_blksize[level] != fs->fs_bsize)
|
||||
@ -264,14 +269,14 @@ static int
|
||||
buf_read_file(f, buf_p, size_p)
|
||||
struct open_file *f;
|
||||
char **buf_p; /* out */
|
||||
u_int *size_p; /* out */
|
||||
size_t *size_p; /* out */
|
||||
{
|
||||
register struct file *fp = (struct file *)f->f_fsdata;
|
||||
register struct fs *fs = fp->f_fs;
|
||||
long off;
|
||||
register daddr_t file_block;
|
||||
daddr_t disk_block;
|
||||
long block_size;
|
||||
size_t block_size;
|
||||
int rc;
|
||||
|
||||
off = blkoff(fs, fp->f_seekp);
|
||||
@ -332,7 +337,7 @@ search_directory(name, f, inumber_p)
|
||||
register struct direct *dp;
|
||||
struct direct *edp;
|
||||
char *buf;
|
||||
u_int buf_size;
|
||||
size_t buf_size;
|
||||
int namlen, length;
|
||||
int rc;
|
||||
|
||||
@ -383,7 +388,7 @@ ufs_open(path, f)
|
||||
struct file *fp;
|
||||
struct fs *fs;
|
||||
int rc;
|
||||
u_int buf_size;
|
||||
size_t buf_size;
|
||||
int nlinks = 0;
|
||||
char namebuf[MAXPATHLEN+1];
|
||||
char *buf = NULL;
|
||||
@ -506,7 +511,7 @@ ufs_open(path, f)
|
||||
/*
|
||||
* Read file for symbolic link
|
||||
*/
|
||||
u_int buf_size;
|
||||
size_t buf_size;
|
||||
daddr_t disk_block;
|
||||
register struct fs *fs = fp->f_fs;
|
||||
|
||||
@ -589,7 +594,7 @@ ufs_read(f, start, size, resid)
|
||||
register struct file *fp = (struct file *)f->f_fsdata;
|
||||
register size_t csize;
|
||||
char *buf;
|
||||
u_int buf_size;
|
||||
size_t buf_size;
|
||||
int rc = 0;
|
||||
register char *addr = start;
|
||||
|
||||
@ -675,7 +680,7 @@ ufs_stat(f, sb)
|
||||
*
|
||||
* XXX - goes away some day.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ffs_oldfscompat(fs)
|
||||
struct fs *fs;
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user