Feature #5917


User-mode SMB server

Added by Gordon Ross about 7 years ago. Updated almost 7 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


Development of the SMB server kernel code can be accelerated
significantly by allowing the code to run in user space, where one
can use not only the usual dtrace and mdb tools, but also full
source-level debugging etc.

This work was developed at Nexenta in preparation for major work
in the SMB server to add SMB2 support and other modernization.
Architecturally, there are just three major parts of this work:

libfakekernel: This is an API "shim" simulating the interfaces
provided by the kernel, including mutexes, synchronization
objects, task queues, kernel sockets, etc. The implementaion
is based on code found in libzpool, but attemps to be a little
more generic. (We did not try to replace similar code in
libzpool, leaving that to a future project.)

libfksmbsrv: This is a big library containing all the SMB server
code built as a shared library. It depends on libfakekernel,
but not much else. There are some more kernel "shims" in
this library for VFS simulation that we felt were not general
enough to deserve to live in libfakekernel.

system header: We were faced with a choice between coping
many, many system headers into the new libraraies, or just
adding compatibility features to the existing ones. We chose
modifying the existing ones in hopes that would reduce the
likelihood that such copies might get out-of-sync with the
real headers. We found many places where there are
structure definitions and/or functions prototypes that we
needed to expose to one of the new libraries, but which
were hidden by an #ifdef _KERNEL section. For these
we added a new condition #ifdef _FAKE_KERNEL, and
used that to expose additional definitions for this special
compilation environment.

Actions #1

Updated by Gordon Ross about 7 years ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit b819cea2f73f98c5662230cc9affc8cc84f77fcf

commit  b819cea2f73f98c5662230cc9affc8cc84f77fcf
Author: Gordon Ross <>
Date:   2015-06-04T20:46:25.000Z

    5917 User-mode SMB server
    Authored by: Thomas Keiser <>
    Authored by: Albert Lee <>
    Reviewed by: Igor Kozhukhov <>
    Reviewed by: Richard Lowe <>
    Reviewed by: Albert Lee <>
    Approved by: Dan McDonald <>


Also available in: Atom PDF