diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 221f3bf157fe..9677a236cc73 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -550,7 +550,7 @@ ffs_reallocblks(ap) return (ffs_reallocblks_ufs1(ap)); return (ffs_reallocblks_ufs2(ap)); } - + static int ffs_reallocblks_ufs1(ap) struct vop_reallocblks_args /* { @@ -3243,7 +3243,6 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) filetype = IFREG; switch (oidp->oid_number) { - case FFS_SET_FLAGS: #ifdef DIAGNOSTIC if (fsckcmds) @@ -3511,7 +3510,6 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DIAGNOSTIC */ error = EINVAL; break; - } fdrop(fp, td); vn_finished_write(mp); diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index ba14fb81e7ed..be0fadde312c 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -615,7 +615,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size, if (DOINGSOFTDEP(vp)) softdep_prealloc(vp, MNT_WAIT); - + /* * Check for allocating external data. */ diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index cc148c0ff042..d047dd962d4b 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -202,7 +202,6 @@ void softdep_buf_append(struct buf *, struct workhead *); void softdep_inode_append(struct inode *, struct ucred *, struct workhead *); void softdep_freework(struct workhead *); - /* * Things to request flushing in softdep_request_cleanup() */ diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 93836a222e5b..62b6b35be6ce 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -517,7 +517,7 @@ ffs_truncate(vp, length, flags, cred) } UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_UPDATE); allerror = ffs_update(vp, waitforupdate); - + /* * Having written the new inode to disk, save its new configuration * and put back the old block pointers long enough to process them. @@ -795,4 +795,3 @@ ffs_rdonly(struct inode *ip) return (ITOFS(ip)->fs_ronly != 0); } - diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index bfd51f6cd86e..6154e95995eb 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -183,7 +183,6 @@ ffs_rawread_sync(struct vnode *vp) return 0; } - static int ffs_rawread_readahead(struct vnode *vp, caddr_t udata, @@ -201,9 +200,9 @@ ffs_rawread_readahead(struct vnode *vp, int bforwards; struct inode *ip; ufs2_daddr_t blkno; - + bsize = vp->v_mount->mnt_stat.f_iosize; - + ip = VTOI(vp); dp = ITODEVVP(ip); @@ -223,14 +222,13 @@ ffs_rawread_readahead(struct vnode *vp, if ((daddr_t) blockno != blockno) { return EINVAL; /* blockno overflow */ } - + bp->b_lblkno = bp->b_blkno = blockno; - + error = ufs_bmaparray(vp, bp->b_lblkno, &blkno, NULL, &bforwards, NULL); if (error != 0) return error; if (blkno == -1) { - /* Fill holes with NULs to preserve semantics */ if (bp->b_bcount + blockoff * DEV_BSIZE > bsize) @@ -251,19 +249,18 @@ ffs_rawread_readahead(struct vnode *vp, } bp->b_blkno = blkno + blockoff; bp->b_offset = bp->b_iooffset = (blkno + blockoff) * DEV_BSIZE; - + if (bp->b_bcount + blockoff * DEV_BSIZE > bsize * (1 + bforwards)) bp->b_bcount = bsize * (1 + bforwards) - blockoff * DEV_BSIZE; bp->b_bufsize = bp->b_bcount; - + if (vmapbuf(bp, 1) < 0) return EFAULT; - + BO_STRATEGY(&dp->v_bufobj, bp); return 0; } - static int ffs_rawread_main(struct vnode *vp, struct uio *uio) @@ -275,7 +272,7 @@ ffs_rawread_main(struct vnode *vp, long resid; off_t offset; struct thread *td; - + td = uio->uio_td ? uio->uio_td : curthread; udata = uio->uio_iov->iov_base; resid = uio->uio_resid; @@ -285,13 +282,13 @@ ffs_rawread_main(struct vnode *vp, * keep the process from being swapped */ PHOLD(td->td_proc); - + error = 0; nerror = 0; - + bp = NULL; nbp = NULL; - + while (resid > 0) { if (bp == NULL) { /* Setup first read */ @@ -391,7 +388,7 @@ ffs_rawread_main(struct vnode *vp, break; } } - + if (bp != NULL) { pbrelvp(bp); uma_zfree(ffsraw_pbuf_zone, bp); @@ -402,7 +399,7 @@ ffs_rawread_main(struct vnode *vp, pbrelvp(nbp); uma_zfree(ffsraw_pbuf_zone, nbp); } - + if (error == 0) error = nerror; PRELE(td->td_proc); @@ -412,7 +409,6 @@ ffs_rawread_main(struct vnode *vp, return error; } - int ffs_rawread(struct vnode *vp, struct uio *uio, diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 768604f03001..fd0a3197008f 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -181,7 +181,7 @@ softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) long oldsize; struct buf *bp; { - + panic("softdep_setup_allocdirect called"); } @@ -195,7 +195,7 @@ softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) long oldsize; struct buf *bp; { - + panic("softdep_setup_allocext called"); } @@ -232,7 +232,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) off_t length; int flags; { - + panic("softdep_journal_freeblocks called"); } @@ -250,7 +250,7 @@ softdep_setup_freeblocks(ip, length, flags) off_t length; int flags; { - + panic("softdep_setup_freeblocks called"); } @@ -297,7 +297,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir) struct inode *ip; int isrmdir; { - + panic("softdep_setup_remove called"); } @@ -540,7 +540,7 @@ softdep_check_suspend(struct mount *mp, { struct bufobj *bo; int error; - + (void) softdep_depcnt, (void) softdep_accdepcnt; @@ -2425,7 +2425,7 @@ indirblk_insert(freework) jseg = TAILQ_LAST(&jblocks->jb_segs, jseglst); if (jseg == NULL) return; - + LIST_INSERT_HEAD(&jseg->js_indirs, freework, fw_segs); TAILQ_INSERT_HEAD(INDIR_HASH(ump, freework->fw_blkno), freework, fw_next); @@ -5163,7 +5163,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno, frags, oldfrags) uint8_t *blksfree; long bno; int i; - + cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); bno = dtogd(fs, jnewblk->jn_blkno); @@ -6325,7 +6325,6 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno) int error; int off; - freework = NULL; if (blkno == 0) return (0); @@ -7463,7 +7462,6 @@ cancel_allocdirect(adphead, adp, freeblks) WORKLIST_INSERT(&freeblks->fb_freeworkhd, &newblk->nb_list); } - /* * Cancel a new block allocation. May be an indirect or direct block. We * remove it from various lists and return any journal record that needs to @@ -9211,7 +9209,6 @@ dirrem_journal(dirrem, jremref, dotremref, dotdotremref) { struct inodedep *inodedep; - if (inodedep_lookup(jremref->jr_list.wk_mp, jremref->jr_ref.if_ino, 0, &inodedep) == 0) panic("dirrem_journal: Lost inodedep"); @@ -10058,7 +10055,6 @@ handle_workitem_freefile(freefile) FREE_LOCK(ump); } - /* * Helper function which unlinks marker element from work list and returns * the next element on the list. @@ -10067,7 +10063,7 @@ static __inline struct worklist * markernext(struct worklist *marker) { struct worklist *next; - + next = LIST_NEXT(marker, wk_list); LIST_REMOVE(marker, wk_list); return next; @@ -10132,7 +10128,6 @@ softdep_disk_io_initiation(bp) wk = markernext(&marker)) { LIST_INSERT_AFTER(wk, &marker, wk_list); switch (wk->wk_type) { - case D_PAGEDEP: initiate_write_filepage(WK_PAGEDEP(wk), bp); continue; @@ -11172,7 +11167,6 @@ softdep_disk_write_complete(bp) if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { - case D_PAGEDEP: handle_written_filepage(WK_PAGEDEP(wk), bp, 0); continue; @@ -11214,7 +11208,6 @@ softdep_disk_write_complete(bp) panic("duplicate worklist: %p\n", wk); owk = wk; switch (wk->wk_type) { - case D_PAGEDEP: if (handle_written_filepage(WK_PAGEDEP(wk), bp, WRITESUCCEEDED)) @@ -12890,7 +12883,6 @@ softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor) top: LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { - case D_ALLOCDIRECT: case D_ALLOCINDIR: newblk = WK_NEWBLK(wk); @@ -13786,7 +13778,6 @@ request_cleanup(mp, resource) * the cleanup for us. */ switch (resource) { - case FLUSH_INODES: case FLUSH_INODES_WAIT: ACQUIRE_GBLLOCK(&lk); @@ -14192,7 +14183,6 @@ softdep_count_dependencies(bp, wantcount) ACQUIRE_LOCK(ump); LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { - case D_INODEDEP: inodedep = WK_INODEDEP(wk); if ((inodedep->id_state & DEPCOMPLETE) == 0) { @@ -14250,7 +14240,6 @@ softdep_count_dependencies(bp, wantcount) } } for (i = 0; i < DAHASHSZ; i++) { - LIST_FOREACH(dap, &pagedep->pd_diraddhd[i], da_pdlist) { /* directory entry dependency */ retval += 1; @@ -14388,7 +14377,6 @@ getdirtybuf(bp, lock, waitfor) return (bp); } - /* * Check if it is safe to suspend the file system now. On entry, * the vnode interlock for devvp should be held. Return 0 with @@ -14502,7 +14490,6 @@ softdep_check_suspend(struct mount *mp, return (error); } - /* * Get the number of dependency structures for the file system, both * the current number and the total number allocated. These will diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 74001f52a213..5209cb832b97 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -471,7 +471,7 @@ ffs_isblock(struct fs *fs, unsigned char *cp, ufs1_daddr_t h) int ffs_isfreeblock(struct fs *fs, u_char *cp, ufs1_daddr_t h) { - + switch ((int)fs->fs_frag) { case 8: return (cp[h] == 0); @@ -526,7 +526,6 @@ ffs_setblock(struct fs *fs, unsigned char *cp, ufs1_daddr_t h) { switch ((int)fs->fs_frag) { - case 8: cp[h] = 0xff; return; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index ae6e9fa907d3..5718eabf1c80 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -873,7 +873,7 @@ ffs_reload(struct mount *mp, struct thread *td, int flags) return (EINVAL); } MNT_IUNLOCK(mp); - + /* * Step 1: invalidate all cached meta-data. */ @@ -2419,7 +2419,6 @@ ffs_backgroundwritedone(struct buf *bp) BO_UNLOCK(bufobj); } - /* * Write, release buffer on completion. (Done by iodone * if async). Do not bother writing anything if the buffer @@ -2533,7 +2532,6 @@ ffs_bufwrite(struct buf *bp) /* Mark the buffer clean */ bundirty(bp); - /* Let the normal bufwrite do the rest for us */ normal_write: /* @@ -2546,7 +2544,6 @@ ffs_bufwrite(struct buf *bp) return (bufwrite(bp)); } - static void ffs_geom_strategy(struct bufobj *bo, struct buf *bp) { diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 6e3cdfeb7d7d..758df8da49f2 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1182,7 +1182,6 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred) return (error); } - /* * Vnode operating to retrieve a named extended attribute. * @@ -1411,7 +1410,6 @@ struct vop_openextattr_args { return (ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td)); } - /* * Vnode extattr transaction commit/abort */ @@ -1473,7 +1471,6 @@ vop_deleteextattr { error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { - /* * ffs_lock_ea is not needed there, because the vnode * must be exclusively locked. @@ -1675,7 +1672,6 @@ vop_setextattr { error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { - /* * ffs_lock_ea is not needed there, because the vnode * must be exclusively locked. @@ -1836,4 +1832,3 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) return (error); } - diff --git a/sys/ufs/ufs/dirhash.h b/sys/ufs/ufs/dirhash.h index 693cb662d859..d38c1112ff5c 100644 --- a/sys/ufs/ufs/dirhash.h +++ b/sys/ufs/ufs/dirhash.h @@ -112,7 +112,6 @@ struct dirhash { TAILQ_ENTRY(dirhash) dh_list; /* chain of all dirhashes */ }; - /* * Dirhash functions. */ diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 15f60caae1f7..70f7ab5facf7 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -87,7 +87,6 @@ struct inode { u_int32_t i_flag; /* flags, see below */ int i_effnlink; /* i_nlink when I/O completes */ - /* * Side effects; used during directory lookup. */ diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c index 68e8ef91534e..c05fade2d645 100644 --- a/sys/ufs/ufs/ufs_acl.c +++ b/sys/ufs/ufs/ufs_acl.c @@ -87,7 +87,7 @@ ufs_sync_acl_from_inode(struct inode *ip, struct acl *acl) ACL_USER_OBJ, ip->i_mode); acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; break; - + case ACL_GROUP_OBJ: acl_group_obj = &acl->acl_entry[i]; acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID; @@ -107,7 +107,7 @@ ufs_sync_acl_from_inode(struct inode *ip, struct acl *acl) case ACL_USER: case ACL_GROUP: break; - + default: panic("ufs_sync_acl_from_inode(): bad ae_tag"); } diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index d9d6425f4626..b60c93fb9105 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -185,7 +185,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) *runb = 0; } - ap = a; nump = # error = ufs_getlbns(vp, bn, ap, nump); @@ -243,7 +242,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) return (0); } - /* Get disk address out of indirect block array */ daddr = DIP(ip, i_ib[ap->in_off]); diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 49f5d53f797d..13094b5a1c97 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -94,7 +94,6 @@ SYSCTL_PROC(_vfs_ufs, OID_AUTO, dirhash_reclaimpercent, 0, 0, ufsdirhash_set_reclaimpercent, "I", "set percentage of dirhash cache to be removed in low VM events"); - static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); static void ufsdirhash_adjfree(struct dirhash *dh, doff_t offset, int diff); static void ufsdirhash_delslot(struct dirhash *dh, int slot); @@ -813,7 +812,7 @@ ufsdirhash_add(struct inode *ip, struct direct *dirp, doff_t offset) if ((dh = ufsdirhash_acquire(ip)) == NULL) return; - + KASSERT(offset < dh->dh_dirblks * DIRBLKSIZ, ("ufsdirhash_add: bad offset")); /* @@ -1187,7 +1186,7 @@ ufsdirhash_destroy(struct dirhash *dh) int i, mem, narrays; KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); - + /* Remove it from the list and detach its memory. */ TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); dh->dh_onlist = 0; diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 2677d2fa2afb..ae4c2c0a65ad 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -441,7 +441,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, } } free(dirbuf, M_TEMP); - + return (0); } @@ -623,7 +623,7 @@ ufs_extattr_enable(struct ufsmount *ump, int attrnamespace, attribute->uele_attrnamespace = attrnamespace; bzero(&attribute->uele_fileheader, sizeof(struct ufs_extattr_fileheader)); - + attribute->uele_backing_vnode = backing_vnode; auio.uio_iov = &aiov; @@ -901,7 +901,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, local_aio.uio_td = td; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); - + /* * Acquire locks. * @@ -1003,7 +1003,6 @@ vop_deleteextattr { error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace, ap->a_name, ap->a_cred, ap->a_td); - ufs_extattr_uepm_unlock(ump); return (error); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index f39f50cc9a61..80a98ee1c83d 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -108,7 +108,6 @@ ufs_quotactl(mp, cmds, id, arg) type = cmds & SUBCMDMASK; if (id == -1) { switch (type) { - case USRQUOTA: id = td->td_ucred->cr_ruid; break; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index fec8ce1cc3a2..6d38f509ed39 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1741,7 +1741,7 @@ ufs_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp, DIP_SET(ip, i_mode, dmode); error = 0; goto out; - + default: goto out; } @@ -2108,7 +2108,7 @@ ufs_mkdir(ap) goto bad; ufs_makedirentry(ip, cnp, &newdir); error = ufs_direnter(dvp, tvp, &newdir, cnp, bp, 0); - + bad: if (error == 0) { *ap->a_vpp = tvp;