From 50acbc303b8e9fe058bb86dc14c8bb5e899d55d4 Mon Sep 17 00:00:00 2001 From: xuzhipeng Date: Sat, 20 Nov 2021 19:16:51 +0800 Subject: [PATCH 1/2] update fd.go glusterfs 6 changed API --- gfapi/fd.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gfapi/fd.go b/gfapi/fd.go index 1eb4e34..1a94521 100644 --- a/gfapi/fd.go +++ b/gfapi/fd.go @@ -45,7 +45,7 @@ func (fd *Fd) Fstat(stat *syscall.Stat_t) error { // // Returns error on failure func (fd *Fd) Fsync() error { - ret, err := C.glfs_fsync(fd.fd) + ret, err := C.glfs_fsync(fd.fd, nil, nil) if ret < 0 { return err } @@ -56,7 +56,7 @@ func (fd *Fd) Fsync() error { // // Returns error on failure func (fd *Fd) Ftruncate(size int64) error { - _, err := C.glfs_ftruncate(fd.fd, C.off_t(size)) + _, err := C.glfs_ftruncate(fd.fd, C.off_t(size), nil, nil) return err } @@ -65,7 +65,7 @@ func (fd *Fd) Ftruncate(size int64) error { // // Returns number of bytes read on success and error on failure func (fd *Fd) Pread(b []byte, off int64) (int, error) { - n, err := C.glfs_pread(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0) + n, err := C.glfs_pread(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0, nil) return int(n), err } @@ -74,7 +74,7 @@ func (fd *Fd) Pread(b []byte, off int64) (int, error) { // // Returns number of bytes written on success and error on failure func (fd *Fd) Pwrite(b []byte, off int64) (int, error) { - n, err := C.glfs_pwrite(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0) + n, err := C.glfs_pwrite(fd.fd, unsafe.Pointer(&b[0]), C.size_t(len(b)), C.off_t(off), 0, nil, nil) return int(n), err } @@ -258,4 +258,4 @@ func (fd *Fd) Readdirnames(n int) ([]string, error) { } return names, nil -} +} \ No newline at end of file From 8a5822ff549572133dea307ce8210c453fc632bd Mon Sep 17 00:00:00 2001 From: xuzhipeng Date: Sat, 20 Nov 2021 19:32:02 +0800 Subject: [PATCH 2/2] update go.doc , change import addr --- gfapi/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfapi/doc.go b/gfapi/doc.go index 88759c0..cad1bb4 100644 --- a/gfapi/doc.go +++ b/gfapi/doc.go @@ -15,4 +15,4 @@ // // The gfapi.File implements the same interfaces as os.File, and can be used wherever os.File is used. // XXX: Acutally verify this. -package gfapi //import "github.com/gluster/gogfapi/gfapi" +package gfapi //import "github.com/xuzhipeng12/gogfapi/gfapi"