Add some comments and description, double check the return values.
Merge branch 'master' of gitserver.ixsystems.com:/git/repos/freenas-build/freenas