summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_vfsops.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-06-29 05:23:15 +0000
committerdelphij <delphij@FreeBSD.org>2007-06-29 05:23:15 +0000
commitf5523801a379fd60b10766884cebdfc21bf8db35 (patch)
tree9a995329467ed0aa6c8c5a4ae50ea68413fc2cf5 /sys/fs/tmpfs/tmpfs_vfsops.c
parent4f8f7b63aaea072afdf83c9faec421752039cbc6 (diff)
downloadFreeBSD-src-f5523801a379fd60b10766884cebdfc21bf8db35.zip
FreeBSD-src-f5523801a379fd60b10766884cebdfc21bf8db35.tar.gz
MFp4:
- Remove unnecessary NULL checks after M_WAITOK allocations. - Use VOP_ACCESS instead of hand-rolled suser_cred() calls. [1] - Use malloc(9) KPI to allocate memory for string. The optimization taken from NetBSD is not valid for FreeBSD because our malloc(9) already act that way. [2] Requested by: rwatson [1] Submitted by: Howard Su [2] Approved by: re (tmpfs blanket)
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vfsops.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 007661b..0546cbf 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$");
#define TMPFS_DEFAULT_ROOT_MODE (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
MALLOC_DEFINE(M_TMPFSMNT, "tmpfs mount", "tmpfs mount structures");
+MALLOC_DEFINE(M_TMPFSNAME, "tmpfs name", "tmpfs file names");
/* --------------------------------------------------------------------- */
@@ -276,8 +277,7 @@ tmpfs_mount(struct mount *mp, struct thread *l)
tmpfs_node_ctor, tmpfs_node_dtor,
tmpfs_node_init, tmpfs_node_fini,
UMA_ALIGN_PTR,
- 0);
- tmpfs_str_zone_create(&tmp->tm_str_pool);
+ UMA_ZONE_NOFREE);
/* Allocate the root node. */
error = tmpfs_alloc_node(tmp, VDIR, args.ta_root_uid,
@@ -285,7 +285,6 @@ tmpfs_mount(struct mount *mp, struct thread *l)
VNOVAL, l, &root);
if (error != 0 || root == NULL) {
- tmpfs_str_zone_destroy(&tmp->tm_str_pool);
uma_zdestroy(tmp->tm_node_pool);
uma_zdestroy(tmp->tm_dirent_pool);
free(tmp, M_TMPFSMNT);
@@ -358,7 +357,6 @@ tmpfs_unmount(struct mount *mp, int mntflags, struct thread *l)
uma_zdestroy(tmp->tm_dirent_pool);
uma_zdestroy(tmp->tm_node_pool);
- tmpfs_str_zone_destroy(&tmp->tm_str_pool);
mtx_destroy(&tmp->allnode_lock);
MPASS(tmp->tm_pages_used == 0);
OpenPOWER on IntegriCloud