func (afb *AioFileBackend) Flush(ctx context.Context) error {
	return afb.aio.Flush()
}
Flush implements Backend.Flush
package nbd
import (
	"github.com/traetox/goaio"
	"golang.org/x/net/context"
	"os"
)
type AioFileBackend struct {
	aio  *goaio.AIO
	size uint64
}
func (afb *AioFileBackend) WriteAt(ctx context.Context, b []byte, offset int64, fua bool) (int, error) {
	if err := afb.aio.Wait(); err != nil {
		return 0, err
	}
	requestId, err := afb.aio.WriteAt(b, offset)
	if err != nil {
		return 0, err
	}
	n, err := afb.aio.WaitFor(requestId)
	if err != nil {
		return 0, err
	}
	if fua {
		if err := afb.aio.Flush(); err != nil {
			return 0, err
		}
	}
	return n, err
}
func (afb *AioFileBackend) ReadAt(ctx context.Context, b []byte, offset int64) (int, error) {
	if err := afb.aio.Wait(); err != nil {
		return 0, err
	}
	requestId, err := afb.aio.ReadAt(b, offset)
	if err != nil {
		return 0, err
	}
	n, err := afb.aio.WaitFor(requestId)
	if err != nil {
		return 0, err
	}
	return n, err
}
func (afb *AioFileBackend) TrimAt(ctx context.Context, length int, offset int64) (int, error) {
	return length, nil
}