Skip to content

Commit

Permalink
tmpfs: Fix styles
Browse files Browse the repository at this point in the history
A lot of return statements were in the wrong style before this commit.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c12118f)
  • Loading branch information
khng300 committed Aug 27, 2021
1 parent e899971 commit e678b3e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions sys/fs/tmpfs/tmpfs_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ tmpfs_alloc_dirent(struct tmpfs_mount *tmp, struct tmpfs_node *node,

*de = nde;

return 0;
return (0);
}

/*
Expand Down Expand Up @@ -1861,11 +1861,11 @@ tmpfs_chmod(struct vnode *vp, mode_t mode, struct ucred *cred, struct thread *p)

/* Disallow this operation if the file system is mounted read-only. */
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return EROFS;
return (EROFS);

/* Immutable or append-only files cannot be modified, either. */
if (node->tn_flags & (IMMUTABLE | APPEND))
return EPERM;
return (EPERM);

/*
* To modify the permissions on a file, must possess VADMIN
Expand Down
4 changes: 2 additions & 2 deletions sys/fs/tmpfs/tmpfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ tmpfs_mount(struct mount *mp)
vfs_getnewfsid(mp);
vfs_mountedfrom(mp, "tmpfs");

return 0;
return (0);
}

/* ARGSUSED2 */
Expand Down Expand Up @@ -644,7 +644,7 @@ tmpfs_statfs(struct mount *mp, struct statfs *sbp)
sbp->f_ffree = sbp->f_files - used;
/* sbp->f_owner = tmp->tn_uid; */

return 0;
return (0);
}

static int
Expand Down
26 changes: 13 additions & 13 deletions sys/fs/tmpfs/tmpfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ tmpfs_mknod(struct vop_mknod_args *v)

if (vap->va_type != VBLK && vap->va_type != VCHR &&
vap->va_type != VFIFO)
return EINVAL;
return (EINVAL);

return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL);
return (tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL));
}

struct fileops tmpfs_fnops;
Expand Down Expand Up @@ -517,7 +517,7 @@ tmpfs_getattr(struct vop_getattr_args *v)
vap->va_bytes = node->tn_size;
vap->va_filerev = 0;

return 0;
return (0);
}

int
Expand Down Expand Up @@ -575,7 +575,7 @@ tmpfs_setattr(struct vop_setattr_args *v)

MPASS(VOP_ISLOCKED(vp));

return error;
return (error);
}

static int
Expand Down Expand Up @@ -705,7 +705,7 @@ tmpfs_fsync(struct vop_fsync_args *v)
tmpfs_check_mtime(vp);
tmpfs_update(vp);

return 0;
return (0);
}

static int
Expand Down Expand Up @@ -808,7 +808,7 @@ tmpfs_link(struct vop_link_args *v)
error = 0;

out:
return error;
return (0);
}

/*
Expand Down Expand Up @@ -1264,7 +1264,7 @@ tmpfs_mkdir(struct vop_mkdir_args *v)

MPASS(vap->va_type == VDIR);

return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL);
return (tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL));
}

static int
Expand Down Expand Up @@ -1355,7 +1355,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v)
error = 0;

out:
return error;
return (error);
}

static int
Expand All @@ -1373,7 +1373,7 @@ tmpfs_symlink(struct vop_symlink_args *v)
vap->va_type = VLNK;
#endif

return tmpfs_alloc_file(dvp, vpp, vap, cnp, target);
return (tmpfs_alloc_file(dvp, vpp, vap, cnp, target));
}

static int
Expand All @@ -1396,7 +1396,7 @@ tmpfs_readdir(struct vop_readdir_args *va)

/* This operation only makes sense on directory nodes. */
if (vp->v_type != VDIR)
return ENOTDIR;
return (ENOTDIR);

maxcookies = 0;
node = VP_TO_TMPFS_DIR(vp);
Expand Down Expand Up @@ -1433,7 +1433,7 @@ tmpfs_readdir(struct vop_readdir_args *va)
*eofflag =
(error == 0 && uio->uio_offset == TMPFS_DIRCOOKIE_EOF);

return error;
return (error);
}

static int
Expand Down Expand Up @@ -1580,7 +1580,7 @@ tmpfs_print(struct vop_print_args *v)

printf("\n");

return 0;
return (0);
}

int
Expand Down Expand Up @@ -1634,7 +1634,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v)
error = vop_stdpathconf(v);
}

return error;
return (error);
}

static int
Expand Down

0 comments on commit e678b3e

Please sign in to comment.