@@ -117,29 +117,29 @@ func zfs(arg ...string) ([][]string, error) {
117117// Datasets returns a slice of ZFS datasets, regardless of type.
118118// A filter argument may be passed to select a dataset with the matching name,
119119// or empty string ("") may be used to select all datasets.
120- func Datasets (filter string ) ([]* Dataset , error ) {
121- return listByType ("all" , filter )
120+ func Datasets (filter string , depth int ) ([]* Dataset , error ) {
121+ return listByType ("all" , filter , depth )
122122}
123123
124124// Snapshots returns a slice of ZFS snapshots.
125125// A filter argument may be passed to select a snapshot with the matching name,
126126// or empty string ("") may be used to select all snapshots.
127- func Snapshots (filter string ) ([]* Dataset , error ) {
128- return listByType (DatasetSnapshot , filter )
127+ func Snapshots (filter string , depth int ) ([]* Dataset , error ) {
128+ return listByType (DatasetSnapshot , filter , depth )
129129}
130130
131131// Filesystems returns a slice of ZFS filesystems.
132132// A filter argument may be passed to select a filesystem with the matching name,
133133// or empty string ("") may be used to select all filesystems.
134- func Filesystems (filter string ) ([]* Dataset , error ) {
135- return listByType (DatasetFilesystem , filter )
134+ func Filesystems (filter string , depth int ) ([]* Dataset , error ) {
135+ return listByType (DatasetFilesystem , filter , depth )
136136}
137137
138138// Volumes returns a slice of ZFS volumes.
139139// A filter argument may be passed to select a volume with the matching name,
140140// or empty string ("") may be used to select all volumes.
141- func Volumes (filter string ) ([]* Dataset , error ) {
142- return listByType (DatasetVolume , filter )
141+ func Volumes (filter string , depth int ) ([]* Dataset , error ) {
142+ return listByType (DatasetVolume , filter , depth )
143143}
144144
145145// GetDataset retrieves a single ZFS dataset by name. This dataset could be
@@ -277,7 +277,7 @@ func (d *Dataset) GetProperty(key string) (string, error) {
277277
278278// Snapshots returns a slice of all ZFS snapshots of a given dataset.
279279func (d * Dataset ) Snapshots () ([]* Dataset , error ) {
280- return Snapshots (d .Name )
280+ return Snapshots (d .Name , 1 )
281281}
282282
283283// CreateFilesystem creates a new ZFS filesystem with the specified name and
0 commit comments