From 0f8f050563803de89c7104df31ed1df3a905e43a Mon Sep 17 00:00:00 2001 From: Faruk Kasumovic Date: Fri, 17 Jan 2020 09:57:13 +0100 Subject: [PATCH] Remove SendOne since it does not make sense in context of this lib --- sendrecv.go | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/sendrecv.go b/sendrecv.go index 579142f..e4bcc34 100644 --- a/sendrecv.go +++ b/sendrecv.go @@ -12,7 +12,6 @@ import ( "fmt" "io/ioutil" "os" - "path" "regexp" "strconv" "strings" @@ -128,48 +127,6 @@ func (d *Dataset) send(FromName string, outf *os.File, flags *SendFlags) (err er return } -func (d *Dataset) SendOne(FromName string, outf *os.File, flags *SendFlags) (err error) { - var cfromname, ctoname *C.char - var dpath string - var lzc_send_flags C.struct_sendflags - - if d.Type == DatasetTypeSnapshot || (len(FromName) > 0 && !strings.Contains(FromName, "#")) { - err = fmt.Errorf( - "Unsupported with snapshot. Use func Send() for that purpose.") - return - } - if flags.Replicate || flags.DoAll || flags.Props || flags.Dedup || flags.DryRun { - err = fmt.Errorf("Unsupported flag with filesystem or bookmark.") - return - } - - if flags.LargeBlock { - lzc_send_flags.largeblock = booleanT(true) - } - if flags.EmbedData { - lzc_send_flags.embed_data = booleanT(true) - } - // if (flags.Compress) - // lzc_send_flags |= LZC_SEND_FLAG_COMPRESS; - if dpath, err = d.Path(); err != nil { - return - } - if len(FromName) > 0 { - if FromName[0] == '#' || FromName[0] == '@' { - FromName = dpath + FromName - } - cfromname = C.CString(FromName) - defer C.free(unsafe.Pointer(cfromname)) - } - ctoname = C.CString(path.Base(dpath)) - defer C.free(unsafe.Pointer(ctoname)) - cerr := C.zfs_send_one(d.list.zh, cfromname, C.int(outf.Fd()), &lzc_send_flags, nil) - if cerr != 0 { - err = LastError() - } - return -} - func (d *Dataset) SendResume(outf *os.File, flags *SendFlags, receiveResumeToken string) (err error) { if d.Type != DatasetTypeSnapshot { err = fmt.Errorf("Unsupported method on filesystem or bookmark. Use func SendOne() for that purpose.")