From 4ec15b8dcf8038aeb15c7877c50d0fa500b468c6 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 26 Feb 2015 15:29:33 -0800 Subject: Use MUTEX_FSTRANS mutex type There are regions in the ZFS code where it is desirable to be able to be set PF_FSTRANS while a specific mutex is held. The ZFS code could be updated to set/clear this flag in all the correct places, but this is undesirable for a few reasons. 1) It would require changes to a significant amount of the ZFS code. This would complicate applying patches from upstream. 2) It would be easy to accidentally miss a critical region in the initial patch or to have an future change introduce a new one. Both of these concerns can be addressed by using a new mutex type which is responsible for managing PF_FSTRANS, support for which was added to the SPL in commit zfsonlinux/spl@9099312 - Merge branch 'kmem-rework'. Signed-off-by: Brian Behlendorf Signed-off-by: Tim Chase Closes #3050 Closes #3055 Closes #3062 Closes #3132 Closes #3142 Closes #2983 --- module/zfs/dbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/zfs/dbuf.c') diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 9be69b5ae..277e5439e 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -331,7 +331,7 @@ retry: 0, dbuf_cons, dbuf_dest, NULL, NULL, NULL, 0); for (i = 0; i < DBUF_MUTEXES; i++) - mutex_init(&h->hash_mutexes[i], NULL, MUTEX_DEFAULT, NULL); + mutex_init(&h->hash_mutexes[i], NULL, MUTEX_FSTRANS, NULL); dbuf_stats_init(h); } -- cgit v1.2.3