qibfs: deal with the races around mount/umount/add/remove

Move the filesystem itself into a separate module, have it populated just
with the static part of the tree.  Have add_device() pin it and add the
per-device stuff and remove_device() do the opposite.

Separate module (pinned by ib_qib, since the latter uses exports from
it) will absorb the use count coming having the fs around for as long
as devices are owned by PCI driver; that will _not_ pin ib_qib down
and once it's removed all devices will be removed, killing the internal
references to the qibfs superblock.  If it's not mounted anywhere by
userland, that module (ib_qib_fs) can be removed immediately, otherwise
it'll stay around for as long as fs is mounted.  Said fs will contain
only the driver stats (unchanging at that point), so it won't depend
on ib_qib being there...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
6 files changed