summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_vfsops.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-01-26 10:47:05 +0000
committerkib <kib@FreeBSD.org>2017-01-26 10:47:05 +0000
commit3f90b1547836771aa45ee96fad8232424693907f (patch)
tree83b28cdbc071bda54532c9dc0d31eac8c6395471 /sys/fs/tmpfs/tmpfs_vfsops.c
parentb4deb9204a686a09dfb64ec9c21ccdc6e7366def (diff)
downloadFreeBSD-src-3f90b1547836771aa45ee96fad8232424693907f.zip
FreeBSD-src-3f90b1547836771aa45ee96fad8232424693907f.tar.gz
MFC r312409:
Style fixes and comment updates. MFC r312435: Remove mistakenly merged field.
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vfsops.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 869b6f1..b95a0ff 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -190,7 +190,7 @@ tmpfs_mount(struct mount *mp)
/* Do not allow mounts if we do not have enough memory to preserve
* the minimum reserved pages. */
if (tmpfs_mem_avail() < TMPFS_PAGES_MINRESERVED)
- return ENOSPC;
+ return (ENOSPC);
/* Get the maximum number of memory pages this file system is
* allowed to use, based on the maximum size the user passed in
@@ -229,27 +229,23 @@ tmpfs_mount(struct mount *mp)
tmp->tm_pages_used = 0;
tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->allnode_lock);
tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent",
- sizeof(struct tmpfs_dirent),
- NULL, NULL, NULL, NULL,
+ sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, 0);
tmp->tm_node_pool = uma_zcreate("TMPFS node",
- sizeof(struct tmpfs_node),
- tmpfs_node_ctor, tmpfs_node_dtor,
- tmpfs_node_init, tmpfs_node_fini,
- UMA_ALIGN_PTR, 0);
+ sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor,
+ tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0);
tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
/* Allocate the root node. */
- error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid,
- root_gid, root_mode & ALLPERMS, NULL, NULL,
- VNOVAL, &root);
+ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid,
+ root_mode & ALLPERMS, NULL, NULL, VNOVAL, &root);
if (error != 0 || root == NULL) {
- uma_zdestroy(tmp->tm_node_pool);
- uma_zdestroy(tmp->tm_dirent_pool);
- delete_unrhdr(tmp->tm_ino_unr);
- free(tmp, M_TMPFSMNT);
- return error;
+ uma_zdestroy(tmp->tm_node_pool);
+ uma_zdestroy(tmp->tm_dirent_pool);
+ delete_unrhdr(tmp->tm_ino_unr);
+ free(tmp, M_TMPFSMNT);
+ return (error);
}
KASSERT(root->tn_id == 2,
("tmpfs root with invalid ino: %ju", (uintmax_t)root->tn_id));
@@ -340,12 +336,11 @@ static int
tmpfs_root(struct mount *mp, int flags, struct vnode **vpp)
{
int error;
- error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp);
- if (!error)
+ error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp);
+ if (error == 0)
(*vpp)->v_vflag |= VV_ROOT;
-
- return error;
+ return (error);
}
static int
OpenPOWER on IntegriCloud