From: Matthew Dillon Date: Sat, 19 May 2012 19:07:40 +0000 (-0700) Subject: Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository... X-Git-Tag: v3.4.0rc~1092 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/0a2deabddae253c9b3e03b0a48cc068f2c9352b9?hp=90ea1e359ba3186ea419ac0476b1091979c858f0 Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2 --- diff --git a/sys/vfs/tmpfs/tmpfs.h b/sys/vfs/tmpfs/tmpfs.h index 609b1c18e9..7e8a7e68a9 100644 --- a/sys/vfs/tmpfs/tmpfs.h +++ b/sys/vfs/tmpfs/tmpfs.h @@ -398,6 +398,7 @@ struct tmpfs_mount { struct objcache *tm_dirent_pool; struct objcache *tm_node_pool; + int tm_ino; int tm_flags; struct netexport tm_export; diff --git a/sys/vfs/tmpfs/tmpfs_subr.c b/sys/vfs/tmpfs/tmpfs_subr.c index c5ae546e8b..14e70b90e5 100644 --- a/sys/vfs/tmpfs/tmpfs_subr.c +++ b/sys/vfs/tmpfs/tmpfs_subr.c @@ -54,9 +54,7 @@ #include #include -static ino_t t_ino = 2; -static struct spinlock ino_lock; -static ino_t tmpfs_fetch_ino(void); +static ino_t tmpfs_fetch_ino(struct tmpfs_mount *); /* --------------------------------------------------------------------- */ @@ -115,7 +113,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 = tmpfs_fetch_ino(); + nnode->tn_id = tmpfs_fetch_ino(tmp); nnode->tn_advlock.init_done = 0; /* Type-specific initialization. */ @@ -1340,13 +1338,11 @@ out: /* --------------------------------------------------------------------- */ static ino_t -tmpfs_fetch_ino(void) +tmpfs_fetch_ino(struct tmpfs_mount *tmp) { - ino_t ret; + ino_t ret; - spin_lock(&ino_lock); - ret = t_ino++; - spin_unlock(&ino_lock); + ret = tmp->tm_ino++; - return ret; + return (ret); } diff --git a/sys/vfs/tmpfs/tmpfs_vfsops.c b/sys/vfs/tmpfs/tmpfs_vfsops.c index f4ab2f4112..4aa5eb1eda 100644 --- a/sys/vfs/tmpfs/tmpfs_vfsops.c +++ b/sys/vfs/tmpfs/tmpfs_vfsops.c @@ -251,6 +251,8 @@ tmpfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) tmpfs_node_init, tmpfs_node_fini, &tmp->tm_node_zone_malloc_args); + tmp->tm_ino = 2; + /* Allocate the root node. */ error = tmpfs_alloc_node(tmp, VDIR, root_uid, root_gid, root_mode & ALLPERMS, NULL, NULL,