diff options
author | phk <phk@FreeBSD.org> | 2002-07-30 11:54:48 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-07-30 11:54:48 +0000 |
commit | 99c4adc497cafabee4eafc8a322298d673879535 (patch) | |
tree | 773a60b35d21efed58e37658c3f3e9811b6b2b1f | |
parent | 4b913866d745ae726ecab67ac4d2ef85f01f9529 (diff) | |
download | FreeBSD-src-99c4adc497cafabee4eafc8a322298d673879535.zip FreeBSD-src-99c4adc497cafabee4eafc8a322298d673879535.tar.gz |
Move ffs_isfreeblock() to ffs_alloc.c and make it static.
Sponsored by: DARPA & NAI Labs.
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 25 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 1 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_subr.c | 25 |
3 files changed, 25 insertions, 26 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 1360ec8..7d35140 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1644,6 +1644,31 @@ gotit: } /* + * check if a block is free + */ +static int +ffs_isfreeblock(struct fs *fs, unsigned char *cp, ufs1_daddr_t h) + struct fs *fs; + unsigned char *cp; + ufs1_daddr_t h; +{ + + switch ((int)fs->fs_frag) { + case 8: + return (cp[h] == 0); + case 4: + return ((cp[h >> 1] & (0x0f << ((h & 0x1) << 2))) == 0); + case 2: + return ((cp[h >> 2] & (0x03 << ((h & 0x3) << 1))) == 0); + case 1: + return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0); + default: + panic("ffs_isfreeblock"); + } + return (0); +} + +/* * Free a block or fragment. * * The specified block or fragment is placed back in the diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index c2972c8..b65fe71 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -70,7 +70,6 @@ int ffs_flushfiles(struct mount *, int, struct thread *); void ffs_fragacct(struct fs *, int, int32_t [], int); int ffs_freefile(struct fs *, struct vnode *, ino_t, int ); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); -int ffs_isfreeblock(struct fs *, unsigned char *, ufs1_daddr_t); void ffs_load_inode(struct buf *, struct inode *, struct malloc_type *, struct fs *, ino_t); int ffs_mountfs(struct vnode *, struct mount *, struct thread *, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index bfaf313..aa2d2aa 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -240,31 +240,6 @@ ffs_isblock(fs, cp, h) } /* - * check if a block is free - */ -int -ffs_isfreeblock(fs, cp, h) - struct fs *fs; - unsigned char *cp; - ufs1_daddr_t h; -{ - - switch ((int)fs->fs_frag) { - case 8: - return (cp[h] == 0); - case 4: - return ((cp[h >> 1] & (0x0f << ((h & 0x1) << 2))) == 0); - case 2: - return ((cp[h >> 2] & (0x03 << ((h & 0x3) << 1))) == 0); - case 1: - return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0); - default: - panic("ffs_isfreeblock"); - } - return (0); -} - -/* * take a block out of the map */ void |