From 2c603bc944583d5465833367ec7b3427e0fefec4 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Fri, 29 May 2015 20:17:39 +0900 Subject: [PATCH] sys/gnu/vfs/ext2fs: Fix coding style - Fix coding style that we rarely see in dfly kernel as well as ansi c code in general. - It's visually confusing as it resembles multiplication of variables. - (Note that dfly's ext2 seems to be broken currently) --- sys/gnu/vfs/ext2fs/ext2_extern.h | 16 ++++---- sys/gnu/vfs/ext2fs/ext2_fs_sb.h | 10 ++--- sys/gnu/vfs/ext2fs/ext2_linux_balloc.c | 52 +++++++++++++------------- sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c | 44 +++++++++++----------- sys/gnu/vfs/ext2fs/ext2_lookup.c | 2 +- sys/gnu/vfs/ext2fs/ext2_vfsops.c | 12 +++--- sys/gnu/vfs/ext2fs/i386-bitops.h | 2 +- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/sys/gnu/vfs/ext2fs/ext2_extern.h b/sys/gnu/vfs/ext2fs/ext2_extern.h index 40acf72b78..a3724e48c1 100644 --- a/sys/gnu/vfs/ext2fs/ext2_extern.h +++ b/sys/gnu/vfs/ext2fs/ext2_extern.h @@ -77,19 +77,19 @@ int ext2_dirrewrite (struct inode *, struct inode *, struct componentname *); int ext2_dirempty (struct inode *, ino_t, struct ucred *); int ext2_checkpath (struct inode *, struct inode *, struct ucred *); -struct ext2_group_desc * get_group_desc (struct mount * , - unsigned int , struct buf ** ); +struct ext2_group_desc *get_group_desc (struct mount *, + unsigned int, struct buf **); int ext2_group_sparse (int group); void ext2_discard_prealloc (struct inode *); int ext2_inactive (struct vop_inactive_args *); -int ext2_new_block (struct mount * mp, unsigned long goal, - u_int32_t * prealloc_count, - u_int32_t * prealloc_block); -ino_t ext2_new_inode (const struct inode * dir, int mode); +int ext2_new_block (struct mount *mp, unsigned long goal, + u_int32_t *prealloc_count, + u_int32_t *prealloc_block); +ino_t ext2_new_inode (const struct inode *dir, int mode); unsigned long ext2_count_free (struct buf *map, unsigned int numchars); -void ext2_free_blocks (struct mount * mp, unsigned long block, +void ext2_free_blocks (struct mount *mp, unsigned long block, unsigned long count); -void ext2_free_inode (struct inode * inode); +void ext2_free_inode (struct inode *inode); void ext2_ei2di (struct ext2_inode *ei, struct ext2_dinode *di); void ext2_di2ei (struct ext2_dinode *di, struct ext2_inode *ei); void mark_buffer_dirty (struct buf *bh); diff --git a/sys/gnu/vfs/ext2fs/ext2_fs_sb.h b/sys/gnu/vfs/ext2fs/ext2_fs_sb.h index d8079989e0..5b5820091c 100644 --- a/sys/gnu/vfs/ext2fs/ext2_fs_sb.h +++ b/sys/gnu/vfs/ext2fs/ext2_fs_sb.h @@ -46,15 +46,15 @@ struct ext2_sb_info { unsigned long s_db_per_group; /* Number of descriptor blocks per group */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ - struct buf * s_sbh; /* Buffer containing the super block */ - struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ - struct buf ** s_group_desc; + struct buf *s_sbh; /* Buffer containing the super block */ + struct ext2_super_block *s_es; /* Pointer to the super block in the buffer */ + struct buf **s_group_desc; unsigned short s_loaded_inode_bitmaps; unsigned short s_loaded_block_bitmaps; unsigned long s_inode_bitmap_number[EXT2_MAX_GROUP_LOADED]; - struct buf * s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; + struct buf *s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED]; - struct buf * s_block_bitmap[EXT2_MAX_GROUP_LOADED]; + struct buf *s_block_bitmap[EXT2_MAX_GROUP_LOADED]; int s_rename_lock; unsigned long s_mount_opt; #ifdef notyet diff --git a/sys/gnu/vfs/ext2fs/ext2_linux_balloc.c b/sys/gnu/vfs/ext2fs/ext2_linux_balloc.c index f2ea7854ee..4eaeab2450 100644 --- a/sys/gnu/vfs/ext2fs/ext2_linux_balloc.c +++ b/sys/gnu/vfs/ext2fs/ext2_linux_balloc.c @@ -64,8 +64,8 @@ read_block_bitmap(struct mount *mp, unsigned int block_group, unsigned long bitmap_nr) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct ext2_group_desc * gdp; - struct buf * bh; + struct ext2_group_desc *gdp; + struct buf *bh; int error; gdp = get_group_desc (mp, block_group, NULL); @@ -100,7 +100,7 @@ load__block_bitmap(struct mount *mp, unsigned int block_group) int i, j; struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; unsigned long block_bitmap_number; - struct buf * block_bitmap; + struct buf *block_bitmap; if (block_group >= sb->s_groups_count) panic ( "load_block_bitmap: " @@ -155,7 +155,7 @@ load__block_bitmap(struct mount *mp, unsigned int block_group) } static __inline int -load_block_bitmap(struct mount * mp, unsigned int block_group) +load_block_bitmap(struct mount *mp, unsigned int block_group) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; if (sb->s_loaded_block_bitmaps > 0 && @@ -171,18 +171,18 @@ load_block_bitmap(struct mount * mp, unsigned int block_group) } void -ext2_free_blocks(struct mount * mp, unsigned long block, +ext2_free_blocks(struct mount *mp, unsigned long block, unsigned long count) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct buf * bh; - struct buf * bh2; + struct buf *bh; + struct buf *bh2; unsigned long block_group; unsigned long bit; unsigned long i; int bitmap_nr; - struct ext2_group_desc * gdp; - struct ext2_super_block * es; + struct ext2_group_desc *gdp; + struct ext2_super_block *es; if (!sb) { kprintf ("ext2_free_blocks: nonexistent device"); @@ -257,18 +257,18 @@ ext2_free_blocks(struct mount * mp, unsigned long block, * bitmap, and then for any free bit if that fails. */ int -ext2_new_block(struct mount * mp, unsigned long goal, - u_int32_t * prealloc_count, - u_int32_t * prealloc_block) +ext2_new_block(struct mount *mp, unsigned long goal, + u_int32_t *prealloc_count, + u_int32_t *prealloc_block) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct buf * bh; - struct buf * bh2; - char * p, * r; + struct buf *bh; + struct buf *bh2; + char *p, *r; int i, j, k, tmp; int bitmap_nr; - struct ext2_group_desc * gdp; - struct ext2_super_block * es; + struct ext2_group_desc *gdp; + struct ext2_super_block *es; #ifdef EXT2FS_DEBUG static int goal_hits = 0, goal_attempts = 0; @@ -465,14 +465,14 @@ got_block: #ifdef unused static unsigned long -ext2_count_free_blocks(struct mount * mp) +ext2_count_free_blocks(struct mount *mp) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; #ifdef EXT2FS_DEBUG - struct ext2_super_block * es; + struct ext2_super_block *es; unsigned long desc_count, bitmap_count, x; int bitmap_nr; - struct ext2_group_desc * gdp; + struct ext2_group_desc *gdp; int i; lock_super (VFSTOEXT2(mp)->um_devvp); @@ -502,7 +502,7 @@ ext2_count_free_blocks(struct mount * mp) static __inline int block_in_use (unsigned long block, struct ext2_sb_info *sb, - unsigned char * map) + unsigned char *map) { return test_bit ((block - sb->s_es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb), map); @@ -531,15 +531,15 @@ ext2_group_sparse(int group) #ifdef unused static void -ext2_check_blocks_bitmap(struct mount * mp) +ext2_check_blocks_bitmap(struct mount *mp) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct buf * bh; - struct ext2_super_block * es; + struct buf *bh; + struct ext2_super_block *es; unsigned long desc_count, bitmap_count, x; unsigned long desc_blocks; int bitmap_nr; - struct ext2_group_desc * gdp; + struct ext2_group_desc *gdp; int i, j; lock_super (VFSTOEXT2(mp)->um_devvp); @@ -610,7 +610,7 @@ ext2_check_blocks_bitmap(struct mount * mp) static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; -unsigned long ext2_count_free (struct buf * map, unsigned int numchars) +unsigned long ext2_count_free (struct buf *map, unsigned int numchars) { unsigned int i; unsigned long sum = 0; diff --git a/sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c index f22f53e1e6..3fd4fbf1a4 100644 --- a/sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c +++ b/sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c @@ -65,13 +65,13 @@ mark_buffer_dirty(struct buf *bh) } struct ext2_group_desc * -get_group_desc(struct mount * mp, unsigned int block_group, +get_group_desc(struct mount *mp, unsigned int block_group, struct buf **bh) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; unsigned long group_desc; unsigned long desc; - struct ext2_group_desc * gdp; + struct ext2_group_desc *gdp; if (block_group >= sb->s_groups_count) panic ("get_group_desc: " @@ -98,8 +98,8 @@ read_inode_bitmap(struct mount *mp, unsigned long block_group, unsigned int bitmap_nr) { struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct ext2_group_desc * gdp; - struct buf * bh; + struct ext2_group_desc *gdp; + struct buf *bh; int error; gdp = get_group_desc (mp, block_group, NULL); @@ -132,7 +132,7 @@ load_inode_bitmap(struct mount *mp, unsigned int block_group) struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; int i, j; unsigned long inode_bitmap_number; - struct buf * inode_bitmap; + struct buf *inode_bitmap; if (block_group >= sb->s_groups_count) panic ("load_inode_bitmap:" @@ -192,14 +192,14 @@ load_inode_bitmap(struct mount *mp, unsigned int block_group) void ext2_free_inode(struct inode *inode) { - struct ext2_sb_info * sb; - struct buf * bh; - struct buf * bh2; + struct ext2_sb_info *sb; + struct buf *bh; + struct buf *bh2; unsigned long block_group; unsigned long bit; int bitmap_nr; - struct ext2_group_desc * gdp; - struct ext2_super_block * es; + struct ext2_group_desc *gdp; + struct ext2_super_block *es; if (!inode) return; @@ -258,8 +258,8 @@ static void inc_inode_version(struct inode *inode, struct ext2_group_desc *gdp, int mode) { unsigned long inode_block; - struct buf * bh; - struct ext2_inode * raw_inode; + struct buf *bh; + struct ext2_inode *raw_inode; inode_block = gdp->bg_inode_table + (((inode->i_number - 1) % EXT2_INODES_PER_GROUP(inode->i_sb)) / @@ -299,14 +299,14 @@ inc_inode_version(struct inode *inode, struct ext2_group_desc *gdp, int mode) ino_t ext2_new_inode(const struct inode *dir, int mode) { - struct ext2_sb_info * sb; - struct buf * bh; - struct buf * bh2; + struct ext2_sb_info *sb; + struct buf *bh; + struct buf *bh2; int i, j, avefreei; int bitmap_nr; - struct ext2_group_desc * gdp; - struct ext2_group_desc * tmp; - struct ext2_super_block * es; + struct ext2_group_desc *gdp; + struct ext2_group_desc *tmp; + struct ext2_super_block *es; if (!dir) return 0; @@ -448,10 +448,10 @@ ext2_count_free_inodes(struct mount *mp) { #ifdef EXT2FS_DEBUG struct ext2_sb_info *sb = VFSTOEXT2(mp)->um_e2fs; - struct ext2_super_block * es; + struct ext2_super_block *es; unsigned long desc_count, bitmap_count, x; int bitmap_nr; - struct ext2_group_desc * gdp; + struct ext2_group_desc *gdp; int i; lock_super (VFSTOEXT2(mp)->um_devvp); @@ -483,10 +483,10 @@ ext2_count_free_inodes(struct mount *mp) void ext2_check_inodes_bitmap(struct mount *mp) { - struct ext2_super_block * es; + struct ext2_super_block *es; unsigned long desc_count, bitmap_count, x; int bitmap_nr; - struct ext2_group_desc * gdp; + struct ext2_group_desc *gdp; int i; lock_super (sb); diff --git a/sys/gnu/vfs/ext2fs/ext2_lookup.c b/sys/gnu/vfs/ext2fs/ext2_lookup.c index 8c1d0ab0ec..68033dc6a9 100644 --- a/sys/gnu/vfs/ext2fs/ext2_lookup.c +++ b/sys/gnu/vfs/ext2fs/ext2_lookup.c @@ -702,7 +702,7 @@ ext2_dirbadentry(struct vnode *dp, struct ext2_dir_entry_2 *de, { int DIRBLKSIZ = VTOI(dp)->i_e2fs->s_blocksize; - char * error_msg = NULL; + char *error_msg = NULL; if (de->rec_len < EXT2_DIR_REC_LEN(1)) error_msg = "rec_len is smaller than minimal"; diff --git a/sys/gnu/vfs/ext2fs/ext2_vfsops.c b/sys/gnu/vfs/ext2fs/ext2_vfsops.c index c098caf93f..de073b422a 100644 --- a/sys/gnu/vfs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/vfs/ext2fs/ext2_vfsops.c @@ -115,9 +115,9 @@ static int ext2fs_inode_hash_lock; static int ext2_check_sb_compat (struct ext2_super_block *es, cdev_t dev, int ronly); -static int compute_sb_data (struct vnode * devvp, - struct ext2_super_block * es, - struct ext2_sb_info * fs); +static int compute_sb_data (struct vnode *devvp, + struct ext2_super_block *es, + struct ext2_sb_info *fs); static int ext2_root(struct mount *mp, struct vnode **vpp) @@ -426,7 +426,7 @@ ext2_check_descriptors(struct ext2_sb_info *sb) int i; int desc_block = 0; unsigned long block = sb->s_es->s_first_data_block; - struct ext2_group_desc * gdp = NULL; + struct ext2_group_desc *gdp = NULL; /* ext2_debug ("Checking group descriptors"); */ @@ -642,7 +642,7 @@ ext2_reload(struct mount *mountp, struct ucred *cred) { struct vnode *devvp; struct buf *bp; - struct ext2_super_block * es; + struct ext2_super_block *es; struct ext2_sb_info *fs; int error; struct scaninfo scaninfo; @@ -734,7 +734,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp, struct ucred *cred) struct ext2mount *ump; struct buf *bp; struct ext2_sb_info *fs; - struct ext2_super_block * es; + struct ext2_super_block *es; cdev_t dev; struct partinfo dpart; int error, i; diff --git a/sys/gnu/vfs/ext2fs/i386-bitops.h b/sys/gnu/vfs/ext2fs/i386-bitops.h index 81b65699b2..a6e6350191 100644 --- a/sys/gnu/vfs/ext2fs/i386-bitops.h +++ b/sys/gnu/vfs/ext2fs/i386-bitops.h @@ -108,7 +108,7 @@ find_first_zero_bit(void *addr, unsigned size) static __inline__ int find_next_zero_bit(void *addr, int size, int offset) { - unsigned long * p = ((unsigned long *) addr) + (offset >> 5); + unsigned long *p = ((unsigned long *) addr) + (offset >> 5); int set = 0, bit = offset & 31, res; if (bit) { -- 2.41.0