summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-11-09 08:41:25 +0000
committerbde <bde@FreeBSD.org>1995-11-09 08:41:25 +0000
commitaded75dcc7f6064842d12a20701f44cece2752ec (patch)
tree866a77c31ac69b4168aea5f7ae55384668be1668 /sys/gnu/fs
parent449a11eb8852c894681575cf4226b1c639a2f9bc (diff)
downloadFreeBSD-src-aded75dcc7f6064842d12a20701f44cece2752ec.zip
FreeBSD-src-aded75dcc7f6064842d12a20701f44cece2752ec.tar.gz
ext2_inode_cnv.c:
Included <sys/vnode.h> and its prerequisite <sys/proc.h>, and cleaned up includes. The vop_t changes made the non-inclusion of vnode.h fatal instead of just sloppy. i386_bitops.h: Changed `extern inline' to `static inline'. `extern inline' is a Linuxism that stops things from compiling without -O. Fixed idempotency identifier. Misc: Added prototypes. Staticized some functions so that prototypes are unnecessary. Added casts. Cleaned up includes.
Diffstat (limited to 'sys/gnu/fs')
-rw-r--r--sys/gnu/fs/ext2fs/ext2_extern.h1
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode_cnv.c8
-rw-r--r--sys/gnu/fs/ext2fs/ext2_linux_balloc.c7
-rw-r--r--sys/gnu/fs/ext2fs/ext2_linux_ialloc.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_lookup.c13
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c4
-rw-r--r--sys/gnu/fs/ext2fs/i386-bitops.h22
7 files changed, 35 insertions, 24 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_extern.h b/sys/gnu/fs/ext2fs/ext2_extern.h
index 6c53aaa..ea83912 100644
--- a/sys/gnu/fs/ext2fs/ext2_extern.h
+++ b/sys/gnu/fs/ext2fs/ext2_extern.h
@@ -107,6 +107,7 @@ int ext2_new_block __P ((struct mount * mp, unsigned long goal,
long * prealloc_count,
long * prealloc_block));
ino_t ext2_new_inode __P ((const struct inode * dir, int mode));
+unsigned long ext2_count_free __P((struct buf *map, unsigned int numchars));
void ext2_free_blocks (struct mount * mp, unsigned long block,
unsigned long count);
void ext2_free_inode (struct inode * inode);
diff --git a/sys/gnu/fs/ext2fs/ext2_inode_cnv.c b/sys/gnu/fs/ext2fs/ext2_inode_cnv.c
index 8d043bc..2f723d4 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode_cnv.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode_cnv.c
@@ -24,10 +24,12 @@
/*
* routines to convert on disk ext2 inodes in dinodes and back
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
+#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/stat.h>
+#include <sys/vnode.h>
+
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
diff --git a/sys/gnu/fs/ext2fs/ext2_linux_balloc.c b/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
index 432fc7b..50b006d 100644
--- a/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_linux_balloc.c
@@ -47,8 +47,6 @@
#error Provide an bitops.h file, please !
#endif
-unsigned long ext2_count_free __P((struct buffer_head *, unsigned int));
-
#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
/* got rid of get_group_desc since it can already be found in
@@ -450,7 +448,7 @@ got_block:
return j;
}
-unsigned long ext2_count_free_blocks (struct mount * mp)
+static unsigned long ext2_count_free_blocks (struct mount * mp)
{
struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs;
#ifdef EXT2FS_DEBUG
@@ -493,7 +491,7 @@ static inline int block_in_use (unsigned long block,
EXT2_BLOCKS_PER_GROUP(sb), map);
}
-void ext2_check_blocks_bitmap (struct mount * mp)
+static void ext2_check_blocks_bitmap (struct mount * mp)
{
struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs;
struct buffer_head * bh;
@@ -578,4 +576,3 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
nibblemap[(map->b_data[i] >> 4) & 0xf];
return (sum);
}
-
diff --git a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
index adc5dc4..263992a 100644
--- a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
@@ -37,6 +37,7 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/ufsmount.h>
+#include <gnu/ext2fs/ext2_extern.h>
#include <gnu/ext2fs/ext2_fs.h>
#include <gnu/ext2fs/ext2_fs_sb.h>
#include <gnu/ext2fs/fs.h>
@@ -448,7 +449,7 @@ repeat:
return j;
}
-unsigned long ext2_count_free_inodes (struct mount * mp)
+static unsigned long ext2_count_free_inodes (struct mount * mp)
{
#ifdef EXT2FS_DEBUG
struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs;
@@ -517,4 +518,3 @@ void ext2_check_inodes_bitmap (struct mount * mp)
unlock_super (sb);
}
#endif
-
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c
index af23e45..022f6d7 100644
--- a/sys/gnu/fs/ext2fs/ext2_lookup.c
+++ b/sys/gnu/fs/ext2fs/ext2_lookup.c
@@ -49,6 +49,7 @@
#endif
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/buf.h>
#include <sys/file.h>
@@ -56,7 +57,6 @@
#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>
@@ -77,6 +77,12 @@
extern int dirchk;
+static void ext2_dirconv2ffs __P((struct ext2_dir_entry *e2dir,
+ struct dirent *ffsdir));
+static int ext2_dirbadentry __P((struct vnode *dp,
+ struct ext2_dir_entry *de,
+ int entryoffsetinblock));
+
/*
* the problem that is tackled below is the fact that FFS
* includes the terminating zero on disk while EXT2FS doesn't
@@ -186,7 +192,8 @@ printf("ext2_readdir called uio->uio_offset %d uio->uio_resid %d count %d \n",
dp = (struct ext2_dir_entry *)
((char *)dp + dp->rec_len);
error =
- uiomove(&dstdp, dstdp.d_reclen, uio);
+ uiomove((caddr_t)&dstdp,
+ dstdp.d_reclen, uio);
} else
break;
} else {
@@ -709,7 +716,7 @@ found:
/*
* changed so that it confirms to ext2_check_dir_entry
*/
-int
+static int
ext2_dirbadentry(dp, de, entryoffsetinblock)
struct vnode *dp;
register struct ext2_dir_entry *de;
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 0fcbc04..048b83f 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -103,6 +103,10 @@ extern u_long nextgennumber;
*/
#define ROOTNAME "root_device"
+static int compute_sb_data __P((struct vnode * devvp,
+ struct ext2_super_block * es,
+ struct ext2_sb_info * fs));
+
int
ext2_mountroot()
{
diff --git a/sys/gnu/fs/ext2fs/i386-bitops.h b/sys/gnu/fs/ext2fs/i386-bitops.h
index a66679e..618913e 100644
--- a/sys/gnu/fs/ext2fs/i386-bitops.h
+++ b/sys/gnu/fs/ext2fs/i386-bitops.h
@@ -4,8 +4,8 @@
*
* XXX replace with Mach routines or reprogram in C
*/
-#ifndef _I386_BITOPS_H
-#define _I386_BITOPS_H
+#ifndef _SYS_GNU_EXT2FS_I386_BITOPS_H_
+#define _SYS_GNU_EXT2FS_I386_BITOPS_H_
/*
* Copyright 1992, Linus Torvalds.
@@ -25,7 +25,7 @@
struct __dummy { unsigned long a[100]; };
#define ADDR (*(struct __dummy *) addr)
-extern __inline__ int set_bit(int nr, void * addr)
+static __inline__ int set_bit(int nr, void * addr)
{
int oldbit;
@@ -35,7 +35,7 @@ extern __inline__ int set_bit(int nr, void * addr)
return oldbit;
}
-extern __inline__ int clear_bit(int nr, void * addr)
+static __inline__ int clear_bit(int nr, void * addr)
{
int oldbit;
@@ -45,7 +45,7 @@ extern __inline__ int clear_bit(int nr, void * addr)
return oldbit;
}
-extern __inline__ int change_bit(int nr, void * addr)
+static __inline__ int change_bit(int nr, void * addr)
{
int oldbit;
@@ -59,7 +59,7 @@ extern __inline__ int change_bit(int nr, void * addr)
* This routine doesn't need to be atomic, but it's faster to code it
* this way.
*/
-extern __inline__ int test_bit(int nr, void * addr)
+static __inline__ int test_bit(int nr, void * addr)
{
int oldbit;
@@ -72,7 +72,7 @@ extern __inline__ int test_bit(int nr, void * addr)
/*
* Find-bit routines..
*/
-extern inline int find_first_zero_bit(void * addr, unsigned size)
+static inline int find_first_zero_bit(void * addr, unsigned size)
{
int res;
@@ -96,7 +96,7 @@ extern inline int find_first_zero_bit(void * addr, unsigned size)
return res;
}
-extern inline int find_next_zero_bit (void * addr, int size, int offset)
+static inline int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
@@ -128,7 +128,7 @@ extern inline int find_next_zero_bit (void * addr, int size, int offset)
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
-extern inline unsigned long ffz(unsigned long word)
+static inline unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
@@ -142,7 +142,7 @@ extern inline unsigned long ffz(unsigned long word)
/*
* find the first occurrence of byte 'c', or 1 past the area if none
*/
-extern inline char * memscan(void * addr, unsigned char c, int size)
+static inline char * memscan(void * addr, unsigned char c, int size)
{
if (!size)
return addr;
@@ -156,4 +156,4 @@ extern inline char * memscan(void * addr, unsigned char c, int size)
return addr;
}
-#endif /* _I386_BITOPS_H */
+#endif /* !_SYS_GNU_EXT2FS_I386_BITOPS_H_ */
OpenPOWER on IntegriCloud