Rename tmpfs_mount member allnode_lock to include namespace prefix.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-01-19 16:01:36 +00:00
parent 4960d0d453
commit 280ffa5ed7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312414
2 changed files with 8 additions and 7 deletions

View File

@ -150,7 +150,7 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent);
* (vi) vnode lock in exclusive mode, or vnode lock in shared vnode and
* tn_interlock
* (i) tn_interlock
* (m) tmpfs_mount allnode_lock
* (m) tmpfs_mount tm_allnode_lock
* (c) stable after creation
*/
struct tmpfs_node {
@ -370,7 +370,7 @@ struct tmpfs_mount {
struct tmpfs_node_list tm_nodes_used;
/* All node lock to protect the node list and tmp_pages_used. */
struct mtx allnode_lock;
struct mtx tm_allnode_lock;
/* Zones used to store file system meta data, per tmpfs mount. */
uma_zone_t tm_dirent_pool;
@ -379,8 +379,9 @@ struct tmpfs_mount {
/* Read-only status. */
int tm_ronly;
};
#define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock)
#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock)
#define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock)
#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock)
#define TMPFS_MP_ASSERT_LOCKED(tm) mtx_assert(&(tm)->tm_allnode_lock, MA_OWNED)
/*
* This structure maps a file identifier to a tmpfs node. Used by the

View File

@ -219,7 +219,7 @@ tmpfs_mount(struct mount *mp)
tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount),
M_TMPFSMNT, M_WAITOK | M_ZERO);
mtx_init(&tmp->allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
tmp->tm_nodes_max = nodes_max;
tmp->tm_nodes_inuse = 0;
tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX;
@ -227,7 +227,7 @@ tmpfs_mount(struct mount *mp)
tmp->tm_pages_max = pages;
tmp->tm_pages_used = 0;
tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->allnode_lock);
tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock);
tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent",
sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, 0);
@ -316,7 +316,7 @@ tmpfs_unmount(struct mount *mp, int mntflags)
uma_zdestroy(tmp->tm_node_pool);
delete_unrhdr(tmp->tm_ino_unr);
mtx_destroy(&tmp->allnode_lock);
mtx_destroy(&tmp->tm_allnode_lock);
MPASS(tmp->tm_pages_used == 0);
MPASS(tmp->tm_nodes_inuse == 0);