Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ext2fs KNF, no functional changes...



details:   https://anonhg.NetBSD.org/src/rev/32e94e42f98c
branches:  trunk
changeset: 817228:32e94e42f98c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 13 07:40:10 2016 +0000

description:
KNF, no functional changes...

diffstat:

 sys/ufs/ext2fs/ext2fs_alloc.c     |  40 ++++++++--------
 sys/ufs/ext2fs/ext2fs_balloc.c    |  34 +++++++------
 sys/ufs/ext2fs/ext2fs_bmap.c      |  16 +++---
 sys/ufs/ext2fs/ext2fs_extents.c   |   6 +-
 sys/ufs/ext2fs/ext2fs_hash.c      |   6 +-
 sys/ufs/ext2fs/ext2fs_htree.c     |  12 ++--
 sys/ufs/ext2fs/ext2fs_inode.c     |  40 ++++++++--------
 sys/ufs/ext2fs/ext2fs_lookup.c    |  78 +++++++++++++++---------------
 sys/ufs/ext2fs/ext2fs_readwrite.c |  22 ++++----
 sys/ufs/ext2fs/ext2fs_rename.c    |   6 +-
 sys/ufs/ext2fs/ext2fs_subr.c      |   8 +-
 sys/ufs/ext2fs/ext2fs_vfsops.c    |  68 +++++++++++++-------------
 sys/ufs/ext2fs/ext2fs_vnops.c     |  96 +++++++++++++++++++-------------------
 sys/ufs/ext2fs/ext2fs_xattr.c     |  44 ++++++++--------
 14 files changed, 239 insertions(+), 237 deletions(-)

diffs (truncated from 1879 to 300 lines):

diff -r c0cf7fecbc57 -r 32e94e42f98c sys/ufs/ext2fs/ext2fs_alloc.c
--- a/sys/ufs/ext2fs/ext2fs_alloc.c     Sat Aug 13 07:25:29 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs_alloc.c     Sat Aug 13 07:40:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_alloc.c,v 1.47 2016/08/03 21:53:02 jdolecek Exp $       */
+/*     $NetBSD: ext2fs_alloc.c,v 1.48 2016/08/13 07:40:10 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.47 2016/08/03 21:53:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.48 2016/08/13 07:40:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,12 +138,12 @@
                ext2fs_setnblock(ip, ext2fs_nblock(ip) + btodb(fs->e2fs_bsize));
                ip->i_flag |= IN_CHANGE | IN_UPDATE;
                *bnp = bno;
-               return (0);
+               return 0;
        }
 nospace:
        ext2fs_fserr(fs, kauth_cred_geteuid(cred), "file system full");
        uprintf("\n%s: write failed, file system is full\n", fs->e2fs_fsmnt);
-       return (ENOSPC);
+       return ENOSPC;
 }
 
 /*
@@ -188,7 +188,7 @@
        error = VFS_VGET(pvp->v_mount, ino, vpp);
        if (error) {
                ext2fs_vfree(pvp, ino, mode);
-               return (error);
+               return error;
        }
        ip = VTOI(*vpp);
        if (ip->i_e2fs_mode && ip->i_e2fs_nlink != 0) {
@@ -206,11 +206,11 @@
        if (++ext2gennumber < time_second)
                ext2gennumber = time_second;
        ip->i_e2fs_gen = ext2gennumber;
-       return (0);
+       return 0;
 noinodes:
        ext2fs_fserr(fs, kauth_cred_geteuid(cred), "out of inodes");
        uprintf("\n%s: create/symlink failed, no inodes free\n", fs->e2fs_fsmnt);
-       return (ENOSPC);
+       return ENOSPC;
 }
 
 /*
@@ -307,7 +307,7 @@
         */
        result = (*allocator)(ip, cg, pref, size);
        if (result)
-               return (result);
+               return result;
        /*
         * 2: quadratic rehash
         */
@@ -317,7 +317,7 @@
                        cg -= fs->e2fs_ncg;
                result = (*allocator)(ip, cg, 0, size);
                if (result)
-                       return (result);
+                       return result;
        }
        /*
         * 3: brute force search
@@ -328,12 +328,12 @@
        for (i = 2; i < fs->e2fs_ncg; i++) {
                result = (*allocator)(ip, cg, 0, size);
                if (result)
-                       return (result);
+                       return result;
                cg++;
                if (cg == fs->e2fs_ncg)
                        cg = 0;
        }
-       return (0);
+       return 0;
 }
 
 /*
@@ -354,12 +354,12 @@
 
        fs = ip->i_e2fs;
        if (fs->e2fs_gd[cg].ext2bgd_nbfree == 0)
-               return (0);
+               return 0;
        error = bread(ip->i_devvp, EXT2_FSBTODB(fs,
                fs->e2fs_gd[cg].ext2bgd_b_bitmap),
                (int)fs->e2fs_bsize, B_MODIFY, &bp);
        if (error) {
-               return (0);
+               return 0;
        }
        bbp = (char *)bp->b_data;
 
@@ -401,7 +401,7 @@
 
        bno = ext2fs_mapsearch(fs, bbp, bpref);
        if (bno < 0)
-               return (0);
+               return 0;
 gotit:
 #ifdef DIAGNOSTIC
        if (isset(bbp, (daddr_t)bno)) {
@@ -415,7 +415,7 @@
        fs->e2fs_gd[cg].ext2bgd_nbfree--;
        fs->e2fs_fmod = 1;
        bdwrite(bp);
-       return (cg * fs->e2fs.e2fs_fpg + fs->e2fs.e2fs_first_dblock + bno);
+       return cg * fs->e2fs.e2fs_fpg + fs->e2fs.e2fs_first_dblock + bno;
 }
 
 /*
@@ -440,12 +440,12 @@
                ipref = 0;
        fs = ip->i_e2fs;
        if (fs->e2fs_gd[cg].ext2bgd_nifree == 0)
-               return (0);
+               return 0;
        error = bread(ip->i_devvp, EXT2_FSBTODB(fs,
                fs->e2fs_gd[cg].ext2bgd_i_bitmap),
                (int)fs->e2fs_bsize, B_MODIFY, &bp);
        if (error) {
-               return (0);
+               return 0;
        }
        ibp = (char *)bp->b_data;
        if (ipref) {
@@ -483,7 +483,7 @@
                fs->e2fs_gd[cg].ext2bgd_ndirs++;
        }
        bdwrite(bp);
-       return (cg * fs->e2fs.e2fs_ipg + ipref +1);
+       return cg * fs->e2fs.e2fs_ipg + ipref + 1;
 }
 
 /*
@@ -555,7 +555,7 @@
                EXT2_FSBTODB(fs, fs->e2fs_gd[cg].ext2bgd_i_bitmap),
                (int)fs->e2fs_bsize, B_MODIFY, &bp);
        if (error) {
-               return (0);
+               return 0;
        }
        ibp = (char *)bp->b_data;
        ino = (ino - 1) % fs->e2fs.e2fs_ipg;
@@ -574,7 +574,7 @@
        }
        fs->e2fs_fmod = 1;
        bdwrite(bp);
-       return (0);
+       return 0;
 }
 
 /*
diff -r c0cf7fecbc57 -r 32e94e42f98c sys/ufs/ext2fs/ext2fs_balloc.c
--- a/sys/ufs/ext2fs/ext2fs_balloc.c    Sat Aug 13 07:25:29 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs_balloc.c    Sat Aug 13 07:40:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_balloc.c,v 1.40 2015/03/28 19:24:04 maxv Exp $  */
+/*     $NetBSD: ext2fs_balloc.c,v 1.41 2016/08/13 07:40:10 christos Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.40 2015/03/28 19:24:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.41 2016/08/13 07:40:10 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_uvmhist.h"
@@ -106,13 +106,13 @@
        int unwindidx = -1;
        UVMHIST_FUNC("ext2fs_balloc"); UVMHIST_CALLED(ubchist);
 
-       UVMHIST_LOG(ubchist, "bn 0x%x", bn,0,0,0);
+       UVMHIST_LOG(ubchist, "bn 0x%x", bn, 0, 0, 0);
 
        if (bpp != NULL) {
                *bpp = NULL;
        }
        if (bn < 0)
-               return (EFBIG);
+               return EFBIG;
        fs = ip->i_e2fs;
        lbn = bn;
 
@@ -132,11 +132,11 @@
                                error = bread(vp, bn, fs->e2fs_bsize,
                                              B_MODIFY, &bp);
                                if (error) {
-                                       return (error);
+                                       return error;
                                }
                                *bpp = bp;
                        }
-                       return (0);
+                       return 0;
                }
 
                /*
@@ -147,7 +147,7 @@
                    ext2fs_blkpref(ip, bn, bn, &ip->i_e2fs_blocks[0]),
                    cred, &newb);
                if (error)
-                       return (error);
+                       return error;
                ip->i_e2fs_last_lblk = lbn;
                ip->i_e2fs_last_blk = newb;
                /* XXX ondisk32 */
@@ -160,17 +160,17 @@
                                clrbuf(bp);
                        *bpp = bp;
                }
-               return (0);
+               return 0;
        }
        /*
         * Determine the number of levels of indirection.
         */
        pref = 0;
        if ((error = ufs_getlbns(vp, bn, indirs, &num)) != 0)
-               return(error);
+               return error;
 #ifdef DIAGNOSTIC
        if (num < 1)
-               panic ("ext2fs_balloc: ufs_getlbns returned indirect block\n");
+               panic("%s: ufs_getlbns returned indirect block\n", __func__);
 #endif
        /*
         * Fetch the first indirect block allocating if necessary.
@@ -184,7 +184,7 @@
                pref = ext2fs_blkpref(ip, lbn, 0, (int32_t *)0);
                error = ext2fs_alloc(ip, lbn, pref, cred, &newb);
                if (error)
-                       return (error);
+                       return error;
                nb = newb;
                *allocblk++ = nb;
                ip->i_e2fs_last_blk = newb;
@@ -287,7 +287,7 @@
                                clrbuf(nbp);
                        *bpp = nbp;
                }
-               return (0);
+               return 0;
        }
        brelse(bp, 0);
        if (bpp != NULL) {
@@ -303,7 +303,7 @@
                }
                *bpp = nbp;
        }
-       return (0);
+       return 0;
 fail:
        /*
         * If we have failed part way through block allocation, we
@@ -322,7 +322,8 @@
                        r = bread(vp, indirs[unwindidx].in_lbn,
                            (int)fs->e2fs_bsize, B_MODIFY, &bp);
                        if (r) {
-                               panic("Could not unwind indirect block, error %d", r);
+                               panic("%s: Could not unwind indirect block, "
+                                   "error %d", __func__, r);
                        } else {
                                bap = (int32_t *)bp->b_data; /* XXX ondisk32 */
                                bap[indirs[unwindidx].in_off] = 0;
@@ -369,7 +370,7 @@
                error = ext2fs_balloc(ip, ext2_lblkno(fs, off), bsize, cred,
                    NULL, flags);
                if (error) {
-                       UVMHIST_LOG(ubchist, "error %d", error, 0,0,0);
+                       UVMHIST_LOG(ubchist, "error %d", error, 0, 0, 0);
                        return error;
                }
 
@@ -387,7 +388,8 @@
                                    (off + bsize) & 0xffffffff);
                        error = ext2fs_setsize(ip, off + bsize);
                        if (error) {
-                               UVMHIST_LOG(ubchist, "error %d", error, 0,0,0);
+                               UVMHIST_LOG(ubchist, "error %d",
+                                   error, 0, 0, 0);
                                return error;
                        }
                }
diff -r c0cf7fecbc57 -r 32e94e42f98c sys/ufs/ext2fs/ext2fs_bmap.c
--- a/sys/ufs/ext2fs/ext2fs_bmap.c      Sat Aug 13 07:25:29 2016 +0000



Home | Main Index | Thread Index | Old Index