zfsonlinux/zfs — pull request #2790 by FransUrbo (2014-10-11 10:56:30+00:00)
Title: Rewrite of nfs.c to keep options per host separated.

Example: Setting sharenfs to
```
"rw=@192.168.69.8,no_subtree_check,no_root_squash,ro=@192.168.69.45,no_subtree_check,root_squash"
```
will create the option string
```
sec=sys,ro,no_subtree_check,no_root_squash,mountpoint,no_subtree_check,no_root_squash,no_subtree_check,root_squash
```
which is then run on _each host_!. Part of this is "default" options.

Instead, go through the option string, look for hosts and then make sure options for each host is kept apart by using a linked list (maintained by the ZFS list_* functions).
Also, the default options should only be added to the list of options if setting sharenfs to on.

Closes: #2773