lib/zfs.js
function mount(opts, cb) {
    "use strict";
    
    var params = [ 'mount' ];
    
    if (opts.overlay) {
        params.push('-O');
    }
    
    if (opts.options) {
        if (opts.options.length) {
            //opts.options is an array
            for (var x =0; x < opts.options.length; x++) {
                params.push('-o', opts.options[x]);
            }
        } else {
            //opts.options is a single object, callback err and return
            cb({error:'invalid argu: the options should be a string array'});
            return;
        }
    }
    
    if (opts.dataset) {
        params.push(opts.dataset);  
    } else {
        params.push('-a');
    }
    
    zfs(params, cb);
}
function mount(opts, cb) {
    "use strict";
    
    var params = [ 'mount' ];
    
    if (opts.overlay) {
        params.push('-O');
    }
    
    if (opts.options) {
        if (opts.options.length) {
            //opts.options is an array
            for (var x =0; x < opts.options.length; x++) {
                params.push('-o', opts.options[x]);
            }
        } else {
            //opts.options is a single object, callback err and return
            cb({error:'invalid argu: the options should be a string array'});
            return;
        }
    }
    
    if (opts.dataset) {
        params.push(opts.dataset);  
    } else {
        params.push('-a');
    }
    
    zfs(params, cb);
}
/*

Mount the specified dataset/all datasets to the mountpoint

PARAMS:
opts: {
dataset: string // the name of the zfs dataset. if the dataset is null, then mount all datasets with '-a'
overlay: boolean // whether use overlay mode
options: [string, string, ...] // the temporal properties set for the mount duration,
such as ro/rw for readonly and readwrite (optional)
}