From 5c8ad1fc7c933d3d2b1524c81c5daea76dec2841 Mon Sep 17 00:00:00 2001 From: Jonathan Neuschäfer Date: Mon, 15 Aug 2011 22:10:09 +0200 Subject: fix common misspellings * Fix spelling with codespell[1] and manually review it. [1] http://git.profusion.mobi/cgit.cgi/lucas/codespell/ --- ufs/alloc.c | 6 +++--- ufs/dir.c | 2 +- ufs/inode.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ufs') 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 -- cgit v1.2.3 From 552113d0cd000b86e266c8ca23724511f8fdb8c4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 25 Mar 2012 22:13:55 +0200 Subject: Fix extern inline use * ext2fs/Makefile (SRCS): Add xinl.c * libtreefs/Makefile (OTHERSRCS): Likewise. * term/Makefile (SRCS): Likewise. * ufs/Makefile (SRCS): Likewise. * hostmux/hostmux-xinl.c: Define HOSTMUX_DEFINE_EI instead of HOSTMUX_EI. * libdiskfs/extern-inline.c: Define DISKFS_DEFINE_EXTERN_INLINE instead of DISKFS_EXTERN_INLINE. * libftpconn/xinl.c: Define FTP_CONN_DEFINE_EI instead of FTP_CONN_EI. * libpipe/pipe-funcs.c: Define PIPE_DEFINE_EI instead of PIPE_EI. * libpipe/pq-funcs.c: Define PQ_DEFINE_EI instead of PQ_EI. * libshouldbeinlibc/idvec-funcs.c: Define IDVEC_DEFINE_EI instead of IDVEC_EI. * libshouldbeinlibc/maptime-funcs.c: Define MAPTIME_DEFINE_EI instead of MAPTIME_EI. * libshouldbeinlibc/ugids-xinl.c: Define UGIDS_DEFINE_EI instead of UGIDS_EI. * libstore/xinl.c: Define STORE_DEFINE_EI instead of STORE_EI. * libthreads/rwlock.c: Define RWLOCK_DEFINE_EI instead of RWLOCK_EI. * ext2fs/xinl.c: New file, define EXT2FS_DEFINE_EI and include "ext2fs.h" * libtreefs/xinl.c: New file, define TREEFS_DEFINE_EI and include "treefs.h" and "mig-decls.h". * term/xinl.c: New file, define TERM_DEFINE_EI and include "term.h". * ufs/xinl.c: New file, define UFS_DEFINE_EI and include "ufs.h" * ext2fs/ext2fs.h: Include , define EXT2FS_EI to __extern_inline instead of "extern inline", define it to empty when EXT2FS_DEFINE_EI is defined. Always declare extern inline prototypes, and define extern inlines content only if __USE_EXTERN_INLINES or EXT2FS_DEFINE_EI is defined. * libdiskfs/diskfs.h: Likewise with DISKFS_EXTERN_INLINE and DISKFS_DEFINE_EXTERN_INLINE. * libftpconn/ftpconn.h: Likewise with FTP_CONN_EI and FTP_CONN_DEFINE_EI. * libftpconn/priv.h: Likewise. * libpipe/pipe.h: Likewise with PIPE_EI and PIPE_DEFINE_EI. * libpipe/pq.h: Likewise with PQ_EI and PQ_DEFINE_EI. * libshouldbeinlibc/idvec.h: Likewise with IDVEC_EI and IDVEC_DEFINE_EI. * libshouldbeinlibc/maptime.h: Likewise with MAPTIME_EI and MAPTIME_DEFINE_EI. * libshouldbeinlibc/ugids.h: Likewise with UGIDS_EI and UGIDS_DEFINE_EI. * libstore/store.h: Likewise with STORE_EI and STORE_DEFINE_EI. * libthreads/rwlock.h: Likewise with RWLOCK_EI and RWLOCK_DEFINE_EI. * term/term.h: Likewise with TERM_EI and TERM_DEFINE_EI. * ufs/ufs.h: Likewise with UFS_EI and UFS_DEFINE_EI. * libtreefs/treefs.h: Include , define TREE_FS_EI to __extern_inline, or to empty when TREEFS_DEFINE_EI is defined. Use TREEFS_EI instead of "extern inline". * libtreefs/mig-decls.h: Use TREEFS_EI instead of "extern inline". --- ufs/Makefile | 2 +- ufs/ufs.h | 34 ++++++++++++++++++++++++++-------- ufs/xinl.c | 2 ++ 3 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 ufs/xinl.c (limited to 'ufs') 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/ufs.h b/ufs/ufs.h index 5d823ebc..f59784d5 100644 --- a/ufs/ufs.h +++ b/ufs/ufs.h @@ -25,9 +25,16 @@ #include #include #include +#include #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" -- cgit v1.2.3