Correct typos in renaming example

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1373
Add smb_available() sanity checks

Do basic sanity checks in smb_available() to verify that the 'net'
command and the usershare directory exists.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1124
Man page updates for SMB

* Update manpage with more information about the ACL, guest access
  and that samba needs to be able to authenticate user(s).
* Add information that 'net' can be used to modify the share after
  ZFS sharing and that it will be undone with a 'zfs unshare'.
* Give an example on how to mount a SMB filesystem shared via ZFS.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1181
Issue #1170
build: resolve orthographic and other grammatical errors

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
build: use CPPFLAGS

-D and -I are preprocessor flags, so should preferably be in the
appropriate variable.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
gitignore: anchor entries at their respective directory

.ko is specific to module, .m4 to config, etc.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
build: do not call boilerplate ourself

Rationale see section 3.5 "Using `autoreconf' to Update `configure'
Scripts" of the autoconf manual.

http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/autoreconf-Invocation.html

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Automake 1.10.1 compat: AM_SILENT_RULES

Part of the automated testing involves building the source on Debian Lenny
which ships an ancient version of automake (1.10.1).  Historically, this
has caused a non-fatal warning about AM_SILENT_RULES not being defined.
But when the autogen.sh script was updated to use autoreconf the warning
became fatal.

  configure.ac:31: warning: macro `AM_SILENT_RULES' not found in library
  autoreconf: running: /usr/bin/autoconf --force
  configure.ac:34: error: possibly undefined macro: AM_SILENT_RULES
        If this token and others are legitimate, please use m4_pattern_allow.

To resolve this build issue the call to AM_SILENT_RULES has been wrapped
by m4_ifdef().  This prevents the macro from being expanded on platforms
where it's undefined.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Only require spl-devel-kmod = %{version}

Commit f6fb7651a0d05b357dc179cc4853263ce15da6ed introduced the idea
of working builds which work correctly.  However, because the zfs-kmod
depends on a specific 'spl-devel-kmod = {version}-%{release}' package
and the release component is unique the dependency is never satisfied.

This requires line was introduced to ensure the correct version of the
spl is always used.  In this context only the version number is required
so the release component has been dropped to satisfy the dependency.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Replace the ZFS_AC_META perl dependency with awk

The only remaining perl dependency is part of the ZFS_AC_META macro.
By eliminating this and replacing it with awk we can avoid the need
to pull in perl to rebuild the packages.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1380
Add additional dependencies for DKMS package

For the DKMS package to successfully build the kernel-devel
headers must be included along gcc, make, and perl.  The ZFS
code never directly invokes perl but the kernel build system
depends on it.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1380
Illumos #3422, #3425

3422 zpool create/syseventd race yield non-importable pool
3425 first write to a new zvol can fail with EFBIG

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>

References:
  illumos/illumos-gate@bda8819455defbccd06981d9a13b240b682a3d50
  https://www.illumos.org/issues/3422
  https://www.illumos.org/issues/3425

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1390
Allow setting a lower ashift with -o ashift

Previous patches have allowed you to set an increased ashift to
avoid doing 512b IO with 4k sector devices.  However, it was not
possible to set the ashift lower than the reported physical sector
size even when a smaller logical size was supported.  In practice,
there are several cases where settong a lower ashift is useful:

* Most modern drives now correctly report their physical sector
  size as 4k.  This causes zfs to correctly default to using a 4k
  sector size (ashift=12).  However, for some usage models this
  new default ashift value causes an unacceptable increase in
  space usage.  Filesystems with many small files may see the
  total available space reduced to 30-40% which is unacceptable.

* When replacing a drive in an existing pool which was created
  with ashift=9 a modern 4k sector drive cannot be used.  The
  'zpool replace' command will issue an error that the new drive
  has an 'incompatible sector alignment'.  However, by allowing
  the ashift to be manual specified as smaller, non-optimal,
  value the device may still be safely used.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1381
Closes #1328
Issue #967
Issue #548
Add support for options to 'sharesmb'.
Fixes: #1182
+ Move nfs.c:foreach_nfs_shareopt() to libshare.c:foreach_shareopt()
  so that it can be (re)used in smb.c (and later iscsi.c).
+ Call net(8) with the guest_ok option.
+ Rewrite the sharesmb part of the zfs(8) manpage.
  + Add more examples
  + Inform about the (new) options to sharesmb.
+ Add STDERR_VERBOSE to libzfs_run_process() so that we
  can catch any errors from net(8).
+ Don't call smb_retrieve_shares() after enabling a share.
  No point, it's done when really needed anyway.
+ Support 'y', 'yes' and 'true' for guest_ok.
* If sharesmb=on, just exit cleanly directly at the top of
  get_smb_shareopts_cb().
* Remove param 2 and 3 from smb_enable_share_one(). That is
  availible in the first param - the impl_share struct.
* Extra debugging added in smb_enable_share_one() - print
  all our options just before we call net(8).
Merge branch 'smbfs_opts' into iscsi+crypto