diff options
author | kib <kib@FreeBSD.org> | 2014-08-03 03:27:54 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-08-03 03:27:54 +0000 |
commit | 17b754a0261fb1acd7f0974416bde5667c726f31 (patch) | |
tree | e40a48ea7e5645477aaebf277b2cb119f5320d8b /sys/sys/mount.h | |
parent | bbb1622644fb979f6001f31721adcb7f51785f4e (diff) | |
download | FreeBSD-src-17b754a0261fb1acd7f0974416bde5667c726f31.zip FreeBSD-src-17b754a0261fb1acd7f0974416bde5667c726f31.tar.gz |
Remove Giant acquisition from the mount and unmount pathes.
It could be claimed that two things were reasonable protected by
Giant. One is vfsconf list links, which is converted to the new
dedicated sx vfsconf_sx. Another is vfsconf.vfc_refcount, which is
now updated with atomics.
Note that vfc_refcount still has the same races now as it has under
the Giant, the unload of filesystem modules can happen while the
module is still in use.
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Diffstat (limited to 'sys/sys/mount.h')
-rw-r--r-- | sys/sys/mount.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ca7e55c..ca3bc43 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -39,6 +39,7 @@ #include <sys/lock.h> #include <sys/lockmgr.h> #include <sys/_mutex.h> +#include <sys/_sx.h> #endif /* @@ -889,6 +890,11 @@ void vfs_unmountall(void); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct mtx mountlist_mtx; extern struct nfs_public nfs_pub; +extern struct sx vfsconf_sx; +#define vfsconf_lock() sx_xlock(&vfsconf_sx) +#define vfsconf_unlock() sx_xunlock(&vfsconf_sx) +#define vfsconf_slock() sx_slock(&vfsconf_sx) +#define vfsconf_sunlock() sx_sunlock(&vfsconf_sx) /* * Declarations for these vfs default operations are located in |