summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_subr.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-07-11 14:26:27 +0000
committerdelphij <delphij@FreeBSD.org>2007-07-11 14:26:27 +0000
commitff9bf4b792638d7157d3edd6df71e2a8c02e5ba6 (patch)
tree7846bc16fbfcca0ddb40e6528c2589212c9f1c56 /sys/fs/tmpfs/tmpfs_subr.c
parenta0e02f86c06ab807051f8c40db4f3045d0dac429 (diff)
downloadFreeBSD-src-ff9bf4b792638d7157d3edd6df71e2a8c02e5ba6.zip
FreeBSD-src-ff9bf4b792638d7157d3edd6df71e2a8c02e5ba6.tar.gz
MFp4: Make use of the kernel unit number allocation facility
for tmpfs nodes. Submitted by: Mingyan Guo <guomingyan gmail com> Approved by: re (tmpfs blanket)
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_subr.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index b9a706d..24c0dc9 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -114,6 +114,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp, enum vtype type,
nnode->tn_uid = uid;
nnode->tn_gid = gid;
nnode->tn_mode = mode;
+ nnode->tn_id = alloc_unr(tmp->tm_ino_unr);
/* Type-specific initialization. */
switch (nnode->tn_type) {
@@ -225,6 +226,7 @@ tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node)
break;
}
+ free_unr(tmp->tm_ino_unr, node->tn_id);
uma_zfree(tmp->tm_node_pool, node);
TMPFS_LOCK(tmp);
OpenPOWER on IntegriCloud