summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
Diffstat (limited to 'ufs')
-rw-r--r--ufs/Makefile2
-rw-r--r--ufs/alloc.c6
-rw-r--r--ufs/dir.c2
-rw-r--r--ufs/inode.c2
-rw-r--r--ufs/ufs.h34
-rw-r--r--ufs/xinl.c2
6 files changed, 34 insertions, 14 deletions
diff --git a/ufs/Makefile b/ufs/Makefile
index 02cf38ba..cf5c40d7 100644
--- a/ufs/Makefile
+++ b/ufs/Makefile
@@ -21,7 +21,7 @@ makemode := server
target = ufs
SRCS = alloc.c consts.c dir.c hyper.c inode.c main.c pager.c \
- sizes.c subr.c tables.c bmap.c pokeloc.c
+ sizes.c subr.c tables.c bmap.c pokeloc.c xinl.c
LCLHDRS = ufs.h fs.h dinode.h dir.h
OBJS = $(SRCS:.c=.o)
diff --git a/ufs/alloc.c b/ufs/alloc.c
index 48ee60cc..d8f92255 100644
--- a/ufs/alloc.c
+++ b/ufs/alloc.c
@@ -215,7 +215,7 @@ release_cg (struct cg *cgp)
* 3) allocate a block in the same cylinder group.
* 4) quadradically rehash into other cylinder groups, until an
* available block is located.
- * If no block preference is given the following heirarchy is used
+ * If no block preference is given the following hierarchy is used
* to allocate a block:
* 1) allocate a block in the cylinder group that contains the
* inode for the file.
@@ -472,7 +472,7 @@ nospace:
* logical blocks to be made contiguous is given. The allocator attempts
* to find a range of sequential blocks starting as close as possible to
* an fs_rotdelay offset from the end of the allocation for the logical
- * block immediately preceeding the current range. If successful, the
+ * block immediately preceding the current range. If successful, the
* physical block numbers in the buffer pointers and in the inode are
* changed to reflect the new allocation. If unsuccessful, the allocation
* is left unchanged. The success in doing the reallocation is returned.
@@ -638,7 +638,7 @@ fail:
* 2) allocate an inode in the same cylinder group.
* 3) quadradically rehash into other cylinder groups, until an
* available inode is located.
- * If no inode preference is given the following heirarchy is used
+ * If no inode preference is given the following hierarchy is used
* to allocate an inode:
* 1) allocate an inode in cylinder group 0.
* 2) quadradically rehash into other cylinder groups, until an
diff --git a/ufs/dir.c b/ufs/dir.c
index 7a8cfa55..3c5f152a 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -664,7 +664,7 @@ diskfs_direnter_hard(struct node *dp,
/* Following a lookup call for REMOVE, this removes the link from the
directory. DP is the directory being changed and DS is the cached
information returned from lookup. This call is only valid if the
- directory has been locked continously since the call to lookup, and
+ directory has been locked continuously since the call to lookup, and
only if that call succeeded. */
error_t
diskfs_dirremove_hard(struct node *dp,
diff --git a/ufs/inode.c b/ufs/inode.c
index 1a8a7098..77a45edb 100644
--- a/ufs/inode.c
+++ b/ufs/inode.c
@@ -181,7 +181,7 @@ diskfs_lost_hardrefs (struct node *np)
spin_unlock (&_libports_portrefcntlock);
/* Right now the node is locked with no hard refs;
- this is an anomolous situation. Before messing with
+ this is an anomalous situation. Before messing with
the reference count on the file pager, we have to
give ourselves a reference back so that we are really
allowed to hold the lock. Then we can do the
diff --git a/ufs/ufs.h b/ufs/ufs.h
index 5d823ebc..f59784d5 100644
--- a/ufs/ufs.h
+++ b/ufs/ufs.h
@@ -25,9 +25,16 @@
#include <hurd/diskfs.h>
#include <sys/mman.h>
#include <assert.h>
+#include <features.h>
#include "fs.h"
#include "dinode.h"
+#ifdef UFS_DEFINE_EI
+#define UFS_EI
+#else
+#define UFS_EI __extern_inline
+#endif
+
/* Define this if memory objects should not be cached by the kernel.
Normally, don't define it, but defining it causes a much greater rate
of paging requests, which may be helpful in catching bugs. */
@@ -150,8 +157,18 @@ unsigned log2_dev_blocks_per_dev_bsize;
/* Functions for looking inside disk_image */
+extern struct dinode * dino (ino_t inum);
+extern daddr_t * indir_block (daddr_t bno);
+extern struct cg * cg_locate (int ncg);
+extern void sync_disk_blocks (daddr_t blkno, size_t nbytes, int wait);
+extern void sync_dinode (int inum, int wait);
+extern short swab_short (short arg);
+extern long swab_long (long arg);
+extern long long swab_long_long (long long arg);
+
+#if defined(__USE_EXTERN_INLINES) || defined(UFS_DEFINE_EI)
/* Convert an inode number to the dinode on disk. */
-extern inline struct dinode *
+UFS_EI struct dinode *
dino (ino_t inum)
{
return (struct dinode *)
@@ -161,28 +178,28 @@ dino (ino_t inum)
}
/* Convert a indirect block number to a daddr_t table. */
-extern inline daddr_t *
+UFS_EI daddr_t *
indir_block (daddr_t bno)
{
return (daddr_t *) (disk_image + fsaddr (sblock, bno));
}
/* Convert a cg number to the cylinder group. */
-extern inline struct cg *
+UFS_EI struct cg *
cg_locate (int ncg)
{
return (struct cg *) (disk_image + fsaddr (sblock, cgtod (sblock, ncg)));
}
/* Sync part of the disk */
-extern inline void
+UFS_EI void
sync_disk_blocks (daddr_t blkno, size_t nbytes, int wait)
{
pager_sync_some (diskfs_disk_pager, fsaddr (sblock, blkno), nbytes, wait);
}
/* Sync an disk inode */
-extern inline void
+UFS_EI void
sync_dinode (int inum, int wait)
{
sync_disk_blocks (ino_to_fsba (sblock, inum), sblock->fs_fsize, wait);
@@ -190,26 +207,27 @@ sync_dinode (int inum, int wait)
/* Functions for byte swapping */
-extern inline short
+UFS_EI short
swab_short (short arg)
{
return (((arg & 0xff) << 8)
| ((arg & 0xff00) >> 8));
}
-extern inline long
+UFS_EI long
swab_long (long arg)
{
return (((long) swab_short (arg & 0xffff) << 16)
| swab_short ((arg & 0xffff0000) >> 16));
}
-extern inline long long
+UFS_EI long long
swab_long_long (long long arg)
{
return (((long long) swab_long (arg & 0xffffffff) << 32)
| swab_long ((arg & 0xffffffff00000000LL) >> 32));
}
+#endif /* Use extern inlines. */
/* Return ENTRY, after byteswapping it if necessary */
#define read_disk_entry(entry) \
diff --git a/ufs/xinl.c b/ufs/xinl.c
new file mode 100644
index 00000000..7994a1f7
--- /dev/null
+++ b/ufs/xinl.c
@@ -0,0 +1,2 @@
+#define UFS_DEFINE_EI
+#include "ufs.h"