mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Cleaned up some lint and some obvious prototyping errors.
This commit is contained in:
parent
30ffadf397
commit
f3c33c9336
@ -112,7 +112,6 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
|
||||
{
|
||||
register struct ext2_sb_info *fs;
|
||||
daddr_t bno;
|
||||
int cg, error;
|
||||
|
||||
*bnp = 0;
|
||||
fs = ip->i_e2fs;
|
||||
@ -391,7 +390,7 @@ ext2_valloc(ap)
|
||||
register struct ext2_sb_info *fs;
|
||||
register struct inode *ip;
|
||||
mode_t mode = ap->a_mode;
|
||||
ino_t ino, ipref;
|
||||
ino_t ino;
|
||||
int i, error;
|
||||
#if !defined(__FreeBSD__)
|
||||
struct timeval time;
|
||||
@ -469,7 +468,6 @@ ext2_blkpref(ip, lbn, indx, bap, blocknr)
|
||||
daddr_t *bap;
|
||||
daddr_t blocknr;
|
||||
{
|
||||
register struct ext2_sb_info *fs;
|
||||
int tmp;
|
||||
|
||||
/* if the next block is actually what we thought it is,
|
||||
|
@ -103,8 +103,6 @@ struct ext2_group_desc * get_group_desc __P((struct mount * ,
|
||||
void ext2_discard_prealloc __P((struct inode *));
|
||||
int ext2_inactive __P((struct vop_inactive_args *));
|
||||
int ll_w_block __P((struct buf *, int ));
|
||||
int ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei));
|
||||
int ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di));
|
||||
int ext2_new_block __P ((struct mount * mp, unsigned long goal,
|
||||
long * prealloc_count,
|
||||
long * prealloc_block));
|
||||
@ -115,6 +113,9 @@ void ext2_free_inode (struct inode * inode);
|
||||
int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p));
|
||||
int ext2_reload __P((struct mount *mountp, struct ucred *cred,
|
||||
struct proc *p));
|
||||
void ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di));
|
||||
void ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei));
|
||||
void mark_buffer_dirty __P((struct buf *bh));
|
||||
|
||||
#if !defined(__FreeBSD__)
|
||||
int bwrite(); /* FFS needs a bwrite routine. XXX */
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/systm.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
@ -48,9 +49,11 @@
|
||||
#undef i_uid
|
||||
|
||||
#include <gnu/ext2fs/ext2_fs.h>
|
||||
#include <gnu/ext2fs/ext2_extern.h>
|
||||
#include <gnu/ext2fs/ext2_fs_i.h>
|
||||
|
||||
void ext2_print_dinode( di )
|
||||
void
|
||||
ext2_print_dinode( di )
|
||||
struct dinode *di;
|
||||
{
|
||||
int i;
|
||||
@ -79,7 +82,8 @@ void ext2_print_dinode( di )
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void ext2_print_inode( in )
|
||||
void
|
||||
ext2_print_inode( in )
|
||||
struct inode *in;
|
||||
{
|
||||
printf( "Inode: %5d", in->i_number);
|
||||
@ -89,7 +93,8 @@ void ext2_print_inode( in )
|
||||
/*
|
||||
* raw ext2 inode to dinode
|
||||
*/
|
||||
int ext2_ei2di(ei, di)
|
||||
void
|
||||
ext2_ei2di(ei, di)
|
||||
struct ext2_inode *ei;
|
||||
struct dinode *di;
|
||||
{
|
||||
@ -123,7 +128,8 @@ int ext2_ei2di(ei, di)
|
||||
/*
|
||||
* dinode to raw ext2 inode
|
||||
*/
|
||||
int ext2_di2ei(di, ei)
|
||||
void
|
||||
ext2_di2ei(di, ei)
|
||||
struct dinode *di;
|
||||
struct ext2_inode *ei;
|
||||
{
|
||||
|
@ -93,7 +93,6 @@ static int load__block_bitmap (struct mount * mp,
|
||||
struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs;
|
||||
unsigned long block_bitmap_number;
|
||||
struct buffer_head * block_bitmap;
|
||||
int error;
|
||||
|
||||
if (block_group >= sb->s_groups_count)
|
||||
panic ( "load_block_bitmap: "
|
||||
@ -227,7 +226,7 @@ void ext2_free_blocks (struct mount * mp, unsigned long block,
|
||||
}
|
||||
|
||||
mark_buffer_dirty(bh2);
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
/****
|
||||
if (sb->s_flags & MS_SYNCHRONOUS) {
|
||||
ll_rw_block (WRITE, 1, &bh);
|
||||
@ -444,7 +443,7 @@ got_block:
|
||||
"Goal hits %d of %d.\n", j, goal_hits, goal_attempts);
|
||||
|
||||
gdp->bg_free_blocks_count--;
|
||||
mark_buffer_dirty(bh2, 1);
|
||||
mark_buffer_dirty(bh2);
|
||||
es->s_free_blocks_count--;
|
||||
sb->s_dirt = 1;
|
||||
unlock_super (VFSTOUFS(mp)->um_devvp);
|
||||
|
@ -284,7 +284,7 @@ static void inc_inode_version (struct inode * inode,
|
||||
EXT2_INODES_PER_BLOCK(inode->i_sb));
|
||||
raw_inode->i_version++;
|
||||
inode->u.ext2_i.i_version = raw_inode->i_version;
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
brelse (bh);
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@ repeat:
|
||||
goto repeat;
|
||||
}
|
||||
/* Linux now does the following:
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
if (sb->s_flags & MS_SYNCHRONOUS) {
|
||||
ll_rw_block (WRITE, 1, &bh);
|
||||
wait_on_buffer (bh);
|
||||
|
@ -56,11 +56,13 @@
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
#include <ufs/ufs/dir.h>
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
#include <ufs/ufs/ufs_extern.h>
|
||||
|
||||
#include <gnu/ext2fs/ext2_extern.h>
|
||||
#include <gnu/ext2fs/ext2_fs.h>
|
||||
@ -73,17 +75,7 @@
|
||||
*/
|
||||
#undef DIRBLKSIZ
|
||||
|
||||
#if 1
|
||||
extern struct nchstats nchstats;
|
||||
static int dirchk = 1;
|
||||
#else
|
||||
struct nchstats nchstats;
|
||||
#if DIAGNOSTIC
|
||||
int dirchk = 1;
|
||||
#else
|
||||
int dirchk = 0;
|
||||
#endif
|
||||
#endif
|
||||
extern int dirchk;
|
||||
|
||||
/*
|
||||
* the problem that is tackled below is the fact that FFS
|
||||
@ -155,7 +147,7 @@ ext2_readdir(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
register struct uio *uio = ap->a_uio;
|
||||
int count, lost, error;
|
||||
int count, error;
|
||||
|
||||
struct ext2_dir_entry *edp, *dp;
|
||||
struct dirent dstdp;
|
||||
@ -164,8 +156,6 @@ ext2_readdir(ap)
|
||||
caddr_t dirbuf;
|
||||
int readcnt;
|
||||
u_quad_t startoffset = uio->uio_offset;
|
||||
u_char tmp;
|
||||
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->s_blocksize;
|
||||
|
||||
count = uio->uio_resid; /* legyenek boldogok akik akarnak ... */
|
||||
uio->uio_resid = count;
|
||||
@ -426,7 +416,7 @@ searchloop:
|
||||
ep = (struct ext2_dir_entry *)
|
||||
((char *)bp->b_data + entryoffsetinblock);
|
||||
if (ep->rec_len == 0 ||
|
||||
dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock)) {
|
||||
(dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock))) {
|
||||
int i;
|
||||
ufs_dirbad(dp, dp->i_offset, "mangled entry");
|
||||
i = DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1));
|
||||
@ -725,8 +715,6 @@ ext2_dirbadentry(dp, de, entryoffsetinblock)
|
||||
register struct ext2_dir_entry *de;
|
||||
int entryoffsetinblock;
|
||||
{
|
||||
register int i;
|
||||
int namlen;
|
||||
int DIRBLKSIZ = VTOI(dp)->i_e2fs->s_blocksize;
|
||||
|
||||
char * error_msg = NULL;
|
||||
@ -911,7 +899,6 @@ ext2_dirremove(dvp, cnp)
|
||||
struct ext2_dir_entry *ep;
|
||||
struct buf *bp;
|
||||
int error;
|
||||
int DIRBLKSIZ = VTOI(dvp)->i_e2fs->s_blocksize;
|
||||
|
||||
dp = VTOI(dvp);
|
||||
if (dp->i_count == 0) {
|
||||
|
@ -435,7 +435,7 @@ ext2_reload(mountp, cred, p)
|
||||
struct buf *bp;
|
||||
struct ext2_super_block * es;
|
||||
struct ext2_sb_info *fs;
|
||||
int i, size, error;
|
||||
int error;
|
||||
|
||||
if ((mountp->mnt_flag & MNT_RDONLY) == 0)
|
||||
return (EINVAL);
|
||||
@ -529,7 +529,6 @@ ext2_mountfs(devvp, mp, p)
|
||||
struct ext2_super_block * es;
|
||||
dev_t dev = devvp->v_rdev;
|
||||
struct partinfo dpart;
|
||||
caddr_t base;
|
||||
int havepart = 0;
|
||||
int error, i, size;
|
||||
int ronly;
|
||||
@ -706,7 +705,7 @@ ext2_flushfiles(mp, flags, p)
|
||||
extern int doforce;
|
||||
#endif
|
||||
register struct ufsmount *ump;
|
||||
int i, error;
|
||||
int error;
|
||||
|
||||
if (!doforce)
|
||||
flags &= ~FORCECLOSE;
|
||||
@ -1050,9 +1049,7 @@ ext2_sbupdate(mp, waitfor)
|
||||
register struct ext2_sb_info *fs = mp->um_e2fs;
|
||||
register struct ext2_super_block *es = fs->s_es;
|
||||
register struct buf *bp;
|
||||
int blks;
|
||||
caddr_t space;
|
||||
int i, size, error = 0;
|
||||
int i, error = 0;
|
||||
/*
|
||||
printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
|
||||
*/
|
||||
|
@ -112,7 +112,6 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
|
||||
{
|
||||
register struct ext2_sb_info *fs;
|
||||
daddr_t bno;
|
||||
int cg, error;
|
||||
|
||||
*bnp = 0;
|
||||
fs = ip->i_e2fs;
|
||||
@ -391,7 +390,7 @@ ext2_valloc(ap)
|
||||
register struct ext2_sb_info *fs;
|
||||
register struct inode *ip;
|
||||
mode_t mode = ap->a_mode;
|
||||
ino_t ino, ipref;
|
||||
ino_t ino;
|
||||
int i, error;
|
||||
#if !defined(__FreeBSD__)
|
||||
struct timeval time;
|
||||
@ -469,7 +468,6 @@ ext2_blkpref(ip, lbn, indx, bap, blocknr)
|
||||
daddr_t *bap;
|
||||
daddr_t blocknr;
|
||||
{
|
||||
register struct ext2_sb_info *fs;
|
||||
int tmp;
|
||||
|
||||
/* if the next block is actually what we thought it is,
|
||||
|
@ -103,8 +103,6 @@ struct ext2_group_desc * get_group_desc __P((struct mount * ,
|
||||
void ext2_discard_prealloc __P((struct inode *));
|
||||
int ext2_inactive __P((struct vop_inactive_args *));
|
||||
int ll_w_block __P((struct buf *, int ));
|
||||
int ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei));
|
||||
int ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di));
|
||||
int ext2_new_block __P ((struct mount * mp, unsigned long goal,
|
||||
long * prealloc_count,
|
||||
long * prealloc_block));
|
||||
@ -115,6 +113,9 @@ void ext2_free_inode (struct inode * inode);
|
||||
int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p));
|
||||
int ext2_reload __P((struct mount *mountp, struct ucred *cred,
|
||||
struct proc *p));
|
||||
void ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di));
|
||||
void ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei));
|
||||
void mark_buffer_dirty __P((struct buf *bh));
|
||||
|
||||
#if !defined(__FreeBSD__)
|
||||
int bwrite(); /* FFS needs a bwrite routine. XXX */
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/systm.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
@ -48,9 +49,11 @@
|
||||
#undef i_uid
|
||||
|
||||
#include <gnu/ext2fs/ext2_fs.h>
|
||||
#include <gnu/ext2fs/ext2_extern.h>
|
||||
#include <gnu/ext2fs/ext2_fs_i.h>
|
||||
|
||||
void ext2_print_dinode( di )
|
||||
void
|
||||
ext2_print_dinode( di )
|
||||
struct dinode *di;
|
||||
{
|
||||
int i;
|
||||
@ -79,7 +82,8 @@ void ext2_print_dinode( di )
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void ext2_print_inode( in )
|
||||
void
|
||||
ext2_print_inode( in )
|
||||
struct inode *in;
|
||||
{
|
||||
printf( "Inode: %5d", in->i_number);
|
||||
@ -89,7 +93,8 @@ void ext2_print_inode( in )
|
||||
/*
|
||||
* raw ext2 inode to dinode
|
||||
*/
|
||||
int ext2_ei2di(ei, di)
|
||||
void
|
||||
ext2_ei2di(ei, di)
|
||||
struct ext2_inode *ei;
|
||||
struct dinode *di;
|
||||
{
|
||||
@ -123,7 +128,8 @@ int ext2_ei2di(ei, di)
|
||||
/*
|
||||
* dinode to raw ext2 inode
|
||||
*/
|
||||
int ext2_di2ei(di, ei)
|
||||
void
|
||||
ext2_di2ei(di, ei)
|
||||
struct dinode *di;
|
||||
struct ext2_inode *ei;
|
||||
{
|
||||
|
@ -93,7 +93,6 @@ static int load__block_bitmap (struct mount * mp,
|
||||
struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs;
|
||||
unsigned long block_bitmap_number;
|
||||
struct buffer_head * block_bitmap;
|
||||
int error;
|
||||
|
||||
if (block_group >= sb->s_groups_count)
|
||||
panic ( "load_block_bitmap: "
|
||||
@ -227,7 +226,7 @@ void ext2_free_blocks (struct mount * mp, unsigned long block,
|
||||
}
|
||||
|
||||
mark_buffer_dirty(bh2);
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
/****
|
||||
if (sb->s_flags & MS_SYNCHRONOUS) {
|
||||
ll_rw_block (WRITE, 1, &bh);
|
||||
@ -444,7 +443,7 @@ got_block:
|
||||
"Goal hits %d of %d.\n", j, goal_hits, goal_attempts);
|
||||
|
||||
gdp->bg_free_blocks_count--;
|
||||
mark_buffer_dirty(bh2, 1);
|
||||
mark_buffer_dirty(bh2);
|
||||
es->s_free_blocks_count--;
|
||||
sb->s_dirt = 1;
|
||||
unlock_super (VFSTOUFS(mp)->um_devvp);
|
||||
|
@ -284,7 +284,7 @@ static void inc_inode_version (struct inode * inode,
|
||||
EXT2_INODES_PER_BLOCK(inode->i_sb));
|
||||
raw_inode->i_version++;
|
||||
inode->u.ext2_i.i_version = raw_inode->i_version;
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
brelse (bh);
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@ repeat:
|
||||
goto repeat;
|
||||
}
|
||||
/* Linux now does the following:
|
||||
mark_buffer_dirty(bh, 1);
|
||||
mark_buffer_dirty(bh);
|
||||
if (sb->s_flags & MS_SYNCHRONOUS) {
|
||||
ll_rw_block (WRITE, 1, &bh);
|
||||
wait_on_buffer (bh);
|
||||
|
@ -56,11 +56,13 @@
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
#include <ufs/ufs/dir.h>
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
#include <ufs/ufs/ufs_extern.h>
|
||||
|
||||
#include <gnu/ext2fs/ext2_extern.h>
|
||||
#include <gnu/ext2fs/ext2_fs.h>
|
||||
@ -73,17 +75,7 @@
|
||||
*/
|
||||
#undef DIRBLKSIZ
|
||||
|
||||
#if 1
|
||||
extern struct nchstats nchstats;
|
||||
static int dirchk = 1;
|
||||
#else
|
||||
struct nchstats nchstats;
|
||||
#if DIAGNOSTIC
|
||||
int dirchk = 1;
|
||||
#else
|
||||
int dirchk = 0;
|
||||
#endif
|
||||
#endif
|
||||
extern int dirchk;
|
||||
|
||||
/*
|
||||
* the problem that is tackled below is the fact that FFS
|
||||
@ -155,7 +147,7 @@ ext2_readdir(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
register struct uio *uio = ap->a_uio;
|
||||
int count, lost, error;
|
||||
int count, error;
|
||||
|
||||
struct ext2_dir_entry *edp, *dp;
|
||||
struct dirent dstdp;
|
||||
@ -164,8 +156,6 @@ ext2_readdir(ap)
|
||||
caddr_t dirbuf;
|
||||
int readcnt;
|
||||
u_quad_t startoffset = uio->uio_offset;
|
||||
u_char tmp;
|
||||
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->s_blocksize;
|
||||
|
||||
count = uio->uio_resid; /* legyenek boldogok akik akarnak ... */
|
||||
uio->uio_resid = count;
|
||||
@ -426,7 +416,7 @@ searchloop:
|
||||
ep = (struct ext2_dir_entry *)
|
||||
((char *)bp->b_data + entryoffsetinblock);
|
||||
if (ep->rec_len == 0 ||
|
||||
dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock)) {
|
||||
(dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock))) {
|
||||
int i;
|
||||
ufs_dirbad(dp, dp->i_offset, "mangled entry");
|
||||
i = DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1));
|
||||
@ -725,8 +715,6 @@ ext2_dirbadentry(dp, de, entryoffsetinblock)
|
||||
register struct ext2_dir_entry *de;
|
||||
int entryoffsetinblock;
|
||||
{
|
||||
register int i;
|
||||
int namlen;
|
||||
int DIRBLKSIZ = VTOI(dp)->i_e2fs->s_blocksize;
|
||||
|
||||
char * error_msg = NULL;
|
||||
@ -911,7 +899,6 @@ ext2_dirremove(dvp, cnp)
|
||||
struct ext2_dir_entry *ep;
|
||||
struct buf *bp;
|
||||
int error;
|
||||
int DIRBLKSIZ = VTOI(dvp)->i_e2fs->s_blocksize;
|
||||
|
||||
dp = VTOI(dvp);
|
||||
if (dp->i_count == 0) {
|
||||
|
@ -435,7 +435,7 @@ ext2_reload(mountp, cred, p)
|
||||
struct buf *bp;
|
||||
struct ext2_super_block * es;
|
||||
struct ext2_sb_info *fs;
|
||||
int i, size, error;
|
||||
int error;
|
||||
|
||||
if ((mountp->mnt_flag & MNT_RDONLY) == 0)
|
||||
return (EINVAL);
|
||||
@ -529,7 +529,6 @@ ext2_mountfs(devvp, mp, p)
|
||||
struct ext2_super_block * es;
|
||||
dev_t dev = devvp->v_rdev;
|
||||
struct partinfo dpart;
|
||||
caddr_t base;
|
||||
int havepart = 0;
|
||||
int error, i, size;
|
||||
int ronly;
|
||||
@ -706,7 +705,7 @@ ext2_flushfiles(mp, flags, p)
|
||||
extern int doforce;
|
||||
#endif
|
||||
register struct ufsmount *ump;
|
||||
int i, error;
|
||||
int error;
|
||||
|
||||
if (!doforce)
|
||||
flags &= ~FORCECLOSE;
|
||||
@ -1050,9 +1049,7 @@ ext2_sbupdate(mp, waitfor)
|
||||
register struct ext2_sb_info *fs = mp->um_e2fs;
|
||||
register struct ext2_super_block *es = fs->s_es;
|
||||
register struct buf *bp;
|
||||
int blks;
|
||||
caddr_t space;
|
||||
int i, size, error = 0;
|
||||
int i, error = 0;
|
||||
/*
|
||||
printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user