code: func BlockDeviceDiscard(path string) error {
  	file, err := os.OpenFile(path, os.O_RDWR, 0)
  	if err != nil {
  		return err
  	}
  	defer file.Close()
  
  	size, err := GetBlockDeviceSize(file)
  	if err != nil {
  		return err
  	}
  
  	if err := ioctlBlkDiscard(file.Fd(), 0, size); err != nil {
  		return err
  	}
  
  	// Without this sometimes the remove of the device that happens after
  	// discard fails with EBUSY.
  	unix.Sync()
  
  	return nil
  }
docs: // BlockDeviceDiscard runs discard for the given path.
  // This is used as a workaround for the kernel not discarding block so
  // on the thin pool when we remove a thinp device, so we do it
  // manually