diff options
author | jsg <jsg@openbsd.org> | 2018-09-06 11:50:53 +0000 |
---|---|---|
committer | jsg <jsg@openbsd.org> | 2018-09-06 11:50:53 +0000 |
commit | c7617a357ac4aa3b319e70526e3f3c1c7a8fe30f (patch) | |
tree | af3de981d8fdd2678917eccdfa70ade7d00bc31e /sys/ufs | |
parent | Implement 64-bit DMA support in sdhc(4). (diff) | |
download | wireguard-openbsd-c7617a357ac4aa3b319e70526e3f3c1c7a8fe30f.tar.xz wireguard-openbsd-c7617a357ac4aa3b319e70526e3f3c1c7a8fe30f.zip |
fix whitespace
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vnops.c | 30 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_lookup.c | 126 |
2 files changed, 78 insertions, 78 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index ba9d53f3fd3..f91f6a792b2 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vnops.c,v 1.84 2018/06/21 14:17:23 visa Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.85 2018/09/06 11:50:54 jsg Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -594,15 +594,15 @@ abortit: goto abortit; } if ((ip->i_e2fs_mode & IFMT) == IFDIR) { - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); - if (!error && tvp) - error = VOP_ACCESS(tvp, VWRITE, tcnp->cn_cred, + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); + if (!error && tvp) + error = VOP_ACCESS(tvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); - if (error) { - VOP_UNLOCK(fvp); - error = EACCES; - goto abortit; - } + if (error) { + VOP_UNLOCK(fvp); + error = EACCES; + goto abortit; + } /* * Avoid ".", "..", and aliases of "." for obvious reasons. */ @@ -758,7 +758,7 @@ abortit: * decrement the link count on the parent * of the target directory. */ - if (doingdirectory && !newparent) { + if (doingdirectory && !newparent) { dp->i_e2fs_nlink--; dp->i_flag |= IN_CHANGE; } @@ -966,11 +966,11 @@ ext2fs_mkdir(void *v) panic("ext2fs_mkdir: blksize"); /* XXX should grow with balloc() */ else { error = ext2fs_setsize(ip, VTOI(dvp)->i_e2fs->e2fs_bsize); - if (error) { - dp->i_e2fs_nlink--; - dp->i_flag |= IN_CHANGE; - goto bad; - } + if (error) { + dp->i_e2fs_nlink--; + dp->i_flag |= IN_CHANGE; + goto bad; + } ip->i_flag |= IN_CHANGE; } diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 8d8e0caf939..448edb5a3f2 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_lookup.c,v 1.52 2018/05/02 02:24:56 visa Exp $ */ +/* $OpenBSD: ufs_lookup.c,v 1.53 2018/09/06 11:50:54 jsg Exp $ */ /* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */ /* @@ -696,20 +696,20 @@ int ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, struct componentname *cnp, struct buf *newdirbp) { - struct ucred *cr; - struct proc *p; - int newentrysize; - struct inode *dp; - struct buf *bp; - u_int dsize; - struct direct *ep, *nep; + struct ucred *cr; + struct proc *p; + int newentrysize; + struct inode *dp; + struct buf *bp; + u_int dsize; + struct direct *ep, *nep; int error, ret, blkoff, loc, spacefree, flags; - char *dirbuf; + char *dirbuf; - error = 0; - cr = cnp->cn_cred; - p = cnp->cn_proc; - dp = VTOI(dvp); + error = 0; + cr = cnp->cn_cred; + p = cnp->cn_proc; + dp = VTOI(dvp); newentrysize = DIRSIZ(OFSFMT(dp), dirp); if (dp->i_count == 0) { @@ -717,9 +717,9 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, * If dp->i_count is 0, then namei could find no * space in the directory. Here, dp->i_offset will * be on a directory block boundary and we will write the - * new entry into a fresh block. - */ - if (dp->i_offset & (DIRBLKSIZ - 1)) + * new entry into a fresh block. + */ + if (dp->i_offset & (DIRBLKSIZ - 1)) panic("ufs_direnter: newblk"); flags = B_CLRBUF; if (!DOINGSOFTDEP(dvp)) @@ -733,7 +733,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, DIP_ASSIGN(dp, size, dp->i_offset + DIRBLKSIZ); dp->i_flag |= IN_CHANGE | IN_UPDATE; uvm_vnp_setsize(dvp, DIP(dp, size)); - dirp->d_reclen = DIRBLKSIZ; + dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); memcpy(bp->b_data + blkoff, dirp, newentrysize); @@ -785,22 +785,22 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, return (error); } error = VOP_BWRITE(bp); - ret = UFS_UPDATE(dp, !DOINGSOFTDEP(dvp)); - if (error == 0) - return (ret); - return (error); - } - - /* + ret = UFS_UPDATE(dp, !DOINGSOFTDEP(dvp)); + if (error == 0) + return (ret); + return (error); + } + + /* * If dp->i_count is non-zero, then namei found space for the new * entry in the range dp->i_offset to dp->i_offset + dp->i_count * in the directory. To use this space, we may have to compact * the entries located there, by copying them together towards the * beginning of the block, leaving the free space in one usable * chunk at the end. - */ - - /* + */ + + /* * Increase size of directory if entry eats into new space. * This should never push the size past a new multiple of * DIRBLKSIZE. @@ -812,12 +812,12 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, /* * Get the block containing the space for the new directory entry. */ - if ((error = UFS_BUFATOFF(dp, (off_t)dp->i_offset, &dirbuf, &bp)) + if ((error = UFS_BUFATOFF(dp, (off_t)dp->i_offset, &dirbuf, &bp)) != 0) { - if (DOINGSOFTDEP(dvp) && newdirbp != NULL) - bdwrite(newdirbp); - return (error); - } + if (DOINGSOFTDEP(dvp) && newdirbp != NULL) + bdwrite(newdirbp); + return (error); + } /* * Find space for the new entry. In the simple case, the entry at * offset base will have the space. If it does not, then namei @@ -858,11 +858,11 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, dp->i_offset + ((char *)nep - dirbuf), dp->i_offset + ((char *)ep - dirbuf)); #endif - if (DOINGSOFTDEP(dvp)) - softdep_change_directoryentry_offset(dp, dirbuf, - (caddr_t)nep, (caddr_t)ep, dsize); - else - memmove(ep, nep, dsize); + if (DOINGSOFTDEP(dvp)) + softdep_change_directoryentry_offset(dp, dirbuf, + (caddr_t)nep, (caddr_t)ep, dsize); + else + memmove(ep, nep, dsize); } /* * Here, `ep' points to a directory entry containing `dsize' in-use @@ -898,23 +898,23 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, dp->i_offset & ~(DIRBLKSIZ - 1)); #endif - if (DOINGSOFTDEP(dvp)) { - (void)softdep_setup_directory_add(bp, dp, - dp->i_offset + (caddr_t)ep - dirbuf, + if (DOINGSOFTDEP(dvp)) { + (void)softdep_setup_directory_add(bp, dp, + dp->i_offset + (caddr_t)ep - dirbuf, dirp->d_ino, newdirbp, 0); - bdwrite(bp); - } else { - error = VOP_BWRITE(bp); - } + bdwrite(bp); + } else { + error = VOP_BWRITE(bp); + } dp->i_flag |= IN_CHANGE | IN_UPDATE; - /* - * If all went well, and the directory can be shortened, proceed - * with the truncation. Note that we have to unlock the inode for - * the entry that we just entered, as the truncation may need to - * lock other inodes which can lead to deadlock if we also hold a - * lock on the newly entered node. - */ + /* + * If all went well, and the directory can be shortened, proceed + * with the truncation. Note that we have to unlock the inode for + * the entry that we just entered, as the truncation may need to + * lock other inodes which can lead to deadlock if we also hold a + * lock on the newly entered node. + */ if (error == 0 && dp->i_endoff && dp->i_endoff < DIP(dp, size)) { if (tvp != NULL) @@ -971,10 +971,10 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) */ ep->d_ino = 0; } else { - /* - * Collapse new free space into previous entry. - */ - ep->d_reclen += dp->i_reclen; + /* + * Collapse new free space into previous entry. + */ + ep->d_reclen += dp->i_reclen; } #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) @@ -982,7 +982,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) ((dp->i_offset - dp->i_count) & (DIRBLKSIZ - 1)), dp->i_offset & ~(DIRBLKSIZ - 1)); #endif - if (DOINGSOFTDEP(dvp)) { + if (DOINGSOFTDEP(dvp)) { if (ip) { ip->i_effnlink--; softdep_change_linkcnt(ip, 0); @@ -1029,13 +1029,13 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ufsino_t newinum, return (error); ep->d_ino = newinum; if (!OFSFMT(dp)) - ep->d_type = newtype; - oip->i_effnlink--; - if (DOINGSOFTDEP(vdp)) { + ep->d_type = newtype; + oip->i_effnlink--; + if (DOINGSOFTDEP(vdp)) { softdep_change_linkcnt(oip, 0); - softdep_setup_directory_change(bp, dp, oip, newinum, isrmdir); - bdwrite(bp); - } else { + softdep_setup_directory_change(bp, dp, oip, newinum, isrmdir); + bdwrite(bp); + } else { DIP_ADD(oip, nlink, -1); oip->i_flag |= IN_CHANGE; if (DOINGASYNC(vdp)) { @@ -1044,7 +1044,7 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ufsino_t newinum, } else { error = VOP_BWRITE(bp); } - } + } dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } |